/* Área reservada · gestão da rede */
:root {
  --c-1: #D1166F; /* balcão  */
  --c-2: #E0A530; /* delivery próprio (contraste baixo: sempre com rótulo) */
  --c-3: #0A86A8; /* iFood */
  --ok: #1E8E4E; --warn: #C27A00; --crit: #C62828;
  --line: rgba(43, 17, 22, .1);
  --muted: rgba(43, 17, 22, .62);
  --side: 248px;
}
body.page-admin { background: var(--cream-2); font-size: 15px; }
.adm { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }

/* ---------- barra lateral */
.adm__side { position: sticky; top: 0; height: 100vh; background: var(--cocoa); color: var(--cream); display: flex; flex-direction: column; padding: 22px 14px; gap: 26px; }
.adm__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; }
.adm__brand img { width: 40px; height: 40px; border-radius: 50%; }
.adm__brand span { font-family: var(--f-display); font-weight: 800; font-size: 19px; line-height: 1; font-variation-settings: 'SOFT' 100; }
.adm__brand small { display: block; font-family: var(--f-body); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; opacity: .65; margin-top: 4px; }
.adm__nav { display: grid; gap: 2px; }
.adm__nav button { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; font-weight: 500; text-align: left; color: rgba(255,245,236,.78); transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out); }
.adm__nav button:active { transform: scale(.98); }
.adm__nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.adm__nav button[aria-current='page'] { background: var(--pink); color: #fff; }
@media (hover: hover) and (pointer: fine) { .adm__nav button:not([aria-current]):hover { background: rgba(255,245,236,.08); color: var(--cream); } }
.adm__badge { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--butter); color: var(--cocoa); display: grid; place-items: center; }
.adm__badge:empty { display: none; }
.adm__sidefoot { margin-top: auto; display: grid; gap: 10px; padding: 0 8px; font-size: 13px; }
.adm__sidefoot a { opacity: .7; text-decoration: none; }
.adm__demo { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255,245,236,.08); }
.adm__demo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--butter); flex: none; }

/* ---------- área principal */
.adm__main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 64px; }
.adm__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.adm__hello { font-size: 14px; color: var(--muted); }
.adm__title { font-family: var(--f-display); font-weight: 800; font-size: clamp(34px, 4vw, 52px); letter-spacing: -.035em; line-height: 1; margin-top: 4px; font-variation-settings: 'SOFT' 100; }
.adm__tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.seg button { height: 34px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); transition: background-color 200ms ease, color 200ms ease; }
.seg button[aria-pressed='true'] { background: var(--cocoa); color: var(--cream); }
.view[hidden] { display: none; }
.view { display: grid; gap: 18px; animation: view-in 320ms var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- cartões e grades */
.grid { display: grid; gap: 18px; }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-1 { grid-template-columns: 1fr 1fr; }
.g-1-2 { grid-template-columns: minmax(300px, 1fr) 2fr; align-items: start; }
@media (max-width: 1100px) { .g-2-1, .g-1-1, .g-1-2 { grid-template-columns: 1fr; } }
.card { background: #fff; border-radius: 26px; padding: 22px; min-width: 0; }
.card--pink { background: var(--pink); color: var(--cream); }
.card--sticky { position: sticky; top: 20px; }
.card__h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.card__h h2 { font-family: var(--f-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1.1; font-variation-settings: 'SOFT' 100; }
.card__sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.card--pink .card__sub { color: rgba(255,245,236,.78); }
.link-btn { font-weight: 600; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; background: var(--cream-2); color: var(--cocoa); transition: transform 160ms var(--ease-out); white-space: nowrap; }
.link-btn:active { transform: scale(.97); }
.card--pink .link-btn { background: rgba(255,245,236,.18); color: var(--cream); }

/* ---------- KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: #fff; border-radius: 22px; padding: 18px 20px; display: grid; gap: 6px; }
.kpi:first-child { background: var(--cocoa); color: var(--cream); }
.kpi__l { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi:first-child .kpi__l { color: rgba(255,245,236,.7); }
.kpi__v { font-family: var(--f-display); font-weight: 800; font-size: clamp(26px, 2.4vw, 34px); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; font-variation-settings: 'SOFT' 100; }
.kpi__d { font-size: 13px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.up { color: var(--ok); } .down { color: var(--crit); }
.kpi:first-child .up { color: #7FE0A6; } .kpi:first-child .down { color: #FF9A9A; }

/* ---------- gráficos */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.ax text { font-size: 11.5px; fill: var(--muted); font-family: var(--f-body); }
.ax line { stroke: var(--line); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.tt { position: fixed; z-index: 100; pointer-events: none; background: var(--cocoa); color: var(--cream); border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.45; box-shadow: 0 16px 30px -12px rgba(43,17,22,.5); transform: translate(-50%, calc(-100% - 12px)); min-width: 140px; white-space: nowrap; }
.tt b { font-weight: 700; display: block; margin-bottom: 2px; }
.tt i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.tt span { display: flex; justify-content: space-between; gap: 14px; }

.bars { display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 12px; font-size: 14px; cursor: default; transition: background-color 150ms ease; }
.bar:hover, .bar:focus-visible { background: var(--cream); }
.bar__n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__t { height: 12px; background: var(--cream-2); border-radius: 4px; overflow: hidden; }
.bar__f { height: 100%; background: var(--c-1); border-radius: 0 4px 4px 0; transform-origin: left; animation: grow 700ms var(--ease-out) both; }
@keyframes grow { from { transform: scaleX(0); } }
.bar__v { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 74px; text-align: right; }

.heat { display: grid; grid-template-columns: 34px repeat(13, 1fr); gap: 3px; font-size: 11px; color: var(--muted); }
.heat__c { aspect-ratio: 1; border-radius: 6px; min-width: 0; }
.heat__c:hover { outline: 2px solid var(--cocoa); outline-offset: 1px; }
.heat__l { display: flex; align-items: center; }
.heat__h { text-align: center; }
.heat-scale { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.heat-scale i { width: 22px; height: 10px; border-radius: 3px; }

/* ---------- tabelas */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color 150ms ease; }
.tbl tbody tr:hover { background: var(--cream); }
.tbl td strong { font-weight: 600; display: block; }
.tbl td small { color: var(--muted); }
.spark { width: 96px; height: 28px; }
.search input, .search select { height: 40px; border-radius: 999px; border: 0; box-shadow: inset 0 0 0 1px var(--line); background: #fff; padding: 0 16px; font: inherit; font-size: 14px; color: var(--cocoa); outline: none; }
.search input:focus, .search select:focus { box-shadow: inset 0 0 0 2px var(--pink); }

/* ---------- selos de estado (sempre ícone + texto) */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.st::before { font-size: 11px; }
.st--ok { background: #E3F4EA; color: var(--ok); } .st--ok::before { content: '●'; }
.st--warn { background: #FFF1D6; color: #8A5600; } .st--warn::before { content: '▲'; }
.st--build { background: #E3EEF6; color: #0A5F78; } .st--build::before { content: '◆'; }
.st--crit { background: #FDE4E4; color: var(--crit); } .st--crit::before { content: '■'; }
.st--neutral { background: var(--cream-2); color: var(--cocoa); }

/* ---------- unidades */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar__count { font-size: 14px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { height: 36px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out); }
.chips button:active { transform: scale(.97); }
.chips button[aria-pressed='true'] { background: var(--cocoa); color: var(--cream); box-shadow: none; }
.units-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.u { background: #fff; border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; text-align: left; transition: transform 300ms var(--ease-out), box-shadow 300ms ease; }
.u:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) { .u:hover { box-shadow: 0 20px 40px -24px rgba(43,17,22,.4); } }
.u__img { position: relative; aspect-ratio: 16 / 9; background: var(--rose); }
.u__img img { width: 100%; height: 100%; object-fit: cover; }
.u__img .st { position: absolute; top: 12px; left: 12px; }
.u__body { padding: 16px 18px 18px; display: grid; gap: 4px; }
.u__city { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--pink); }
.u h3 { font-family: var(--f-display); font-weight: 700; font-size: 21px; letter-spacing: -.02em; line-height: 1.1; font-variation-settings: 'SOFT' 100; }
.u__meta { font-size: 13px; color: var(--muted); }
.u__nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.u__nums b { display: block; font-family: var(--f-display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; font-variation-settings: 'SOFT' 100; }
.u__nums small { font-size: 11.5px; color: var(--muted); }

/* ---------- recados */
.form--adm .field input, .form--adm .field textarea, .form--adm .field select { background: var(--cream); box-shadow: none; border-radius: 14px; padding: 12px 14px; }
.form--adm .field textarea { min-height: 120px; }
.form--adm .field input:focus, .form--adm .field textarea:focus, .form--adm .field select:focus { box-shadow: inset 0 0 0 2px var(--pink); }
.feed { display: grid; gap: 12px; }
.post { background: #fff; border-radius: 22px; padding: 18px 20px; display: grid; gap: 8px; }
.post--new { animation: pop 450ms var(--ease-out); }
.post__top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.post h3 { font-family: var(--f-display); font-size: 20px; font-weight: 700; letter-spacing: -.015em; font-variation-settings: 'SOFT' 100; }
.post p { color: rgba(43,17,22,.85); }
.post__meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.reads { display: inline-flex; align-items: center; gap: 8px; }
.reads__t { width: 80px; height: 6px; background: var(--cream-2); border-radius: 4px; overflow: hidden; }
.reads__f { height: 100%; background: var(--ok); border-radius: 4px; }
.post__del { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.mini-feed { display: grid; gap: 10px; }
.mini-feed li { background: rgba(255,245,236,.14); border-radius: 16px; padding: 12px 14px; }
.mini-feed b { display: block; font-weight: 600; }
.mini-feed small { opacity: .75; font-size: 12.5px; }

/* ---------- tarefas */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.col { background: rgba(255,255,255,.55); border-radius: 24px; padding: 14px; display: grid; gap: 10px; min-height: 200px; transition: background-color 200ms ease; }
.col.is-over { background: var(--rose); }
.col__h { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 4px; }
.col__h h2 { font-family: var(--f-display); font-size: 19px; font-weight: 700; font-variation-settings: 'SOFT' 100; }
.col__h span { font-size: 13px; font-weight: 600; color: var(--muted); }
.task { background: #fff; border-radius: 18px; padding: 14px; display: grid; gap: 8px; cursor: grab; box-shadow: 0 1px 0 var(--line); transition: transform 200ms var(--ease-out), box-shadow 200ms ease, opacity 200ms ease; touch-action: manipulation; }
.task.is-drag { opacity: .4; }
.task b { font-weight: 600; line-height: 1.3; }
.task__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.task__late { color: var(--crit); font-weight: 600; }
.task__move { display: flex; gap: 6px; }
.task__move button { font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--cream-2); transition: transform 160ms var(--ease-out); }
.task__move button:active { transform: scale(.95); }
.col--done .task b { text-decoration: line-through; text-decoration-color: rgba(43,17,22,.35); color: var(--muted); }
.mini-tasks { display: grid; gap: 8px; }
.mini-tasks li { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--cream); font-size: 14px; }
.mini-tasks small { color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr; } }

/* ---------- leads */
.funnel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.fstep { background: #fff; border-radius: 20px; padding: 16px; display: grid; gap: 4px; text-align: left; transition: transform 160ms var(--ease-out), background-color 200ms ease; }
.fstep:active { transform: scale(.98); }
.fstep b { font-family: var(--f-display); font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; font-variation-settings: 'SOFT' 100; }
.fstep small { font-size: 13px; color: var(--muted); font-weight: 500; }
.fstep[aria-pressed='true'] { background: var(--cocoa); color: var(--cream); }
.fstep[aria-pressed='true'] small { color: rgba(255,245,236,.7); }
@media (max-width: 900px) { .funnel { grid-template-columns: repeat(3, 1fr); } }
.tbl--leads td:first-child { min-width: 170px; }
.lead-new { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--butter); color: var(--cocoa); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.row-btn { font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--cream-2); white-space: nowrap; }

/* ---------- insights */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ins { border-radius: 24px; padding: 20px; display: grid; gap: 10px; align-content: start; background: #fff; }
.ins:nth-child(4n+1) { background: var(--cocoa); color: var(--cream); }
.ins:nth-child(4n+2) { background: var(--mint); }
.ins:nth-child(4n+3) { background: var(--rose); }
.ins__tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.ins h3 { font-family: var(--f-display); font-size: 22px; font-weight: 700; line-height: 1.15; letter-spacing: -.015em; font-variation-settings: 'SOFT' 100; }
.ins p { font-size: 14px; opacity: .85; }

/* ---------- gaveta e aviso */
.panel { position: fixed; inset: 0; z-index: 90; }
.panel[hidden] { display: block; visibility: hidden; pointer-events: none; transition: visibility 0s 450ms; }
.panel__scrim { position: absolute; inset: 0; background: rgba(43,17,22,.45); opacity: 0; transition: opacity 350ms ease; }
.panel__box { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(480px, calc(100% - 24px)); background: var(--cream); border-radius: 28px; display: flex; flex-direction: column; transform: translateX(calc(100% + 24px)); transition: transform 450ms var(--ease-drawer); }
.panel.is-open .panel__scrim { opacity: 1; }
.panel.is-open .panel__box { transform: none; }
.panel__h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 24px 8px; }
.panel__h h2 { font-family: var(--f-display); font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variation-settings: 'SOFT' 100; }
.panel__body { padding: 12px 24px 28px; overflow: auto; flex: 1; }
.panel__body .form { grid-template-columns: 1fr 1fr; }
.dl { display: grid; gap: 0; margin: 0 0 20px; }
.dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 600; text-align: right; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 120; translate: -50% 0; background: var(--cocoa); color: var(--cream); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(12px); transition: opacity 250ms ease, transform 350ms var(--ease-out); pointer-events: none; }
.toast.is-on { opacity: 1; transform: none; }

/* ---------- celular: barra lateral vira barra inferior */
@media (max-width: 860px) {
  .adm { grid-template-columns: 1fr; }
  .adm__side { position: fixed; inset: auto 0 0 0; height: auto; z-index: 60; flex-direction: row; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 0; border-radius: 22px 22px 0 0; }
  .adm__brand, .adm__sidefoot { display: none; }
  .adm__nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .adm__nav::-webkit-scrollbar { display: none; }
  .adm__nav button { flex-direction: column; gap: 4px; padding: 8px 10px; font-size: 11px; min-width: 76px; align-items: center; text-align: center; border-radius: 14px; }
  .adm__nav button span { white-space: nowrap; }
  .adm__badge { position: absolute; top: 2px; right: 10px; min-width: 18px; height: 18px; font-size: 10.5px; }
  .adm__main { padding: 18px 16px 110px; }
  .bar { grid-template-columns: 100px 1fr auto; gap: 8px; font-size: 13px; }
  .bar__v { min-width: 62px; }
  .panel__box { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 90vh; border-radius: 26px 26px 0 0; transform: translateY(100%); }
  .panel__body .form { grid-template-columns: 1fr; }
  .card { padding: 18px; border-radius: 22px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .heat { grid-template-columns: 28px repeat(13, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .view, .bar__f, .post--new { animation: none; }
}
