/* =============================================================================
   Honey Boo — Backoffice
   Cores da marca: mel (#FECC00), caramelo (#C99E67), tinta (#2B2420), creme (#FFFBF4)
   ============================================================================= */
:root {
  --ink: #2B2420;
  --ink-2: #4A4038;
  --muted: #7A6F66;
  --line: #EDE3D4;
  --line-2: #E2D3BD;
  --bg: #FBF7F0;
  --surface: #FFFFFF;
  --soft: #FBF3E6;
  --honey: #FECC00;
  --honey-soft: #FFF6CC;
  --caramel: #C99E67;
  --caramel-ink: #8A6538;
  --ok: #1E7A4C; --ok-bg: #E4F4EA;
  --info: #24618F; --info-bg: #E5F0F8;
  --warn: #9A5B00; --warn-bg: #FFF1D6;
  --danger: #B3261E; --danger-bg: #FDE8E6;
  --accent: #7A4FB0; --accent-bg: #F0E9FA;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(43, 36, 32, .05), 0 4px 16px rgba(43, 36, 32, .05);
  --shadow-lg: 0 20px 50px rgba(43, 36, 32, .18);
  --side: 252px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 750; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
p { margin: 0 0 .5em; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.strike { text-decoration: line-through; }
.pre { white-space: pre-wrap; }
.upper { text-transform: uppercase; }
.right { text-align: right; }
.narrow { max-width: 760px; }
.w-80 { width: 80px !important; }

/* --- Ícones ------------------------------------------------------------------ */
.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; }
.ico-xl { width: 44px; height: 44px; color: var(--caramel); }

/* --- Estrutura ---------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; text-decoration: none; }
.brand img { height: 46px; width: auto; }
.brand span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--caramel-ink); background: var(--honey-soft); padding: 3px 8px; border-radius: 999px; }
.side-nav { padding: 4px 12px 16px; flex: 1; }
.side-group { margin: 16px 10px 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-weight: 550; }
.side-link:hover { background: var(--soft); color: var(--ink); }
.side-link.is-active { background: var(--honey-soft); color: var(--ink); font-weight: 700; }
.side-link.is-active .ico { color: var(--caramel-ink); }
.side-link .pill { margin-left: auto; }
.side-store { display: flex; align-items: center; gap: 10px; margin: 0 12px 16px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.side-store:hover { border-color: var(--caramel); }
.side-store .ico-sm { margin-left: auto; color: var(--muted); }
.main { flex: 1; margin-left: var(--side); min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(251, 247, 240, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-menu { display: none; }
.top-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; text-align: left; }
.top-search:hover { border-color: var(--caramel); }
.top-search span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 600 .72rem var(--font); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--muted); background: var(--bg); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.page { padding: 26px 28px 60px; max-width: 1500px; width: 100%; }
.scrim { position: fixed; inset: 0; background: rgba(43, 36, 32, .4); z-index: 35; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; font-weight: 600; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--honey); font-weight: 800; }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px; z-index: 50; }
.user-pop p { padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.user-pop a, .user-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; font: inherit; text-decoration: none; border-radius: 10px; cursor: pointer; color: var(--ink); }
.user-pop a:hover, .user-pop button:hover { background: var(--soft); }

/* --- Cabeçalho das páginas ------------------------------------------------------ */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head-actions form { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.back:hover { color: var(--ink); }

/* --- Botões ------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 18px; border-radius: 999px; border: 1px solid transparent; font: 650 .93rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; color: var(--ink); background: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--honey); border-color: var(--honey); }
.btn-primary:hover { background: #F4C100; }
.btn-ghost { background: var(--surface); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--caramel); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: none; border-color: #F2C8C4; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .pill { margin-left: 2px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.link { color: var(--caramel-ink); font-weight: 650; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* --- Etiquetas ------------------------------------------------------------------ */
.pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--honey); color: var(--ink); font-size: .74rem; font-weight: 800; }
.pill-soft { background: var(--soft); color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-accent { background: var(--accent-bg); color: var(--accent); }
.badge-muted { background: #F1ECE5; color: var(--muted); }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }

/* --- Cartões e grelhas ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-pad { padding: 16px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .card-title { margin: 0; }
.card-title { font-size: 1.05rem; font-weight: 750; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-title .ico { color: var(--caramel-ink); }
.sub-title { font-size: .92rem; margin: 16px 0 6px; }
.table-card { padding: 0; overflow: hidden; }
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.sticky { position: sticky; top: 86px; }
.empty { text-align: center; padding: 40px 20px; display: grid; justify-items: center; gap: 10px; }
.empty.small { padding: 24px 10px; }

/* --- Indicadores -------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-label { font-size: .8rem; font-weight: 650; color: var(--muted); margin: 0 0 6px; }
.kpi-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.kpi-foot { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
.trend { font-weight: 750; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--danger); }

.chart { width: 100%; height: auto; display: block; margin: 6px 0 10px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label { font-size: 11px; fill: var(--muted); }
.bar-site { fill: var(--honey); }
.bar-loja { fill: var(--caramel); }
.bar-zero { fill: var(--line); }
.chart-bar:hover rect { opacity: .8; }
.legend { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); margin: 0; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.dot-site { background: var(--honey); }
.dot-loja { background: var(--caramel); }

.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.insight { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; border-left: 4px solid var(--info); background: var(--info-bg); }
.insight-warn { border-color: #E3A21A; background: var(--warn-bg); }
.insight-danger { border-color: var(--danger); background: var(--danger-bg); }
.insight-title { font-weight: 750; margin: 0 0 2px; }
.insight-text { font-size: .86rem; color: var(--ink-2); margin: 0; }
.insight .btn { flex: none; }

.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; text-decoration: none; }
.list-row:hover { color: var(--caramel-ink); }
.ranked { counter-reset: r; }
.ranked li { counter-increment: r; display: flex; align-items: center; gap: 10px; }
.ranked li::before { content: counter(r); width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: .78rem; font-weight: 800; }
.ranked .list-row { flex: 1; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hbars li { display: grid; grid-template-columns: 64px 1fr 34px; align-items: center; gap: 8px; font-size: .82rem; }
.hbars i { height: 10px; border-radius: 6px; background: var(--honey); }
.hbars b { text-align: right; }

/* --- Separadores e filtros --------------------------------------------------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: thin; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 650; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-color: var(--honey); }
.tabs-inline { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { height: 42px; }
.search-field { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--muted); }
.search-field input { border: 0 !important; outline: 0; background: none; flex: 1; min-width: 0; height: 38px !important; padding: 0 !important; box-shadow: none !important; }
.search-field:focus-within { border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(254, 204, 0, .3); }
.date-field { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 16px 0; }

/* --- Tabelas ---------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: #FDFAF5; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a { text-decoration: none; }
.table-click tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #FFFCF6; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.is-muted td { opacity: .58; }
.w-check { width: 40px; }
.w-actions { width: 1%; white-space: nowrap; text-align: right; }
.w-actions form { display: inline; }
.w-stock { width: 150px; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-cell .badge { margin-top: 4px; }

/* miniaturas */
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--soft); border: 1px solid var(--line); flex: none; }
.thumb-md { width: 64px; height: 64px; }
.thumb-lg { width: 160px; height: 120px; object-fit: contain; background: #fff; }
.thumb-empty { display: grid; place-items: center; color: var(--line-2); }

.inline-edit { cursor: pointer; border-bottom: 1px dashed var(--line-2); padding: 0 2px; }
.inline-edit:hover { border-color: var(--caramel); background: var(--honey-soft); }
.inline-input { width: 90px; height: 32px !important; text-align: right; }
.stock-chip { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); font-weight: 750; text-decoration: none; }
.stock-chip.low { background: var(--warn-bg); color: var(--warn); }
.stock-chip.out { background: var(--danger-bg); color: var(--danger); }

.bulkbar { position: sticky; top: 72px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 10px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); }
.bulkbar .btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.bulkbar select { height: 34px; background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); }
.bulkbar select option { color: var(--ink); }

/* interruptor */
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; border: 0; background: #DCD3C7; cursor: pointer; flex: none; transition: background .2s; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.is-on { background: #2FA36B; }
.switch.is-on span { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.state-box { display: grid; gap: 2px; padding: 12px 20px; }
.state-box p { margin: 6px 0 0; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: #fff; }
.stepper button { width: 34px; height: 34px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.stepper button:hover { background: var(--soft); }
.stepper input { width: 56px; height: 34px !important; border: 0 !important; text-align: center; font-weight: 750; padding: 0 !important; box-shadow: none !important; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.low input { color: var(--warn); }
.stepper.out input { color: var(--danger); }
.stepper.is-saving { opacity: .6; }
.stepper.is-saved { border-color: #2FA36B; }

/* --- Formulários ------------------------------------------------------------ */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-weight: 650; font-size: .88rem; }
.field small { font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input:not([type]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; }
select { cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(254, 204, 0, .3); }
.filters select, .filters input[type=date] { width: auto; }
input[type=color] { width: 52px; height: 42px; padding: 3px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; }
input[type=file] { font: inherit; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--caramel-ink); flex: none; }
.check-card { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.inline-form { display: flex; gap: 8px; margin-top: 14px; }
.inline-form input { flex: 1; }
.inline-form.wrap { flex-wrap: wrap; margin: 0 0 14px; }
.inline-form.wrap input:not([type=color]):not(.w-80) { flex: 1 1 160px; }
.hint { font-size: .86rem; color: var(--ink-2); background: var(--soft); border-radius: 10px; padding: 8px 12px; margin: 0; }
.hint:empty { display: none; }
.hint-warn { background: var(--warn-bg); color: var(--warn); }
.counter { font-size: .76rem; color: var(--muted); text-align: right; margin-top: -2px; }
.counter.over { color: var(--danger); font-weight: 700; }
.stock-total { margin: 8px 0 0; }
.hidden-form { display: none; }

.cat-picker { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.cat-picker input[type=search] { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.cat-list { max-height: 260px; overflow-y: auto; padding: 6px 4px; }
.cat-item { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px calc(10px + var(--d, 0) * 20px); border-radius: 8px; cursor: pointer; font-size: .9rem; }
.cat-item:hover { background: var(--soft); }
.cat-item input { accent-color: var(--caramel-ink); }
.cat-item:has(input:checked) { font-weight: 700; background: var(--honey-soft); }

.chip-picker { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto; padding: 2px; }
.chip-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-size: .86rem; background: #fff; }
.chip-opt input:checked + span { background: var(--honey-soft); border-color: var(--honey); font-weight: 700; }
.chip-opt input:focus-visible + span { outline: 3px solid var(--honey); }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--soft); text-decoration: none; font-size: .85rem; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.variant-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #FFFDF9; }
.variant-cell span { font-size: .86rem; font-weight: 600; }
.variant-cell input { width: 72px; min-height: 34px; text-align: center; }
.variant-empty { grid-column: 1 / -1; color: var(--muted); font-size: .88rem; }

/* editor de texto */
.rte { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #fff; }
.rte:focus-within { border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(254, 204, 0, .3); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #FDFAF5; }
.rte-bar button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; cursor: pointer; font: 600 .82rem var(--font); color: var(--ink-2); }
.rte-bar button:hover { background: var(--soft); }
.rte-area { min-height: 160px; max-height: 520px; overflow-y: auto; padding: 12px 14px; outline: none; }
.rte-area h3 { font-size: 1.05rem; margin: .8em 0 .3em; }
.rte-area table { border-collapse: collapse; }
.rte-area td, .rte-area th { border: 1px solid var(--line); padding: 4px 8px; }

/* pré-visualização Google */
.serp { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; font-family: Arial, sans-serif; margin-bottom: 4px; }
.serp-url { color: #202124; font-size: .82rem; margin: 0 0 2px; }
.serp-title { color: #1A0DAB; font-size: 1.15rem; margin: 0 0 4px; line-height: 1.3; }
.serp-desc { color: #4D5156; font-size: .88rem; margin: 0; }

/* qualidade */
.score { --v: 0; width: 120px; height: 120px; margin: 4px auto 14px; border-radius: 50%; display: grid; place-items: center; align-content: center;
  background: radial-gradient(closest-side, #fff 76%, transparent 77% 100%), conic-gradient(var(--honey) calc(var(--v) * 1%), var(--soft) 0); }
.score span { font-size: 2rem; font-weight: 850; line-height: 1; }
.score small { color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .88rem; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; }
.checklist .ok { color: var(--muted); }
.checklist .ok .ico { color: var(--ok); }
.checklist .no .ico { color: #D4900A; }
.stat-line { display: flex; justify-content: space-between; margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }

/* fotografias */
.photos { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.photo { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; aspect-ratio: 1; cursor: grab; }
.photo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.photo.is-dragging { opacity: .4; }
.photo.is-over { outline: 3px dashed var(--honey); }
.photo-cover { display: none; position: absolute; left: 8px; top: 8px; background: var(--honey); font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.photo:first-child .photo-cover { display: block; }
.photo-del { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; color: var(--danger); }
.photo:hover .photo-del, .photo-del:focus-visible { opacity: 1; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 16px; padding: 26px; text-align: center; display: grid; justify-items: center; gap: 6px; background: #FFFDF9; transition: border-color .15s, background .15s; }
.dropzone.is-over { border-color: var(--honey); background: var(--honey-soft); }
.dropzone.is-busy { opacity: .6; pointer-events: none; }

/* encomenda */
.lines { list-style: none; margin: 0 0 12px; padding: 0; }
.line { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line-info { display: grid; min-width: 0; }
.line-info a { text-decoration: none; }
.line-qty { color: var(--muted); white-space: nowrap; }
.line-total { white-space: nowrap; }
.totals { margin: 0; display: grid; gap: 6px; max-width: 340px; margin-left: auto; }
.totals div { display: flex; justify-content: space-between; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 650; }
.totals-main { border-top: 1px solid var(--line); padding-top: 8px; font-size: 1.15rem; }
.totals-main dt { color: var(--ink); font-weight: 750; }
.totals-main dd { font-weight: 850; }
.note-card { background: var(--honey-soft); border-color: #F5E39A; }
.contact-lines { display: grid; gap: 6px; }
.contact-lines a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--caramel-ink); font-weight: 600; word-break: break-all; }
address { font-style: normal; line-height: 1.55; }
.tracking { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 650; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; position: relative; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 16px; bottom: -14px; width: 2px; background: var(--line); }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--honey); border: 3px solid var(--honey-soft); margin-top: 4px; }
.timeline p { margin: 0; }

/* árvore de categorias */
.tree { list-style: none; margin: 0; padding: 0; }
.tree-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 16px 8px calc(16px + var(--d, 0) * 24px); border-top: 1px solid var(--line); }
.tree-row:hover, .tree-row.is-active { background: #FFFCF6; }
.tree-branch { color: var(--line-2); margin-right: 6px; }
.tree-actions { display: flex; gap: 2px; }
.tree-actions form { margin: 0; }

/* marcas, artigos, banners, atributos */
.brand-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.brand-card { padding: 14px; display: grid; gap: 4px; }
.brand-card.is-active { border-color: var(--honey); }
.brand-card p { margin: 0; }
.brand-logo { height: 80px; display: grid; place-items: center; background: #fff; border-radius: 10px; margin-bottom: 6px; }
.brand-img { max-height: 70px; max-width: 90%; object-fit: contain; }
.brand-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.brand-actions form { margin: 0; }
.article-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.article-card { padding: 0; overflow: hidden; }
.article-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--soft); }
.article-img.thumb-empty { display: grid; height: auto; }
.article-title { font-size: 1.05rem; margin: 4px 0 6px; }
.article-title a { text-decoration: none; }
.banner-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.banner-item { display: grid; grid-template-columns: 28px 180px 1fr auto auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: grab; }
.banner-item.is-muted { opacity: .65; cursor: default; grid-template-columns: 180px 1fr auto auto; }
.banner-item form { margin: 0; }
.banner-pos { font-weight: 800; color: var(--muted); text-align: center; }
.banner-thumb { width: 180px; height: 66px; object-fit: cover; border-radius: 10px; background: var(--soft); display: block; }
.banner-thumb.is-mobile { width: 66px; height: 80px; justify-self: center; }
.banner-preview { width: 100%; border-radius: 12px; }
.attr-list { list-style: none; margin: 0; padding: 0; }
.attr-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.attr-list li span { flex: 1; font-weight: 600; }
.attr-list form { margin: 0; }
.size-tag { flex: 1; }

/* --- Alertas ---------------------------------------------------------------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 550; }
.alert .ico { margin-top: 1px; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--info); }
.copyable { cursor: copy; font-size: 1rem; }

/* --- Diálogos, toasts e pesquisa global ------------------------------------- */
.dialog { border: 0; border-radius: 20px; padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
.dialog::backdrop { background: rgba(43, 36, 32, .45); }
.dialog h2 { margin-bottom: 8px; }
.dialog form { display: grid; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; max-width: 380px; animation: toastIn .2s ease-out; }
.toast.is-error { background: var(--danger); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }
.palette { position: fixed; inset: 0; z-index: 90; background: rgba(43, 36, 32, .45); display: grid; justify-items: center; align-items: start; padding: 10vh 16px 16px; }
.palette-card { width: min(640px, 100%); background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { border: 0 !important; box-shadow: none !important; height: 58px; font-size: 1.05rem; padding: 0; }
.palette-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.palette-hint { padding: 14px; color: var(--muted); margin: 0; font-size: .88rem; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; }
.palette-item.is-active, .palette-item:hover { background: var(--honey-soft); }
.palette-item img, .palette-item .pi-ico { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--soft); flex: none; display: grid; place-items: center; }
.palette-item .pi-type { margin-left: auto; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.palette-item b { display: block; }
.palette-item small { color: var(--muted); }

/* --- Entrar ------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #FFF3BF, transparent 40%), radial-gradient(circle at 90% 90%, #F3E2C9, transparent 45%), var(--bg); }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); padding: 34px 30px; display: grid; gap: 14px; }
.auth-logo { height: 70px; width: auto; justify-self: center; }
.auth-card h1 { justify-content: center; font-size: 1.4rem; }
.auth-card > .muted { text-align: center; margin-top: -8px; }

/* --- Responsivo -------------------------------------------------------------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .grid-main, .grid-2 { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 900px) {
  .side { transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .side.is-open { transform: none; }
  .main { margin-left: 0; }
  .top { padding: 10px 16px; }
  .top-menu { display: inline-grid; }
  .top-search kbd { display: none; }
  .page { padding: 18px 16px 50px; }
  .hide-md { display: none; }
  .grid-3 { grid-template-columns: 1fr; }
  .row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .kpis, .kpis-3 { grid-template-columns: 1fr 1fr; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  h1 { font-size: 1.35rem; }
  .table th, .table td { padding: 10px 12px; }
  .line { grid-template-columns: 52px 1fr; }
  .line-qty, .line-total { grid-column: 2; }
  .banner-item { grid-template-columns: 24px 1fr auto; }
  .banner-item > div { grid-column: 2 / 4; }
  .banner-thumb { width: 100%; }
  .insight { flex-direction: column; align-items: stretch; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
