/* =========================================================
   Revo — Design System (protótipo HTML)
   Inspirado no tema Vicodin (medical/pharma e-commerce)
   Paleta: verde "giro", navy no painel, azul informativo
   ========================================================= */

:root {
  --primary:       #0e9f6e;
  --primary-dark:  #057a55;
  --primary-soft:  #def7ec;
  --navy:          #0f1b2d;
  --navy-2:        #16263d;
  --navy-line:     #23374f;
  --info:          #2d6cdf;
  --info-soft:     #e1ebfd;
  --warning:       #f59e0b;
  --warning-soft:  #fef3c7;
  --danger:        #e02424;
  --danger-soft:   #fde8e8;
  --success:       #0e9f6e;
  --purple:        #7e3af2;
  --purple-soft:   #edebfe;

  --bg:            #f4f6fb;
  --surface:       #ffffff;
  --text:          #1f2a37;
  --text-muted:    #6b7280;
  --text-faint:    #9aa4b2;
  --line:          #e5e9f0;
  --line-strong:   #d3d9e3;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     18px;
  --shadow-sm:     0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --shadow:        0 4px 14px rgba(16,24,40,.08);
  --shadow-lg:     0 12px 34px rgba(16,24,40,.14);
  --sidebar-w:     256px;
  --font:          'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
/* default icon size for inline SVGs (specific rules below override) */
svg { width: 18px; height: 18px; flex: none; vertical-align: -.15em; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .6rem; }
small { font-size: 12px; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Utilities ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.tiny { font-size: 12px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.money { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid transparent; background: var(--primary); color: #fff;
  padding: .6rem 1.05rem; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 14px; transition: .15s; line-height: 1.1; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-ghost:focus-visible { outline-color: var(--navy); }
.btn svg { width: 17px; height: 17px; }
.btn-lg { padding: .8rem 1.4rem; font-size: 15px; }
.btn-sm { padding: .4rem .75rem; font-size: 13px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: #f3f5f9; border-color: var(--line-strong); }
.btn-outline { background: #fff; color: var(--primary-dark); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-info { background: var(--info); } .btn-info:hover { background: #1e56c0; }
.btn-danger { background: var(--danger); } .btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #422006; } .btn-warning:hover{ background:#d97706;}
.btn-dark { background: var(--navy); } .btn-dark:hover { background: var(--navy-2); }
.btn-icon { padding: .5rem; width: 38px; height: 38px; }
.btn:disabled, .btn[disabled] {
  opacity: .42;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(.2);
  box-shadow: none;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #eef1f6; color: var(--text-muted);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-green  { background: var(--primary-soft); color: var(--primary-dark); }
.badge-blue   { background: var(--info-soft); color: var(--info); }
.badge-amber  { background: var(--warning-soft); color: #b45309; }
.badge-red    { background: var(--danger-soft); color: var(--danger); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-gray   { background: #eceff4; color: #4b5563; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: visible;
}
.card-pad { padding: 1.25rem 1.4rem; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.4rem; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 15.5px; display: flex; align-items: center; gap: .5rem; }
.card-head h3 svg { width: 18px; height: 18px; flex: none; }
.card-body { padding: 1.25rem 1.4rem; }
.produto-form-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 1.5rem; align-items: start; }
.card-atributos-tipo { border-color: var(--info); }
.card-atributos-tipo .card-head { background: var(--info-soft); }
.card-atributos-tipo .card-head h3 { color: var(--info); }
.produto-dropzone {
  display: block; position: relative; border: 2px dashed var(--line-strong); border-radius: 12px;
  padding: 1.5rem; text-align: center; color: var(--text-faint); cursor: pointer;
  background: #fafbfd; transition: .15s;
}
.produto-dropzone:hover, .produto-dropzone.is-drag, .produto-dropzone:focus-within {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark);
}
.produto-dropzone:focus-within { box-shadow: 0 0 0 3px var(--primary-soft); }
.produto-dropzone svg { width: 28px; height: 28px; margin: 0 auto; display: block; }
.produto-dropzone input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; opacity: 0;
}
.produto-thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.produto-thumb {
  position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; background: #eef1f6; flex: none;
}
.produto-thumb.is-capa { border-color: var(--primary); }
.produto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.produto-thumb .produto-thumb-badge {
  position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  font-size: 9px; line-height: 1; white-space: nowrap;
}
.produto-thumb-actions { position: absolute; top: 2px; right: 2px; display: flex; gap: 2px; }
.produto-thumb-actions button {
  width: 18px; height: 18px; border: 0; border-radius: 4px; background: rgba(15,27,45,.72);
  color: #fff; font-size: 11px; line-height: 18px; cursor: pointer; padding: 0;
}
.produto-thumb-actions button:hover { background: var(--danger); }
.produto-thumb-actions button:focus-visible {
  outline: 2px solid #fff; outline-offset: 1px; box-shadow: 0 0 0 2px var(--primary);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; min-width: 0; overflow: visible; }
.card-body > .grid-2 > .field,
.card-body > .grid-3 > .field,
.card-body > .grid-4 > .field { margin-bottom: 0; }
.label { display: block; font-weight: 600; font-size: 13px; margin-bottom: .35rem; color: #374151; }
.label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  background: #fff; color: var(--text); transition: .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.input[readonly] { background: #f3f5f8; color: var(--text-muted); cursor: default; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
  border-color: var(--danger);
}
.input.is-invalid:focus, .select.is-invalid:focus, .textarea.is-invalid:focus {
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.textarea { resize: vertical; min-height: 84px; }
.hint { font-size: 12px; color: var(--text-faint); margin-top: .3rem; }
.field-error { font-size: 12px; color: var(--danger); margin-top: .3rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.lote-linha { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1rem .25rem; margin-bottom: 1rem; background: #fbfcfe; }
.lote-linha:last-child { margin-bottom: 0; }
.lote-linha-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.lote-linha-titulo { font-size: 14px; font-weight: 700; margin: 0; }
.lote-linha.is-unica .js-remover-linha { display: none; }
.lote-linha .input[readonly] { background: #f3f5f8; color: var(--text-muted); cursor: default; }
.lote-massa-linhas { margin-bottom: 1rem; }
.lote-massa-acoes { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.lote-entrada-submit { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; max-width: 22rem; }
.lote-entrada-submit > span { display: flex; justify-content: flex-end; }
.lote-entrada-submit .hint { text-align: right; }
.lote-produto-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-start; }
.lote-produto-row .select-busca { flex: 1 1 220px; min-width: 0; }
.lote-produto-prova {
  flex: 1 1 160px; margin: .45rem 0 0; font-size: 12px; line-height: 1.4;
  color: var(--text-muted); min-height: 1.4em;
}
@media (min-width: 721px) {
  .lote-linha .grid-4 > .field:has(.lote-produto-row) { grid-column: span 2; }
}
.lote-massa-rascunho { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.lote-massa-progresso { font-weight: 600; color: var(--info); }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-prefix { display: flex; align-items: stretch; width: 100%; border-radius: var(--radius-sm); }
.input-prefix-addon {
  display: inline-flex; align-items: center; padding: 0 .75rem;
  border: 1px solid var(--line-strong); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: #f8fafc; color: #374151; font-size: 13px; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
.input-prefix .input {
  border-top-left-radius: 0; border-bottom-left-radius: 0;
  min-width: 0; flex: 1 1 auto; width: auto;
}
.input-prefix .input:focus { box-shadow: none; }
.input-prefix:focus-within { box-shadow: 0 0 0 3px var(--primary-soft); }
.input-prefix:focus-within .input-prefix-addon,
.input-prefix:focus-within .input { border-color: var(--primary); }
.input-prefix:has(.input.is-invalid) .input-prefix-addon,
.input-prefix:has(.input.is-invalid) .input { border-color: var(--danger); }
.input-prefix:has(.input.is-invalid):focus-within { box-shadow: 0 0 0 3px var(--danger-soft); }
.input-prefix .input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input-prefix .input[type="number"]::-webkit-outer-spin-button,
.input-prefix .input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.select-busca { position: relative; z-index: 1; min-width: 0; overflow: visible; }
.select-busca.is-open { z-index: 25; }
.select-busca-control {
  display: flex; align-items: center; width: 100%; min-height: 42px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; transition: .15s;
}
.select-busca-control:focus-within {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.select-busca:has(.is-invalid) .select-busca-control { border-color: var(--danger); }
.select-busca:has(.is-invalid) .select-busca-control:focus-within { box-shadow: 0 0 0 3px var(--danger-soft); }
.select-busca.is-disabled .select-busca-control,
.select-busca.is-empty .select-busca-control { background: #f3f5f8; }
.select-busca.is-disabled .select-busca-control { cursor: not-allowed; }
.select-busca.is-disabled .select-busca-input,
.select-busca.is-disabled .select-busca-toggle { cursor: not-allowed; pointer-events: none; color: var(--text-muted); }
.select-busca-ico { width: 16px; height: 16px; margin-left: .7rem; color: var(--text-faint); flex: none; }
.select-busca-input {
  border: 0; box-shadow: none; background: transparent; min-width: 0;
  text-overflow: ellipsis;
}
.select-busca-input:focus { border: 0; box-shadow: none; }
.select-busca-input::placeholder { color: var(--text-faint); }
.select-busca-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: stretch; border: 0; background: transparent; color: var(--text-muted);
  padding: 0 .7rem; cursor: pointer; flex: none; min-width: 40px;
}
.select-busca-toggle svg { width: 16px; height: 16px; transition: transform .15s; }
.select-busca.is-open .select-busca-toggle svg { transform: rotate(180deg); }
.select-busca-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.select-busca-native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.select-busca-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 240px; overflow: auto; overflow-x: hidden; margin: 0; padding: .25rem; list-style: none;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); overscroll-behavior: contain;
}
.select-busca-item, .select-busca-empty {
  padding: .5rem .65rem; border-radius: 6px; font-size: 14px;
  overflow-wrap: anywhere; word-break: break-word;
}
.select-busca-item { cursor: pointer; }
.select-busca-item:hover, .select-busca-item.is-active { background: var(--primary-soft); }
.select-busca-empty { color: var(--text-faint); font-size: 13px; cursor: default; }
.checkbox { display: inline-flex; align-items: center; gap: .5rem; font-size: 14px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; flex: none; accent-color: var(--primary); }
.checkbox input:focus { outline: none; }
.checkbox input:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.checkbox-boolean {
  width: 100%; padding: .6rem .75rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font-weight: 500;
  transition: .15s;
}
.checkbox-boolean:hover {
  border-color: var(--primary);
}
.checkbox-boolean:focus-within {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.checkbox-boolean input:focus-visible { outline: none; }
.checkbox-boolean:has(input.is-invalid) { border-color: var(--danger); }
.checkbox-boolean:has(input.is-invalid):focus-within { box-shadow: 0 0 0 3px var(--danger-soft); }
.checkbox-boolean:not(:has(input:checked)) .checkbox-estado { color: var(--text-muted); }
.checkbox-boolean:has(input:checked) .checkbox-estado { color: var(--text); font-weight: 600; }
.checkbox-estado { user-select: none; }
.fieldset-plain {
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
  min-width: 0;
}
.fieldset-plain > legend {
  display: block;
  padding: 0;
  float: none;
  width: 100%;
}
.fieldset-plain .hint {
  margin-top: 0;
  color: var(--text-muted);
}
.acessos-lista { align-items: stretch; min-width: 0; }
.acessos-lista .checkbox-boolean {
  min-height: 44px;
  min-width: 0;
  box-sizing: border-box;
  color: var(--text);
  opacity: 1;
  text-align: left;
  overflow-wrap: anywhere;
}
.acessos-lista .checkbox-boolean input { width: 18px; height: 18px; }
.acessos-lista .checkbox-boolean:hover {
  border-color: var(--primary);
}
.acessos-lista .checkbox-boolean:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.acessos-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  min-width: 0;
  max-width: 14rem;
}
.acessos-badges .badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
#atributos-dinamicos.grid-2 { align-items: start; }
#atributos-dinamicos > .field { margin-bottom: 0; min-width: 0; }
.switch { position: relative; width: 40px; height: 22px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position:absolute; inset:0; background:#cbd5e1; border-radius:999px; transition:.2s; }
.switch .track::before { content:""; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch:focus-within .track { box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-faint); font-weight: 700; padding: .7rem 1rem; border-bottom: 1px solid var(--line);
  background: #fafbfd; white-space: nowrap;
}
table.tbl td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tbody tr:hover { background: #fafbfe; }
table.tbl tr:last-child td { border-bottom: none; }
.tbl .cell-strong { font-weight: 600; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft);
  color: var(--primary-dark); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex: none;
}
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background:#eef1f6; flex:none; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.search {
  display: flex; align-items: center; gap: .5rem; background:#fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .5rem .75rem;
}
.search input { border: none; outline: none; font-size: 14px; width: 240px; background: transparent; }
.search svg { width: 17px; height: 17px; color: var(--text-faint); }
.search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.produtos-filtros { display: flex; flex-direction: column; gap: .75rem; flex: 1; min-width: 0; }
.produtos-filtros-busca { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.produtos-filtros-busca .search { flex: 1 1 320px; max-width: 620px; }
.produtos-filtros-selects { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.produtos-filtro { display: flex; flex-direction: column; gap: .3rem; min-width: min(100%, 190px); }
.produtos-filtro .select { width: 100%; min-height: 42px; }
.importacao-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 1rem; align-items: start; }
.importacao-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-height: 150px; padding: 1.25rem; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: #fafbfd; text-align: center; cursor: pointer; transition: .15s;
}
.importacao-dropzone:hover, .importacao-dropzone:focus-within { border-color: var(--primary); background: var(--primary-soft); }
.importacao-dropzone strong { color: var(--text); }
.importacao-dropzone span { color: var(--text-muted); font-size: 13px; }
.importacao-dropzone input { width: min(100%, 360px); margin-top: .55rem; }
.importacao-instrucoes p { margin: 0 0 .75rem; line-height: 1.55; }
.importacao-instrucoes p:last-child { margin-bottom: 0; }
.importacao-preview { max-height: 520px; }
.importacao-preview thead { position: sticky; top: 0; z-index: 2; }
.importacao-erros { margin: 0; padding-left: 1.1rem; color: var(--danger); font-size: 12px; line-height: 1.45; }
.importacao-confirmar { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.filter-checks { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.filter-checks-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 700; margin-right: .15rem; }
.check-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.check-chip {
  position: relative; display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: .32rem .75rem;
  font-size: 13px; font-weight: 500; cursor: pointer; background: #fff; color: var(--text);
  user-select: none; transition: .15s;
}
.check-chip input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.check-chip:hover { border-color: var(--primary); }
.check-chip:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }
.check-chip:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-soft); }
.check-chip:has(input:checked)::before { content: "✓"; font-size: 12px; font-weight: 700; }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: .3rem; align-items: center; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 .5rem; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background:#fff;
}
.pager .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager .disabled { color: var(--text-faint); }

/* ---------- Stat cards ---------- */
.stat { display: flex; gap: 1rem; align-items: flex-start; }
.stat .ico {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items:center; justify-content:center; flex:none;
}
.stat .ico svg { width: 22px; height: 22px; }
.stat .val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .lbl { color: var(--text-muted); font-size: 13px; }
.trend { font-size: 12px; font-weight: 700; display:inline-flex; align-items:center; gap:.2rem; }
.trend.up { color: var(--primary-dark); } .trend.down { color: var(--danger); }
.ico-green{background:var(--primary-soft);color:var(--primary-dark)}
.ico-blue{background:var(--info-soft);color:var(--info)}
.ico-amber{background:var(--warning-soft);color:#b45309}
.ico-red{background:var(--danger-soft);color:var(--danger)}
.ico-purple{background:var(--purple-soft);color:var(--purple)}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  padding: .65rem 1rem; font-weight: 600; font-size: 14px; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tab:hover { color: var(--text); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- Alerts ---------- */
.alert { display: flex; flex-wrap: wrap; gap: .75rem; padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: 14px; border:1px solid transparent; }
.alert > span { flex: 1; min-width: 0; }
.alert a { text-decoration: underline; font-weight: 600; }
.alert a:hover { color: inherit; }
.alert a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top:1px; }
.alert-info { background: var(--info-soft); color: #1e40af; border-color:#c3d4fb; }
.alert-warn { background: var(--warning-soft); color: #92400e; border-color:#fde68a; }
.alert-danger { background: var(--danger-soft); color: #991b1b; border-color:#fbd5d5; }
.alert-success { background: var(--primary-soft); color: var(--primary-dark); border-color:#a7e8cf; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty .ico { width: 60px; height: 60px; border-radius: 16px; background:#eef1f6; display:inline-flex; align-items:center; justify-content:center; margin-bottom: .75rem; }
.empty .ico svg { width: 30px; height: 30px; color: var(--text-faint); }
.empty .empty-title { color: var(--text); margin-bottom: .25rem; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content:""; position:absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 1.3rem; }
.tl-item::before { content:""; position:absolute; left:-22px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background:#fff; border: 3px solid var(--primary); }
.tl-item.blue::before { border-color: var(--info); }
.tl-item.amber::before { border-color: var(--warning); }
.tl-item.gray::before { border-color: var(--text-faint); }
.tl-item .when { font-size: 12px; color: var(--text-faint); }

/* =========================================================
   PAINEL INTERNO (Admin/Empresa) — layout com sidebar dark
   ========================================================= */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--navy); color: #c7d2e0; display: flex; flex-direction: column; z-index: 50;
}
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--navy-line); }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg,var(--primary),#34d399); display: inline-flex; align-items:center; justify-content:center; color:#052e1a; font-weight: 900; flex:none; }
.brand-name { color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand-sub { font-size: 10.5px; color: #7d8ba0; letter-spacing: .06em; text-transform: uppercase; }
.nav { flex: 1; overflow-y: auto; padding: .75rem .6rem 2rem; }
.nav::-webkit-scrollbar { width: 6px; } .nav::-webkit-scrollbar-thumb { background:#2a3d57; border-radius: 3px; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #62748e; padding: 1rem .8rem .35rem; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: .7rem; padding: .58rem .8rem; border-radius: 9px;
  color: #b6c2d4; font-size: 14px; font-weight: 500; margin-bottom: 1px;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(14,159,110,.22), rgba(14,159,110,.04)); color: #fff; box-shadow: inset 3px 0 0 var(--primary); }
.nav a .tag { margin-left: auto; font-size: 10.5px; background:#2a3d57; color:#cbd5e1; padding: .05rem .4rem; border-radius: 6px; font-weight:700; }
.nav a .tag.danger { background: var(--danger); color:#fff; }

.main { margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: .7rem 1.5rem; display: flex; align-items: center; gap: 1rem;
}
.topbar .menu-btn { display: none; background: none; border: none; padding: .3rem; }
.crumb { font-size: 13px; color: var(--text-muted); }
.crumb b { color: var(--text); font-weight: 700; }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background:#fff; display:inline-flex; align-items:center; justify-content:center; color: var(--text-muted); }
.icon-btn:hover { background:#f3f5f9; color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .count { position: absolute; top: -5px; right: -5px; background: var(--danger); color:#fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px; display:flex; align-items:center; justify-content:center; padding: 0 3px; }
.user-chip { display:flex; align-items:center; gap:.55rem; padding: .3rem .3rem .3rem .3rem; border-radius: 10px; }
.user-chip:hover { background:#f3f5f9; }
.user-chip .who { line-height: 1.1; } .user-chip .who b { font-size: 13px; } .user-chip .who small { color: var(--text-faint); }
.content { padding: 1.5rem; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--text-muted); font-size: 14px; margin-top: .15rem; }

/* =========================================================
   LOJA (Comprador) — header claro
   ========================================================= */
.shop { background: #fff; min-height: 100vh; }
.shop-top { background: var(--navy); color: #cbd5e1; font-size: 12.5px; }
.shop-top .container { display: flex; justify-content: space-between; align-items: center; height: 38px; }
.shop-top a:hover { color:#fff; }
.shop-header { border-bottom: 1px solid var(--line); background:#fff; position: sticky; top:0; z-index: 30; }
.shop-header .container { display: flex; align-items: center; gap: 1.5rem; height: 74px; }
.shop-logo { display:flex; align-items:center; gap:.6rem; }
.shop-logo .brand-name { color: var(--text); }
.shop-search { flex: 1; max-width: 620px; display:flex; align-items:center; border: 2px solid var(--primary); border-radius: 10px; overflow:hidden; }
.shop-search input { border:none; outline:none; padding: .65rem .9rem; flex:1; font-size: 14px; }
.shop-search button { border:none; background: var(--primary); color:#fff; padding: 0 1.1rem; align-self: stretch; }
.shop-search select { border:none; border-right: 1px solid var(--line); background:#f8fafc; padding: 0 .7rem; font-size: 13px; color: var(--text-muted); outline:none; }
.header-actions { display:flex; align-items:center; gap: .4rem; }
.h-act { display:flex; align-items:center; gap:.5rem; padding:.4rem .55rem; border-radius: 10px; color: var(--text); position:relative; }
.h-act:hover { background:#f3f5f9; }
.h-act:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; background:#f3f5f9; }
.h-act svg { width: 22px; height: 22px; }
.h-act .count { position:absolute; top:-6px; right:-8px; left:auto; background: var(--primary); color:#fff; font-size:10px; font-weight:700; min-width:17px; height:17px; border-radius:999px; display:flex; align-items:center; justify-content:center; padding:0 3px; }
.h-act .lbl { line-height:1.05; } .h-act .lbl small { display:block; color:var(--text-faint); font-size:11px; } .h-act .lbl b { font-size:13px; display:inline-flex; align-items:center; gap:.2rem; }
.h-act .lbl b svg { width:12px; height:12px; }
.h-act .user-ring { width:34px; height:34px; border:1.5px solid var(--text-muted); border-radius:50%; display:inline-flex; align-items:center; justify-content:center; flex:none; }
.h-act .user-ring svg { width:18px; height:18px; color:var(--text-muted); }
.h-act:hover .user-ring, .h-act:focus-visible .user-ring { border-color: var(--primary-dark); }
.h-act:hover .user-ring svg, .h-act:focus-visible .user-ring svg { color: var(--primary-dark); }

/* ---------- Minha conta ---------- */
.account-hello { display:flex; align-items:center; gap:.75rem; margin:1.5rem 0 1.25rem; color:var(--text-muted); font-size:15px; }
.account-hello .user-ring { width:42px; height:42px; border:1.5px solid var(--text-faint); border-radius:50%; display:inline-flex; align-items:center; justify-content:center; color:var(--text-faint); flex:none; }
.account-hello .user-ring svg { width:22px; height:22px; }
.account-layout { display:grid; grid-template-columns:280px 1fr; gap:1.5rem; align-items:start; padding-bottom:2rem; }
.account-nav { display:flex; flex-direction:column; gap:.55rem; }
.account-nav a { display:block; background:#fff; border:1px solid var(--line); border-radius:10px; padding:.85rem 1rem; color:var(--text); transition:border-color .15s, box-shadow .15s, background .15s; }
.account-nav a:hover { border-color:var(--line-strong); box-shadow:var(--shadow-sm); }
.account-nav a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.account-nav a.active { border-color: var(--primary); border-left:3px solid var(--primary); padding-left:calc(1rem - 2px); background: var(--primary-soft); }
.account-nav a.active .an-title { color:var(--primary-dark); }
.account-nav .an-title { display:block; font-weight:700; font-size:14px; margin-bottom:.15rem; }
.account-nav .an-desc { display:block; font-size:12.5px; color:var(--text-muted); line-height:1.35; }
.account-nav a.danger .an-title { color:var(--danger); }
.account-nav a.danger:hover { border-color: #f5c2c2; background: var(--danger-soft); }
.account-nav a[aria-disabled="true"] { opacity:.65; pointer-events:none; cursor:not-allowed; }
.account-panel > h1 { font-size:20px; margin:0 0 1rem; }
.account-panel-grid { display:grid; grid-template-columns:1.4fr 1fr; gap:1.25rem; align-items:start; }
.account-dl { display:grid; grid-template-columns:140px 1fr; gap:.55rem 1rem; font-size:14px; }
.account-dl dt { color:var(--text-muted); }
.account-dl dd { margin:0; font-weight:600; overflow-wrap:anywhere; }
.account-section-title { color:var(--primary-dark); font-size:16px; font-weight:700; margin:1.5rem 0 .85rem; }
@media (max-width: 1024px) {
  /* Com o novo link de conta, o header aperta antes dos 720px */
  .header-actions .h-act .lbl { display: none !important; }
}
@media (max-width: 900px) {
  .account-layout { grid-template-columns:1fr; }
  .account-panel-grid { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  .account-dl { grid-template-columns:1fr; gap:.15rem 0; }
  .account-dl dt { margin-top:.35rem; }
  .account-dl dt:first-child { margin-top:0; }
}

.shop-nav { background:#fff; border-bottom: 1px solid var(--line); }
.shop-nav .container { display:flex; align-items:center; gap: .3rem; height: 50px; }
.shop-nav a { padding: .5rem .85rem; font-size: 14px; font-weight: 600; color: var(--text); border-radius: 8px; }
.shop-nav a:hover { color: var(--primary-dark); background: var(--primary-soft); }
.shop-nav a.active { color: var(--primary-dark); }
.shop-nav .cat-btn { background: var(--primary); color:#fff; }
.shop-nav .cat-btn:hover { background: var(--primary-dark); color:#fff; }

.shop-footer { background: var(--navy); color: #9fb0c5; margin-top: 3rem; padding: 2.5rem 0 1.5rem; font-size: 13.5px; }
.shop-footer h4 { color:#fff; font-size: 14px; margin-bottom: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.shop-footer a { display:block; padding: .28rem 0; color:#9fb0c5; }
.shop-footer a:hover { color:#fff; }
.shop-footer .foot-grid { display:grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
.shop-footer .foot-bottom { border-top: 1px solid var(--navy-line); margin-top: 2rem; padding-top: 1.2rem; display:flex; justify-content: space-between; flex-wrap: wrap; gap:.5rem; color:#7d8ba0; }

/* ---------- Store layout w/ sidebar ---------- */
.shop-layout { display: grid; grid-template-columns: 270px 1fr; gap: 1.75rem; padding: 1.75rem 0; }
.shop-layout.left { grid-template-columns: 270px 1fr; }
.filter-box { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.2rem; background:#fff; }
.filter-box h4 { font-size: 14px; padding: .85rem 1rem; border-bottom: 1px solid var(--line); background:#fafbfd; }
.filter-box .body { padding: .9rem 1rem; }
.filter-list a { display:flex; justify-content: space-between; padding: .35rem 0; color: var(--text-muted); font-size: 14px; }
.filter-list a:hover { color: var(--primary-dark); }
.color-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); display:inline-block; }
.range { width: 100%; accent-color: var(--primary); }

/* ---------- Product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.product-grid.cols-3 { grid-template-columns: repeat(3,1fr); }
.pcard { border: 1px solid var(--line); border-radius: var(--radius); background:#fff; overflow: hidden; transition: .18s; position: relative; display:flex; flex-direction: column; }
.pcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: #dfe6ef; }
.pcard .media { position: relative; aspect-ratio: 1/1; background: #f5f7fa; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.pcard .media .ph { color:#c3ccd8; }
.pcard .media .ph svg { width: 64px; height: 64px; }
.pcard .tags { position:absolute; top: .6rem; left: .6rem; display:flex; flex-direction:column; gap:.3rem; }
.pcard .fav { position:absolute; top: .6rem; right: .6rem; width: 32px; height: 32px; border-radius: 50%; background:#fff; box-shadow: var(--shadow-sm); display:flex; align-items:center; justify-content:center; color: var(--text-muted); }
.pcard .fav:hover { color: var(--danger); }
.pcard .body { padding: .85rem .95rem 1rem; display:flex; flex-direction: column; flex:1; }
.pcard .cat { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.pcard .name { font-weight: 600; font-size: 14.5px; margin: .2rem 0 .35rem; line-height: 1.3; min-height: 38px; }
.pcard .name:hover { color: var(--primary-dark); }
.pcard .stars { color: #f5a623; font-size: 12.5px; letter-spacing: 1px; }
.pcard .price { margin-top: auto; padding-top: .6rem; display:flex; align-items:baseline; gap: .5rem; }
.pcard .price .now { font-size: 17px; font-weight: 800; color: var(--text); }
.pcard .price .old { font-size: 13px; color: var(--text-faint); text-decoration: line-through; }
.pcard .price .unit { font-size: 11.5px; color: var(--text-faint); font-weight:500; }
.pcard .actions { margin-top: .7rem; display:flex; gap: .4rem; }
.stars-lg { color:#f5a623; letter-spacing: 2px; font-size: 16px; }

/* ---------- Order status stepper ---------- */
.stepper { display:flex; gap:.4rem; }
.stepper .step { flex:1; text-align:center; position: relative; }
.stepper .step .bubble { width: 34px; height: 34px; border-radius:50%; background:#eef1f6; color: var(--text-faint); display:flex; align-items:center; justify-content:center; margin: 0 auto .4rem; font-weight:700; border: 2px solid var(--line); z-index:1; position: relative; }
.stepper .step .bubble svg { width:16px; height:16px; }
.stepper .step .lbl { font-size: 12px; color: var(--text-muted); }
.stepper .step::before { content:""; position:absolute; top: 17px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.stepper .step:first-child::before { display:none; }
.stepper .step.done .bubble { background: var(--primary); border-color: var(--primary); color:#fff; }
.stepper .step.done::before { background: var(--primary); }
.stepper .step.current .bubble { background:#fff; border-color: var(--primary); color: var(--primary-dark); box-shadow: 0 0 0 4px var(--primary-soft); }
.stepper .step.done .lbl, .stepper .step.current .lbl { color: var(--text); font-weight:600; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: linear-gradient(150deg, var(--navy), #0b2a44 60%, #0a3a2b); color:#fff; padding: 3rem; display:flex; flex-direction: column; justify-content: space-between; position: relative; overflow:hidden; }
.auth-side::after { content:""; position:absolute; width: 380px; height: 380px; background: radial-gradient(circle, rgba(14,159,110,.35), transparent 70%); right:-80px; bottom:-80px; }
.auth-side h2 { font-size: 30px; line-height: 1.2; margin-bottom: 1rem; }
.auth-feat { display:flex; gap:.7rem; margin-bottom: 1rem; align-items:flex-start; }
.auth-feat .ck { width:26px; height:26px; border-radius: 8px; background: rgba(14,159,110,.25); color:#6ee7b7; display:flex; align-items:center; justify-content:center; flex:none; }
.auth-feat .ck svg{ width:16px;height:16px;}
.auth-main { display:flex; align-items:center; justify-content:center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; margin-bottom: .3rem; }
.divider { display:flex; align-items:center; gap: 1rem; color: var(--text-faint); font-size: 12px; margin: 1.2rem 0; }
.divider::before, .divider::after { content:""; flex:1; height:1px; background: var(--line); }

/* ---------- Portal (index) ---------- */
.portal { max-width: 1180px; margin: 0 auto; padding: 2.5rem 20px 4rem; }
.portal-hero { background: linear-gradient(140deg, var(--navy), #0a3b2b); color:#fff; border-radius: 20px; padding: 2.5rem; margin-bottom: 2rem; position:relative; overflow:hidden; }
.portal-hero::after { content:""; position:absolute; width: 340px; height:340px; right:-60px; top:-60px; background: radial-gradient(circle, rgba(52,211,153,.3), transparent 70%); }
.portal-hero h1 { font-size: 32px; margin-bottom: .5rem; }
.portal-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 1.25rem; }
.portal-sec-title { display:flex; align-items:center; gap:.6rem; font-size: 15px; margin: 2rem 0 1rem; text-transform: uppercase; letter-spacing:.05em; color: var(--text-muted); }
.portal-sec-title::after { content:""; flex:1; height:1px; background: var(--line); }
.screen-card { background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; display:flex; gap:.85rem; align-items:flex-start; transition:.15s; box-shadow: var(--shadow-sm); }
.screen-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.screen-card .ico { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex:none; }
.screen-card .ico svg { width:20px; height:20px; }
.screen-card h4 { font-size: 14.5px; margin-bottom:.15rem; }
.screen-card p { font-size: 12.5px; color: var(--text-muted); margin:0; }

/* ---------- Misc ---------- */
.divide-y > * + * { border-top: 1px solid var(--line); }
.list-row { display:flex; align-items:center; gap:.85rem; padding:.8rem 0; }
.dl { display:grid; grid-template-columns: 180px 1fr; gap: .1rem 1rem; }
.dl dt { color: var(--text-muted); font-size: 13px; padding: .4rem 0; }
.dl dd { margin:0; padding: .4rem 0; font-weight: 500; }
.kbd { border:1px solid var(--line-strong); border-bottom-width:2px; border-radius:6px; padding:.05rem .35rem; font-size:12px; background:#fafbfd; }
.progress { height: 8px; background:#eef1f6; border-radius: 999px; overflow:hidden; }
.progress > span { display:block; height:100%; background: var(--primary); border-radius: 999px; }
.bars { display:flex; align-items:flex-end; gap: 8px; height: 160px; }
.bars .bar { flex:1; background: linear-gradient(var(--primary), #6ee7b7); border-radius: 6px 6px 0 0; position: relative; min-width: 8px; }
.bars .bar.alt { background: linear-gradient(var(--info), #93c5fd); }
.donut { width: 150px; height:150px; border-radius:50%; display:grid; place-items:center; }
.donut .hole { width: 96px; height:96px; background:#fff; border-radius:50%; display:grid; place-items:center; text-align:center; }
.legend { display:flex; flex-direction:column; gap:.5rem; }
.legend .row { display:flex; align-items:center; gap:.5rem; font-size:13px; }
.legend .sw { width:12px; height:12px; border-radius:3px; }

/* ---------- Modal (demo, CSS-only via :target) ---------- */
.modal-mask { position: fixed; inset:0; background: rgba(15,27,45,.55); display:none; align-items:center; justify-content:center; z-index: 100; padding: 1rem; }
.modal-mask:target { display: flex; }
.modal { background:#fff; border-radius: var(--radius-lg); max-width: 520px; width:100%; box-shadow: var(--shadow-lg); overflow:hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.lotes-toolbar, .mov-toolbar { align-items: flex-start; }
.mov-toolbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start;
  gap: .75rem 1.25rem;
}
.mov-toolbar > .toolbar { width: 100%; min-width: 0; }
.mov-toolbar > .muted { padding-top: .2rem; white-space: nowrap; }
.mov-filtros { width: 100%; gap: 1rem; }
.mov-filtros .produtos-filtros-busca { flex-wrap: nowrap; }
.mov-filtros .produtos-filtros-busca .search { max-width: 560px; }
.mov-filtros .mov-filtros-selects {
  display: grid; grid-template-columns: minmax(150px, .7fr) minmax(180px, .9fr) minmax(310px, 1.35fr) minmax(310px, 1.35fr);
  align-items: start; gap: .85rem;
}
.mov-filtro { min-width: 0; }
.mov-filtro > label, .mov-filtro-periodo legend { white-space: nowrap; line-height: 1.2; }
.lotes-filtros .search, .mov-filtros .search { flex: 1 1 240px; max-width: 420px; }
.lotes-filtros .search input, .mov-filtros .search input { width: 100%; min-width: 0; }
.lotes-filtros-selects, .mov-filtros-selects { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.lotes-filtro, .mov-filtro { display: flex; flex-direction: column; gap: .3rem; min-width: min(100%, 180px); }
.lotes-filtro .select, .mov-filtro .select, .mov-filtro .input { width: 100%; min-height: 42px; }
.mov-filtro-periodo {
  margin: 0; padding: 0; border: 0; min-width: 0;
}
.mov-filtro-periodo legend {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-faint); font-weight: 700; padding: 0; margin: 0 0 .3rem;
}
.mov-filtro-periodo-campos { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
.mov-filtro-periodo .mov-filtro { min-width: 0; }
.mov-filtro-periodo.is-invalid .input { border-color: var(--danger); }
.mov-filtro-periodo .field-error { margin-top: .35rem; }
.mov-tbl { min-width: 980px; }
.mov-tbl .cell-strong, .mov-tbl code { overflow-wrap: anywhere; }
.mov-tbl .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.mov-form-eyebrow {
  margin-bottom: .3rem; color: var(--primary-dark); font-size: 11.5px;
  font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.mov-form-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start; gap: 1rem;
}
.mov-form-main { display: grid; gap: 1rem; min-width: 0; }
.mov-form-section { overflow: visible; }
.mov-form-section .card-head { min-height: 58px; }
.mov-form-section .card-head > div { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.mov-form-step {
  width: 28px; height: 28px; border-radius: 999px; display: inline-grid; place-items: center;
  flex: none; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 800;
}
.mov-tipo-fieldset { margin: 0 0 1.15rem; padding: 0; border: 0; min-width: 0; }
.mov-tipo-fieldset > legend { margin-bottom: .45rem; padding: 0; }
.mov-tipo-opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mov-tipo-card {
  position: relative; display: flex; align-items: center; gap: .75rem; min-width: 0;
  padding: .85rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; transition: .15s;
}
.mov-tipo-card:hover { border-color: var(--primary); }
.mov-tipo-card input { position: absolute; opacity: 0; pointer-events: none; }
.mov-tipo-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.mov-tipo-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.mov-tipo-saida:has(input:checked) { border-color: var(--danger); background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger); }
.mov-tipo-icone {
  width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center;
  flex: none; background: var(--primary-soft); color: var(--primary-dark); font-size: 19px; font-weight: 800;
}
.mov-tipo-saida .mov-tipo-icone { background: var(--danger-soft); color: var(--danger); }
.mov-tipo-card strong, .mov-tipo-card small { display: block; }
.mov-tipo-card strong { font-size: 14px; }
.mov-tipo-card small { margin-top: .15rem; color: var(--text-muted); font-size: 12px; line-height: 1.3; }
.mov-form-fields { align-items: start; }
.mov-quantidade-input {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: stretch;
}
.mov-quantidade-input .input { border-radius: 0; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.mov-quantidade-btn {
  border: 1px solid var(--line-strong); background: #f8fafc; color: var(--text); font-size: 20px;
  font-weight: 600; cursor: pointer; transition: .15s;
}
.mov-quantidade-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.mov-quantidade-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }
.mov-quantidade-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }
.mov-quantidade-btn:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--primary); outline-offset: -2px; }
.mov-resumo { position: sticky; top: 1rem; overflow: hidden; }
.mov-resumo .card-head { background: #f8fafc; }
.mov-resumo-vazio { padding: 1.15rem .5rem; color: var(--text-muted); font-size: 13px; line-height: 1.5; text-align: center; }
.mov-resumo-produto { display: flex; flex-direction: column; gap: .28rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.mov-resumo-produto code { align-self: flex-start; }
.mov-resumo-dados { display: grid; gap: .65rem; margin: 1rem 0; }
.mov-resumo-dados > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mov-resumo-dados dt { color: var(--text-muted); font-size: 13px; }
.mov-resumo-dados dd { margin: 0; font-size: 13px; font-weight: 700; text-align: right; text-transform: capitalize; }
.mov-resumo-saldo {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-dark);
}
.mov-resumo-saldo span { font-size: 12px; font-weight: 700; }
.mov-resumo-saldo strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.mov-resumo-saldo strong.is-negative { color: var(--danger); }
.mov-resumo-alerta { margin: .75rem 0 0; padding: .65rem .75rem; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 12px; font-weight: 600; }
.mov-resumo-acoes { display: grid; gap: .55rem; padding: 0 1.4rem 1.25rem; }
.mov-resumo-acoes .btn { width: 100%; justify-content: center; min-height: 42px; }
.mov-resumo-acoes .btn[disabled] { opacity: .55; cursor: not-allowed; }
.lote-status-lista { display: flex; flex-wrap: wrap; gap: .35rem; }
.lote-acoes { display: inline-flex; align-items: center; justify-content: flex-end; gap: .25rem; }
.lote-check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; cursor: pointer; }
.lote-check input { width: 1.05rem; height: 1.05rem; margin: 0; flex: none; }
.lote-lista-barra { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.lote-validade-vencida { color: var(--danger); font-weight: 600; }
.lote-validade-proxima { color: #b45309; font-weight: 600; }
.lote-validade-legenda { display: block; font-weight: 600; }
.lotes-tbl-produtos { min-width: 880px; }
.lotes-tbl .cell-strong, .lotes-tbl code { overflow-wrap: anywhere; }
.lotes-paginacao { padding: .75rem 1rem; overflow-x: auto; }
.lote-dialog {
  border: 0; padding: 0; border-radius: var(--radius-lg); width: min(860px, calc(100vw - 2rem));
  max-height: min(86vh, 760px); box-shadow: var(--shadow-lg); color: var(--text); background: #fff;
}
.lote-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.lote-dialog::backdrop { background: rgba(15, 27, 45, .55); }
.lote-dialog-detalhe { width: min(560px, calc(100vw - 2rem)); }
.lote-dialog-head, .lote-dialog-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .9rem 1.1rem; flex: none;
}
.lote-dialog-head { border-bottom: 1px solid var(--line); }
.lote-dialog-head h2 { font-size: 16px; line-height: 1.3; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lote-dialog-head h2:focus { outline: none; }
.lote-dialog-head h2:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.lote-dialog-body {
  padding: 1rem 1.1rem 1.15rem; overflow: auto; flex: 1 1 auto; min-height: 0;
  overscroll-behavior: contain;
}
.lote-dialog-foot { border-top: 1px solid var(--line); justify-content: flex-end; }
.lote-dialog .table-wrap { overflow: visible; }
.lote-detalhe { grid-template-columns: 140px 1fr; }
.lote-detalhe-nota { overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 1180px) {
  .mov-filtros .mov-filtros-selects { grid-template-columns: minmax(160px, .7fr) minmax(190px, .9fr); }
  .mov-filtro-periodo { grid-column: span 1; }
  .mov-form-layout { grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); }
}
@media (max-width: 900px) {
  .mov-form-layout { grid-template-columns: 1fr; }
  .mov-resumo { position: static; }
  .importacao-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .lote-dialog, .lote-dialog-detalhe { width: calc(100vw - 1.25rem); }
  .lote-detalhe { grid-template-columns: 1fr; }
  .lote-dialog-foot { flex-wrap: wrap; }
  .lote-dialog-foot .btn { flex: 1; min-height: 42px; }
  .lotes-page-acoes { width: 100%; }
  .lotes-page-acoes .btn { flex: 1; }
  .lotes-toolbar, .mov-toolbar { flex-direction: column; align-items: stretch; }
  .mov-toolbar { display: flex; gap: .75rem; }
  .mov-toolbar > .muted { order: -1; padding-top: 0; }
  .lotes-filtros-selects, .mov-filtros .mov-filtros-selects { display: grid; grid-template-columns: 1fr; gap: .75rem; }
  .lotes-filtro, .mov-filtro { min-width: 0; }
  .lotes-filtros .search, .mov-filtros .search { max-width: none; }
  .lotes-filtros-busca, .mov-filtros .produtos-filtros-busca { align-items: stretch; flex-wrap: wrap; }
  .lotes-filtros-busca .btn, .mov-filtros .produtos-filtros-busca .btn { min-height: 42px; }
  .mov-filtros .produtos-filtros-busca .btn { flex: 1; }
  .mov-filtros .search input,
  .mov-filtro .input,
  .mov-filtro .select { font-size: 16px; }
  .mov-filtro-periodo { min-width: 0; flex: none; }
  .mov-filtro-periodo-campos { gap: .5rem; }
  .mov-form-page-head { align-items: flex-start; }
  .mov-form-page-head .btn { width: 100%; justify-content: center; }
  .mov-form-section .card-head { align-items: flex-start; }
  .mov-form-section .card-head > .tiny { display: none; }
  .mov-tipo-opcoes, .mov-form-fields { grid-template-columns: 1fr; }
  .mov-resumo-acoes { padding-left: 1rem; padding-right: 1rem; }
  .mov-tbl { min-width: 0; }
  .mov-tbl thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .mov-tbl, .mov-tbl tbody, .mov-tbl tr, .mov-tbl td { display: block; width: 100%; }
  .mov-tbl { position: relative; }
  .mov-tbl tbody tr { padding: .85rem 1rem 1rem; border-bottom: 1px solid var(--line); }
  .mov-tbl tbody tr:last-child { border-bottom: 0; }
  .mov-tbl td {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: .75rem; padding: .32rem 0; border-bottom: 0;
  }
  .mov-tbl td.nowrap { white-space: normal; }
  .mov-tbl td::before {
    flex: 0 0 42%; max-width: 9.5rem; font-size: 11.5px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); padding-top: .15rem;
  }
  .mov-tbl td:nth-child(1)::before { content: "Registrado em"; }
  .mov-tbl td:nth-child(2)::before { content: "Tipo"; }
  .mov-tbl td:nth-child(3)::before { content: "SKU"; }
  .mov-tbl td:nth-child(4)::before { content: "Produto"; }
  .mov-tbl td:nth-child(5)::before { content: "Lote"; }
  .mov-tbl td:nth-child(6)::before { content: "Qtd"; }
  .mov-tbl td:nth-child(7)::before { content: "Antes → Depois"; }
  .mov-tbl td:nth-child(8)::before { content: "Usuário"; }
  .mov-tbl td:nth-child(9)::before { content: "Modificado em"; }
  .mov-tbl .col-num { text-align: right; }
  .lotes-tbl-produtos { min-width: 0; }
  .lotes-tbl thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .lotes-tbl, .lotes-tbl tbody, .lotes-tbl tr, .lotes-tbl td { display: block; width: 100%; }
  .lotes-tbl { position: relative; }
  .lotes-tbl tbody tr { padding: .85rem 1rem 1rem; border-bottom: 1px solid var(--line); }
  .lotes-tbl tbody tr:last-child { border-bottom: 0; }
  .lotes-tbl td {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: .75rem; padding: .32rem 0; border-bottom: 0;
  }
  .lotes-tbl td::before {
    flex: 0 0 42%; max-width: 9.5rem; font-size: 11.5px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); padding-top: .15rem;
  }
  .lotes-tbl-produtos td:nth-child(1)::before { content: "Produto"; }
  .lotes-tbl-produtos td:nth-child(2)::before { content: "SKU"; }
  .lotes-tbl-produtos td:nth-child(3)::before { content: "Fabricante"; }
  .lotes-tbl-produtos td:nth-child(4)::before { content: "Itens"; }
  .lotes-tbl-produtos td:nth-child(5)::before { content: "Saldo"; }
  .lotes-tbl-produtos td:nth-child(6)::before { content: "Validade"; }
  .lotes-tbl-produtos td:nth-child(7)::before { content: "Status"; }
  .lotes-tbl-lista td:nth-child(1)::before { content: "Lote"; }
  .lotes-tbl-lista td:nth-child(2)::before { content: "Qtd atual"; }
  .lotes-tbl-lista td:nth-child(3)::before { content: "Validade"; }
  .lotes-tbl-lista td:nth-child(4)::before { content: "Status"; }
  .lotes-tbl td:last-child { justify-content: flex-end; padding-top: .65rem; }
  .lotes-tbl td:last-child::before { content: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(3,1fr); }
  .portal-grid { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .produto-form-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-flex; }
  .shop-layout { grid-template-columns: 1fr; }
  .filter-col { order: 2; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 720px) {
  .product-grid, .product-grid.cols-3 { grid-template-columns: repeat(2,1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .portal-grid { grid-template-columns: 1fr; }
  .shop-search, .shop-top { display: none; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { padding-bottom: 0; }
  .stat .val { font-size: 20px; }
  .page-head h1 { font-size: 19px; }
  .hide-sm { display: none !important; }
  .lote-massa-acoes { flex-direction: column; align-items: stretch; }
  .lote-massa-acoes .btn { width: 100%; }
  .lote-entrada-submit { max-width: none; align-items: stretch; width: 100%; }
  .lote-entrada-submit > span { display: block; width: 100%; }
  .lote-entrada-submit .hint { text-align: left; }
  .select-busca-control { min-height: 44px; }
  .select-busca-list { max-height: min(240px, 42vh); }
  .select-busca-item, .select-busca-empty { padding: .65rem .7rem; }
}
.scrim { position: fixed; inset: 0; background: rgba(15,27,45,.4); z-index: 45; display: none; }
.scrim.show { display: block; }
/* Campo de senha com controle de visibilidade */
.password-control{position:relative}.password-control .input{padding-right:48px}.password-toggle{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:36px;height:36px;border:0;border-radius:9px;background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer}.password-toggle:hover,.password-toggle:focus-visible{background:#f3f6f5;color:var(--primary-dark);outline:none}.password-toggle svg{width:19px;height:19px}.password-eye-closed{display:none}.password-toggle[aria-pressed="true"] .password-eye-open{display:none}.password-toggle[aria-pressed="true"] .password-eye-closed{display:block}
