:root {
  --ink: #0a0b0e; --panel: #15171c; --panel-2: #1c1f25; --line: #2b2e35;
  --text: #f3f4f6; --muted: #a4abb6; --steel: #c9ced6;
  --orange: #f26a1b; --orange-hover: #ff7f33; --on-orange: #150a03;
  --ok: #4cc27a; --ok-bg: rgba(76, 194, 122, .14);
  --warn: #f2b33d; --warn-bg: rgba(242, 179, 61, .14);
  --wait: #a4abb6; --wait-bg: rgba(164, 171, 182, .14);
  --post: #7ab4ff; --post-bg: rgba(122, 180, 255, .14);
  --danger: #ff6b6b;
  --display: 'Saira', 'Segoe UI', system-ui, sans-serif;
  --body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.5; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
a { color: var(--orange); }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) 72px max(16px, env(safe-area-inset-left)); }

/* topo */
.bar { position: sticky; top: 0; z-index: 10; background: rgba(10, 11, 14, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { height: 30px; width: auto; display: block; }
.brand span { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.brand span b { color: var(--orange); font-weight: 800; }
.bar .grow { flex: 1; }
.who { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link { background: none; border: 0; color: var(--muted); padding: 6px 4px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
@media (max-width: 560px) { .who { display: none; } .brand span { display: none; } }

/* botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.btn.primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #06140b; }
.btn.warn { background: transparent; border-color: var(--warn); color: var(--warn); }
.btn.danger { background: transparent; border-color: rgba(255, 107, 107, .5); color: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 14px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input, select, textarea { width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); outline: none; }
textarea { min-height: 96px; resize: vertical; }
.field { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.err { color: var(--danger); font-size: 14px; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 13px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(242, 106, 27, .18), transparent 70%), var(--ink); }
.login-box { width: 100%; max-width: 380px; text-align: center; }
.login-box img { width: 150px; height: auto; margin: 0 auto 18px; display: block; filter: drop-shadow(0 8px 24px rgba(0,0,0,.6)); }
.login-box h1 { font-size: 28px; font-weight: 800; font-style: italic; text-transform: uppercase; }
.login-box h1 b { color: var(--orange); }
.login-box p { color: var(--muted); margin: 6px 0 26px; }
.login-box form { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.login-box .btn { width: 100%; margin-top: 4px; }

/* títulos de página */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 18px; }
.eyebrow { font-family: var(--display); font-weight: 800; font-style: italic; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--orange); }
.head h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin-top: 2px; }
.head .sub { color: var(--muted); margin-top: 4px; }
.back { background: none; border: 0; color: var(--muted); padding: 0; font-size: 14px; margin-bottom: 12px; }
.back:hover { color: var(--text); }

/* abas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; border-bottom: 2.5px solid transparent; margin-bottom: -1px; padding: 10px 14px; color: var(--muted);
  font-family: var(--display); font-weight: 600; font-size: 15px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tab b { font-family: var(--body); font-size: 12px; font-weight: 700; background: var(--line); color: var(--text); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--orange); }

/* clientes (Flip) */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.client { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.client:hover { border-color: var(--muted); }
.client h3 { font-size: 19px; font-weight: 800; }
.client.off { opacity: .55; }
.counts { display: flex; flex-wrap: wrap; gap: 6px; }
.client .foot { color: var(--muted); font-size: 13px; }

/* status */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.aguardando { color: var(--wait); background: var(--wait-bg); }
.pill.ajustes { color: var(--warn); background: var(--warn-bg); }
.pill.aprovado { color: var(--ok); background: var(--ok-bg); }
.pill.postado { color: var(--post); background: var(--post-bg); }

/* lista de peças por data */
.day { margin-bottom: 30px; }
.day-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.day-head h2 { font-size: 18px; font-weight: 700; }
.day-head h2::first-letter { text-transform: uppercase; }
.day-head span { color: var(--muted); font-size: 14px; }
.day-head .hoje { color: var(--orange); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.card { display: flex; flex-direction: column; text-align: left; background: none; border: 0; padding: 0; min-width: 0; }
.cover { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.cover img, .cover video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.card:hover .cover img, .card:hover .cover video { transform: scale(1.025); }
.cover .tipo { position: absolute; top: 9px; left: 9px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.cover .vazio { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; padding: 12px; text-align: center; }
.cover .play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.cover .play::before { content: ""; width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,.55); }
.cover .play::after { content: ""; position: absolute; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
.card h3 { font-family: var(--body); font-size: 15px; font-weight: 600; margin-top: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; border: 1px dashed var(--line); border-radius: 14px; }

/* detalhe */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.detail-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 20px; }
.detail-head h1 { font-size: clamp(22px, 3.4vw, 32px); font-weight: 800; flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
.detail-head .date { width: 100%; color: var(--muted); font-size: 14px; }
.detail-head .date::first-letter { text-transform: uppercase; }

.viewer { position: relative; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 14px; background: #000; scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; display: grid; place-items: center; aspect-ratio: 4 / 5; background: #000; }
.viewer.vertical .slide { aspect-ratio: 9 / 16; max-height: 80vh; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92);
  color: #111; font-size: 22px; line-height: 1; box-shadow: 0 1px 6px rgba(0,0,0,.35); }
.nav.prev { left: 10px; } .nav.next { right: 10px; }
.nav[disabled] { opacity: 0; pointer-events: none; }
.counter { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: 0 0 auto; width: 56px; aspect-ratio: 4 / 5; padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; background: var(--panel-2); }
.thumbs button[aria-current="true"] { border-color: var(--orange); }
.thumbs img, .thumbs video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.no-media { aspect-ratio: 4 / 5; border: 1.5px dashed var(--line); border-radius: 14px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 17px; font-weight: 700; }
.status-line { color: var(--muted); font-size: 14px; margin-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.caption { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; max-height: 260px; overflow-y: auto; }
.sep { border-top: 1px solid var(--line); padding-top: 16px; }

.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.note { border-top: 1px solid var(--line); padding-top: 12px; }
.note .by { font-size: 13px; color: var(--muted); }
.note .by b { color: var(--text); font-weight: 600; }
.note .by .flip { color: var(--orange); }
.note .txt { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; margin-right: 6px;
  background: var(--wait-bg); color: var(--wait); border: 0; vertical-align: 1px; }
.tag.ajuste { background: var(--warn-bg); color: var(--warn); }
.tag.aprovacao { background: var(--ok-bg); color: var(--ok); }
button.tag { cursor: pointer; }

/* gerenciar arquivos (Flip) */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.file { position: relative; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.file img, .file video { width: 100%; height: 100%; object-fit: cover; display: block; }
.file .n { position: absolute; top: 5px; left: 5px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.file .ctl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 2px; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.file .ctl button { border: 0; background: rgba(255,255,255,.92); color: #111; border-radius: 6px; width: 26px; height: 26px; font-size: 14px; line-height: 1; padding: 0; }
.file .ctl button.x { background: var(--danger); color: #fff; }
.file.capa { outline: 2px solid var(--orange); }
.drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: 14px; }
.drop.over { border-color: var(--orange); color: var(--text); background: rgba(242, 106, 27, .06); }
.drop input { display: none; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }

/* acessos (Flip) */
.users { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.user { border-top: 1px solid var(--line); padding: 14px 0; display: flex; flex-direction: column; gap: 6px; }
.user:first-child { border-top: 0; padding-top: 0; }
.user-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user code { color: var(--steel); font-size: 14px; }
.user .actions { gap: 8px; margin-top: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.act { text-align: right; white-space: nowrap; }
.table code { font-size: 14px; color: var(--steel); }
.scroll-x { overflow-x: auto; }
.cards-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .cards-2 { grid-template-columns: minmax(0, 1fr); } }
.share { background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* janela */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.65); }
dialog h2 { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
dialog .actions { justify-content: flex-end; margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--text); color: var(--ink); padding: 10px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.4); z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
