:root {
  --bg: #f6f5f2; --card: #fff; --ink: #1c1f22; --ink2: #4a4e52; --mute: #7c8084; --line: #e4e2dc;
  --sea: #0b857d; --sea-bg: color-mix(in srgb, var(--sea) 12%, #fff);
  --serif: 'Newsreader', Georgia, serif; --sans: 'Schibsted Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; }
.mono { width: 34px; height: 34px; overflow: visible; }
.mono text { fill: currentColor; }

.login { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: var(--ink); }
.login.out { display: none; }
.login-box { width: min(380px, 100%); background: var(--card); padding: 36px 32px 28px; display: grid; gap: 14px; }
.login-box .mono { width: 46px; height: 46px; }
.login-box h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 4px 0 8px; }
.login-box label, .form label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--ink2); }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid var(--line); padding: 11px 12px; width: 100%; border-radius: 2px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sea); outline-offset: -1px; border-color: transparent; }
button, .b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; background: var(--ink); color: #fff; border: 0; font: 600 14px var(--sans); text-decoration: none; cursor: pointer; border-radius: 2px; }
button:hover, .b:hover { background: var(--sea); }
.b--ghost { background: transparent; color: var(--ink2); border: 1px solid var(--line); }
.b--ghost:hover { background: #fff; color: var(--ink); }
.login-box p { font-size: 12px; color: var(--mute); margin: 4px 0 0; }

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; background: var(--ink); color: #f4f3ef; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 26px; text-decoration: none; font-weight: 600; line-height: 1.15; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 10px; text-decoration: none; color: rgba(244, 243, 239, .7); border-radius: 2px; }
.side nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.side nav a.on { color: #fff; background: rgba(255, 255, 255, .1); }
.side nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.side-user { margin: auto 0 0; display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-weight: 600; }
.side-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.side-user small { display: block; font-weight: 400; font-size: 11px; color: rgba(244, 243, 239, .55); }

.main { padding: 32px clamp(18px, 3vw, 44px) 60px; }
.view { display: none; } .view.on { display: block; }
.main-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.main-h h1 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1; margin: 0 0 6px; }
.main-h p { margin: 0; color: var(--mute); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 24px; }
.stats div { background: var(--card); padding: 16px 18px; }
.stats b { display: block; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; }
.stats span { color: var(--mute); font-size: 12px; }

.tabela { background: var(--card); border: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 64px minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.1fr) 90px 90px 70px; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); }
#v-contatos .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) 130px; padding: 14px 16px; }
.row:first-child { border-top: 0; }
.row--h { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); padding-top: 12px; padding-bottom: 12px; }
.row img { width: 64px; height: 48px; object-fit: cover; background: var(--bg); }
.row b { display: block; font-weight: 600; font-size: 14px; }
.row small { color: var(--mute); font-size: 12px; }
.row .preco { font-variant-numeric: tabular-nums; }
.row.novo { background: var(--sea-bg); animation: flash 1.6s ease-out; }
@keyframes flash { from { background: #b9e6e1; } }
.tag { justify-self: start; font-size: 11px; font-weight: 600; padding: 3px 8px; background: var(--bg); color: var(--ink2); }
.tag--n { background: var(--sea-bg); color: var(--sea); }
.tag--quente { background: #fbe4d8; color: #a2431a; }
.tag--morno { background: #f6eed6; color: #84650f; }
.tag--frio { background: #e8eef2; color: #4d6070; }
.row--lead { background: #fbfaf7; }
.row--lead small { display: block; }
.sw { position: relative; width: 38px; height: 22px; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sw i { position: absolute; inset: 0; background: #d6d4ce; border-radius: 22px; transition: background .2s; pointer-events: none; }
.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sw input:checked + i { background: var(--sea); }
.sw input:checked + i::after { transform: translateX(16px); }
.sw input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }
.acts { display: flex; gap: 4px; justify-content: flex-end; }
.acts button { height: 30px; width: 30px; padding: 0; background: transparent; color: var(--mute); }
.acts button:hover { background: var(--bg); color: var(--ink); }
.acts svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.form { background: var(--card); border: 1px solid var(--line); padding: 24px; max-width: 900px; }
.f-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.f-grid .span2 { grid-column: span 3; }
textarea { resize: vertical; }
.drop { position: relative; margin-top: 20px; border: 1.5px dashed #cfccc4; padding: 22px; text-align: center; transition: border-color .2s, background .2s; }
.drop.over { border-color: var(--sea); background: var(--sea-bg); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop label { display: grid; gap: 4px; cursor: pointer; }
.drop label b { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.drop label span { color: var(--mute); font-size: 13px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: center; }
.thumbs:empty { display: none; }
.th { position: relative; width: 104px; height: 78px; }
.th img { width: 100%; height: 100%; object-fit: cover; }
.th:first-child::before { content: 'Capa'; position: absolute; left: 0; bottom: 0; background: var(--ink); color: #fff; font-size: 10px; font-weight: 600; padding: 2px 6px; }
.th button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; font-size: 14px; background: rgba(28, 31, 34, .8); }
.f-opts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 20px; }
.chk { display: flex !important; grid-auto-flow: column; align-items: center; gap: 8px !important; font-size: 14px !important; font-weight: 400 !important; letter-spacing: 0 !important; color: var(--ink) !important; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--sea); }
.f-act { display: flex; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; translate: -50% 140%; display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--ink); color: #fff; font-size: 14px; transition: translate .35s cubic-bezier(.2, .7, .1, 1), opacity .2s; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; }
.toast.on { translate: -50% 0; opacity: 1; pointer-events: auto; }
.toast a { color: #8fe0d6; font-weight: 600; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; overflow-x: auto; }
  .side-brand { padding: 0 10px 0 0; } .side-brand span { display: none; }
  .side nav { display: flex; } .side nav a { white-space: nowrap; padding: 8px 10px; }
  .side nav svg { display: none; }
  .side-user { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .row > :nth-child(3), .row > :nth-child(4), .row > :nth-child(6) { display: none; }
  .row--h { display: none; }
  #v-contatos .row { grid-template-columns: 1fr auto; } #v-contatos .row > :nth-child(3) { display: none; }
  .f-grid { grid-template-columns: 1fr; } .f-grid .span2 { grid-column: auto; }
}
