/* =========================================================
   TOOGO — Painel administrativo
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #F4F5F0; color: var(--tinta); font-family: var(--fonte-corpo); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--verde-folha); outline-offset: 2px; }

:root {
  --ad-bg: #F4F5F0; --ad-card: #FFFFFF; --ad-line: #E3E6DD; --ad-soft: #F7F8F4; --ad-muted: #6A7067;
  --ad-side: #121412; --ad-side-2: #1C1F1B; --ad-ok: #3F7D2C; --ad-ok-bg: #EEF5E5; --ad-warn: #A06A12; --ad-warn-bg: #FBF3E2;
  --ad-bad: #B0391F; --ad-bad-bg: #FBEDEA; --ad-radius: 14px; --ease: cubic-bezier(.16,1,.3,1);
}

/* ---------- botões e campos ---------- */
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.a-btn:active { transform: translateY(1px); }
.a-btn--primary { background: var(--tinta); color: #fff; }
.a-btn--primary:hover { background: #2A2E29; box-shadow: 0 6px 18px -8px rgba(20,22,20,.6); }
.a-btn--lime { background: var(--verde-lima); color: var(--tinta); }
.a-btn--lime:hover { background: #A5BF33; }
.a-btn--ghost { background: #fff; border-color: var(--ad-line); color: var(--tinta); }
.a-btn--ghost:hover { border-color: #C9CEC1; background: var(--ad-soft); }
.a-btn--danger { background: #fff; border-color: #EBCBC3; color: var(--ad-bad); }
.a-btn--danger:hover { background: var(--ad-bad-bg); }
.a-btn--danger-solid { background: var(--ad-bad); color: #fff; }
.a-btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.a-btn svg { width: 16px; height: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; transition: background .2s; }
.icon-btn:hover { background: rgba(20,22,20,.06); }
.icon-btn svg { width: 17px; height: 17px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field__label { color: var(--tinta); font-size: 12.5px; font-weight: 600; }
.field__hint { color: var(--ad-muted); font-size: 12px; margin: 0; }
.field__error { color: var(--ad-bad); font-size: 12px; font-weight: 500; margin: 0; }
.field__error:empty { display: none; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #D9DDD2; border-radius: 10px; background: #fff; font-size: 14px; transition: border-color .2s, box-shadow .2s; }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.input:hover, .select:hover, .textarea:hover { border-color: #C3C9BA; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--verde-folha); box-shadow: 0 0 0 3px rgba(178,203,62,.28); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--ad-bad); box-shadow: 0 0 0 3px rgba(176,57,31,.1); }
.input-affix { position: relative; }
.input-affix > span { position: absolute; top: 50%; left: 12px; color: var(--ad-muted); font-size: 13px; transform: translateY(-50%); pointer-events: none; }
.input-affix .input { padding-left: 36px; }
.search { position: relative; }
.search svg { position: absolute; top: 50%; left: 12px; color: var(--ad-muted); transform: translateY(-50%); }
.search .input { padding-left: 38px; }

.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #CFD4C8; transition: background .25s; flex: 0 0 auto; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .3s var(--ease); }
.switch input:checked + .switch__track { background: var(--verde-folha); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--verde-folha); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--ad-soft); color: var(--ad-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill--ok { background: var(--ad-ok-bg); color: var(--ad-ok); }
.pill--warn { background: var(--ad-warn-bg); color: var(--ad-warn); }
.pill--bad { background: var(--ad-bad-bg); color: var(--ad-bad); }
.pill--dark { background: var(--tinta); color: #fff; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill--plain::before { display: none; }

/* ---------- portão de acesso ---------- */
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--ad-side); }
.gate__pixels { display: flex; gap: 8px; }
.gate__pixels i { width: 12px; height: 12px; border-radius: 3px; background: var(--verde-lima); animation: aPulse 1.1s ease-in-out infinite; }
.gate__pixels i:nth-child(2) { animation-delay: .15s; } .gate__pixels i:nth-child(3) { animation-delay: .3s; }
@keyframes aPulse { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-6px); } }
.gate__card { display: grid; justify-items: center; gap: 12px; max-width: 380px; padding: 40px 32px; border-radius: 22px; background: #fff; text-align: center; }
.gate__card h1 { margin: 6px 0 0; font-family: var(--fonte-titulo); font-size: 26px; letter-spacing: -.03em; }
.gate__card p { margin: 0 0 10px; color: var(--ad-muted); }
.gate__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--ad-bad-bg); color: var(--ad-bad); }
.gate__icon svg { width: 26px; height: 26px; }

/* ---------- estrutura ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--ad-side) 252px, transparent 252px); }
.side { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 20px 14px; background: var(--ad-side); color: #DCE0D6; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; text-decoration: none; color: #fff; }
.side__brand img { width: 40px; height: auto; }
.side__brand strong { display: block; font-family: var(--fonte-titulo); font-size: 19px; letter-spacing: -.05em; line-height: 1; }
.side__brand small { color: var(--verde-lima); font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.side__nav { display: grid; gap: 2px; }
.side__nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #B7BDB1; text-decoration: none; font-weight: 500; transition: background .2s, color .2s; }
.side__nav a:hover { background: var(--ad-side-2); color: #fff; }
.side__nav a[aria-current="page"] { background: var(--ad-side-2); color: #fff; box-shadow: inset 2px 0 0 var(--verde-lima); }
.side__nav a[aria-current="page"] svg { color: var(--verde-lima); }
.side__count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: 11.5px; font-weight: 600; }
.side__soon { margin-left: auto; padding: 1px 7px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); color: #8D9488; font-size: 10.5px; }
.side__foot { display: grid; gap: 10px; margin-top: auto; }
.side__store { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; color: #DCE0D6; text-decoration: none; font-weight: 500; transition: border-color .2s; }
.side__store:hover { border-color: var(--verde-lima); }
.side__user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--ad-side-2); }
.side__avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--gradiente-marca); color: var(--tinta); font-family: var(--fonte-titulo); font-weight: 700; flex: 0 0 auto; }
.side__who { min-width: 0; flex: 1; }
.side__who strong, .side__who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__who strong { color: #fff; font-size: 13px; }
.side__who small { color: #8D9488; font-size: 11.5px; }
.side__user .icon-btn:hover { background: rgba(255,255,255,.08); }
.side-scrim { display: none; }

.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 64px; }
.topbar { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.topbar__menu { display: none; }
.topbar__eyebrow { margin: 0 0 4px; color: var(--verde-texto-acessivel); font-size: 11px; font-weight: 600; letter-spacing: .18em; }
.topbar__title { margin: 0; font-family: var(--fonte-titulo); font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.topbar__actions { display: flex; gap: 10px; margin-left: auto; }
.view { animation: aIn .45s var(--ease) both; }
@keyframes aIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card { border: 1px solid var(--ad-line); border-radius: var(--ad-radius); background: var(--ad-card); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--ad-line); }
.card__head h2, .card__head h3 { margin: 0; font-family: var(--fonte-titulo); font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.card__body { padding: 20px; }

/* ---------- visão geral ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; display: grid; gap: 6px; padding: 18px 20px; border: 1px solid var(--ad-line); border-radius: var(--ad-radius); background: #fff; }
.kpi__label { display: flex; align-items: center; gap: 8px; color: var(--ad-muted); font-size: 12.5px; font-weight: 500; }
.kpi__label svg { width: 16px; height: 16px; color: var(--verde-folha); }
.kpi__value { font-family: var(--fonte-titulo); font-size: 30px; font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.kpi__sub { color: var(--ad-muted); font-size: 12px; }
.kpi--dark { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.kpi--dark .kpi__label, .kpi--dark .kpi__sub { color: #A7AEA2; }
.kpi--dark .kpi__label svg { color: var(--verde-lima); }
.kpi--dark::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 160px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(178,203,62,.28), transparent 65%); }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.todo { display: grid; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--ad-line); text-decoration: none; transition: background .2s; }
.todo a:last-child { border-bottom: 0; }
.todo a:hover { background: var(--ad-soft); }
.todo__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ad-warn-bg); color: var(--ad-warn); }
.todo__icon--ok { background: var(--ad-ok-bg); color: var(--ad-ok); }
.todo strong { display: block; font-size: 13.5px; }
.todo small { color: var(--ad-muted); }
.todo__go { margin-left: auto; color: var(--ad-muted); }
.feed { display: grid; margin: 0; padding: 0; list-style: none; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--ad-line); }
.feed li:last-child { border-bottom: 0; }
.feed__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--verde-medio); }
.feed__dot--bad { background: var(--ad-bad); }
.feed p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed small { color: var(--ad-muted); white-space: nowrap; }
.next { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 20px 22px; border-radius: var(--ad-radius); background: var(--tinta); color: #fff; }
.next p { margin: 2px 0 0; color: #A7AEA2; }
.next__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(178,203,62,.14); color: var(--verde-lima); flex: 0 0 auto; }

/* ---------- produtos ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 260px; }
.toolbar .select { width: auto; min-width: 170px; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { padding: 12px 14px; border-bottom: 1px solid var(--ad-line); color: var(--ad-muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.ptable td { padding: 12px 14px; border-bottom: 1px solid var(--ad-line); vertical-align: middle; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable tbody tr { transition: background .2s; }
.ptable tbody tr:hover { background: var(--ad-soft); }
.ptable tbody tr.is-hidden .prod__name strong { color: var(--ad-muted); }
.prod { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prod__thumb { display: grid; place-items: center; width: 48px; height: 58px; overflow: hidden; border-radius: 10px; background: var(--areia); color: #A3A99D; flex: 0 0 auto; }
.prod__thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod__name { min-width: 0; }
.prod__name strong { display: block; overflow: hidden; max-width: 340px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.prod__name strong:hover { text-decoration: underline; text-underline-offset: 3px; }
.prod__name small { color: var(--ad-muted); font-size: 12px; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.money del { margin-left: 6px; color: var(--ad-muted); font-weight: 400; font-size: 12px; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 56px 24px; text-align: center; color: var(--ad-muted); }
.empty strong { color: var(--tinta); font-family: var(--fonte-titulo); font-size: 18px; }
.table-wrap { overflow-x: auto; }

/* ---------- editor (drawer) ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(18,20,18,.42); backdrop-filter: blur(2px); animation: aFade .3s both; }
@keyframes aFade { from { opacity: 0; } }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(880px, 100%); background: var(--ad-bg); box-shadow: -24px 0 60px -20px rgba(0,0,0,.35); animation: aSlide .45s var(--ease) both; }
@keyframes aSlide { from { transform: translateX(40px); opacity: 0; } }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 28px 18px; border-bottom: 1px solid var(--ad-line); background: #fff; }
.drawer__head h2 { margin: 0; font-family: var(--fonte-titulo); font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.drawer__body { flex: 1; overflow-y: auto; padding: 22px 28px 28px; display: grid; gap: 16px; align-content: start; }
.drawer__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; border-top: 1px solid var(--ad-line); background: #fff; }
.drawer__foot-actions { display: flex; gap: 10px; }
.ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.ed-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.slug-preview { color: var(--ad-muted); font-size: 12px; overflow-wrap: anywhere; }
.slug-preview b { color: var(--tinta); font-weight: 600; }
.calc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.calc div { padding: 12px 14px; border-radius: 12px; background: var(--ad-soft); }
.calc small { display: block; color: var(--ad-muted); font-size: 11.5px; }
.calc strong { font-family: var(--fonte-titulo); font-size: 18px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.calc .is-ok strong { color: var(--ad-ok); }
.calc .is-bad strong { color: var(--ad-bad); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 42px; padding: 6px; border: 1px solid #D9DDD2; border-radius: 10px; background: #fff; cursor: text; }
.chips:focus-within { border-color: var(--verde-folha); box-shadow: 0 0 0 3px rgba(178,203,62,.28); }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 8px; background: var(--areia); font-size: 13px; font-weight: 500; }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: var(--ad-muted); }
.chip button:hover { background: rgba(0,0,0,.06); color: var(--tinta); }
.chip svg { width: 13px; height: 13px; }
.chips input { flex: 1; min-width: 120px; border: 0; outline: 0; padding: 0 6px; background: transparent; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 12px; background: var(--areia); cursor: grab; transition: transform .25s var(--ease), box-shadow .25s; }
.photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo.is-dragging { opacity: .4; }
.photo.is-over { box-shadow: 0 0 0 2px var(--verde-folha); transform: scale(.97); }
.photo__badge { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: var(--tinta); color: #fff; font-size: 11px; font-weight: 600; }
.photo__del { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: rgba(255,255,255,.94); color: var(--ad-bad); cursor: pointer; opacity: 0; transition: opacity .2s; }
.photo:hover .photo__del, .photo:focus-within .photo__del { opacity: 1; }
.photo__del svg { width: 15px; height: 15px; }
.photo--uploading { display: grid; place-items: center; cursor: default; }
.photo--uploading::after { content: ""; width: 26px; height: 26px; border: 2px solid #C9CEC1; border-top-color: var(--verde-folha); border-radius: 50%; animation: aSpin .8s linear infinite; }
@keyframes aSpin { to { transform: rotate(360deg); } }
.dropzone { display: grid; place-items: center; gap: 4px; aspect-ratio: 4 / 5; padding: 10px; border: 1.5px dashed #C3C9BA; border-radius: 12px; background: #fff; color: var(--ad-muted); text-align: center; font-size: 12px; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--verde-folha); background: var(--ad-ok-bg); color: var(--ad-ok); }
.dropzone svg { width: 22px; height: 22px; }
.dropzone strong { color: var(--tinta); font-size: 12.5px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--ad-warn-bg); color: #6F4B0E; font-size: 13px; }
.notice svg { color: var(--ad-warn); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.danger-zone p { margin: 2px 0 0; color: var(--ad-muted); font-size: 13px; }
.confirm-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.confirm-row .input { flex: 1 1 220px; }

/* ---------- categorias / clientes / atividade ---------- */
.cat-list { display: grid; }
.cat-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px auto auto; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--ad-line); }
.cat-row:last-child { border-bottom: 0; }
.cat-row__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--areia); color: var(--verde-folha); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.cat-add { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--ad-line); background: var(--ad-soft); border-radius: 0 0 var(--ad-radius) var(--ad-radius); }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 12px; background: var(--tinta); color: #fff; font-weight: 500; box-shadow: 0 16px 40px -14px rgba(0,0,0,.5); animation: aToast .45s var(--ease) both; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--verde-lima); flex: 0 0 auto; }
.toast--bad::before { background: #F08A73; }
@keyframes aToast { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- responsivo ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .col-hide-lg { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; z-index: 30; left: 0; width: 272px; transform: translateX(-100%); transition: transform .4s var(--ease); }
  .side.is-open { transform: none; }
  .side-scrim.is-open { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(18,20,18,.45); }
  .topbar__menu { display: inline-grid; margin-bottom: 2px; }
  .col-hide-md { display: none; }
  .ed-grid--3, .calc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .main { padding-top: 16px; }
  .topbar { flex-wrap: wrap; align-items: center; }
  .topbar__actions { width: 100%; margin-left: 0; }
  .topbar__actions .a-btn { flex: 1; }
  .toolbar .select { flex: 1 1 140px; min-width: 0; }
  .kpi__value { font-size: 24px; }
  .ptable thead { display: none; }
  .ptable, .ptable tbody, .ptable tr, .ptable td { display: block; }
  .ptable tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--ad-line); }
  .ptable td { padding: 0; border: 0; }
  .ptable td.col-hide-md, .ptable td.col-hide-lg { display: none; }
  .ptable td.col-price { margin: 6px 0 0 60px; }
  .ptable td.col-status { margin: 8px 0 0 60px; }
  .ptable td.col-actions { position: absolute; right: 8px; bottom: 8px; }
  .prod__name strong { max-width: 52vw; }
  .ed-grid, .ed-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .drawer__head, .drawer__body, .drawer__foot { padding-inline: 16px; }
  .drawer__foot { flex-wrap: wrap; }
  .drawer__foot-actions { width: 100%; }
  .drawer__foot-actions .a-btn { flex: 1; }
  .cat-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .cat-row .select, .cat-row__count { display: none; }
  .cat-add { grid-template-columns: minmax(0, 1fr); }
  .toasts { left: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- assistente de IA ---------- */
.ai-status { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; padding: 16px 20px; border: 1px solid #D6E5C4; border-radius: var(--ad-radius); background: var(--ad-ok-bg); }
.ai-status p { margin: 3px 0 0; color: #45603A; font-size: 13px; }
.ai-status__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--tinta); color: var(--verde-lima); flex: 0 0 auto; }
.ai-status--warn { border-color: #EEDDB8; background: var(--ad-warn-bg); }
.ai-status--warn p { color: #7A5A1E; }
.ai-status--warn .ai-status__icon { background: #fff; color: var(--ad-warn); }
.ai-status code, .ai-settings code { padding: 1px 6px; border-radius: 6px; background: rgba(20,22,20,.07); font-size: 12px; }
.ai-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); align-items: end; gap: 6px; height: 210px; padding: 18px 20px 14px; }
.ai-bars__col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; height: 100%; }
.ai-bars__col i { align-self: end; width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--verde-lima), var(--verde-folha)); transition: height .6s var(--ease); }
.ai-bars__col:last-child i { background: var(--tinta); }
.ai-bars__n { min-height: 14px; color: var(--ad-muted); font-size: 11px; font-weight: 600; }
.ai-bars__col small { color: var(--ad-muted); font-size: 10.5px; }
.ai-test { display: flex; gap: 8px; padding: 16px 20px 0; }
.ai-test .input { flex: 1; }
.ai-test__out { display: grid; gap: 10px; padding: 14px 20px 20px; }
.ai-bubble { padding: 12px 14px; border: 1px solid var(--ad-line); border-radius: 14px 14px 14px 4px; background: var(--ad-soft); font-size: 13.5px; line-height: 1.55; }
.ai-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ai-picks a { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--ad-line); border-radius: 12px; text-decoration: none; transition: border-color .2s; }
.ai-picks a:hover { border-color: var(--verde-medio); }
.ai-picks img, .ai-picks span { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; object-fit: cover; background: var(--ad-soft); }
.ai-picks b { overflow: hidden; font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.ai-picks small { color: var(--ad-muted); font-size: 12px; }
.ai-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.ai-rank { margin: 0; padding: 6px 0; list-style: none; counter-reset: r; }
.ai-rank li { display: flex; align-items: center; gap: 10px; padding: 9px 20px; counter-increment: r; font-size: 13.5px; }
.ai-rank li::before { content: counter(r); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--ad-soft); color: var(--ad-muted); font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.ai-rank li > span, .ai-rank li > a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-rank li > a { color: var(--tinta); text-decoration: none; }
.ai-rank li > a:hover { text-decoration: underline; }
.ai-rank b { font-variant-numeric: tabular-nums; }
.ai-rank em { color: var(--ad-muted); font-style: normal; font-weight: 500; }
.empty--sm { padding: 28px 20px; font-size: 13px; }
.ai-settings { margin-top: 18px; }
.ai-short { min-height: 76px; }
.ai-sugs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ai-settings__foot { display: flex; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--ad-line); }
@media (max-width: 1180px) { .ai-grid3 { grid-template-columns: minmax(0, 1fr); } .ai-sugs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .ai-bars { gap: 3px; padding-inline: 12px; height: 170px; }
  .ai-bars__n { display: none; }
  .ai-test { flex-direction: column; }
  .ai-sugs { grid-template-columns: minmax(0, 1fr); }
  .ai-settings .card__head { flex-wrap: wrap; }
  .ai-settings__foot .a-btn { flex: 1; }
}
.ai-status--bad { border-color: #EBCBC3; background: var(--ad-bad-bg); }
.ai-status--bad p { color: #8A2F19; overflow-wrap: anywhere; }
.ai-status--bad .ai-status__icon { background: #fff; color: var(--ad-bad); }
