/* ================================================================
   Contagem TerraNutri GTA — Design System (verde + creme)
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary:       #1E4D3D;
  --primary-dark:  #133528;
  --primary-light: #E8F0EC;
  --accent:        #E94F1D;
  --accent-light:  #FEEEE6;
  --cream:         #FAF7F2;
  --paper:         #FFFFFF;
  --ink:           #1A1F1D;
  --ink-soft:      #4A524E;
  --muted:         #8B918E;
  --line:          #E6E8E4;
  --success:       #2E8B57;
  --success-bg:    #E0F0E6;
  --warning:       #E8A020;
  --warning-bg:    #FDF1DC;
  --danger:        #D43F2A;
  --danger-bg:     #FCE6E3;
  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     16px;
  --shadow:        0 1px 2px rgba(20,40,30,.05), 0 1px 3px rgba(20,40,30,.06);
  --shadow-md:     0 4px 12px rgba(20,40,30,.08);
  --topbar-h:      56px;
  --bottomnav-h:   60px;
  --transition:    .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }

/* ── Layout ── */
#app { min-height: 100vh; display: flex; flex-direction: column; }
#topbar {
  height: var(--topbar-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow);
}
.topbar-brand { display: flex; flex-direction: column; }
.brand-title { font-weight: 700; font-size: 15px; line-height: 1; }
.brand-sub { font-size: 11px; opacity: .85; }
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.btn-ghost-sm {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.btn-ghost-sm:hover { background: rgba(255,255,255,.15); }

#main {
  flex: 1;
  padding: 16px 16px calc(var(--bottomnav-h) + 16px);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.screen[hidden] { display: none; }

/* ── Bottom nav ── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottomnav-h);
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 10;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-label { font-weight: 700; }
.nav-badge {
  position: absolute;
  top: 8px;
  right: 28%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
}

/* ── Cards & forms ── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: var(--primary); }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 10px; color: var(--primary); }
h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
p { color: var(--ink-soft); margin-bottom: 8px; }

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.form-row input, .form-row textarea, .form-row select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--paper);
  outline: none;
  transition: var(--transition);
  width: 100%;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.form-row textarea { min-height: 64px; resize: vertical; }

.radio-group { display: flex; gap: 8px; }
.radio-group label {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: var(--transition);
}
.radio-group input { display: none; }
.radio-group input:checked + span,
.radio-group label.checked {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }
.btn-secondary {
  background: var(--paper);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: #C13F12; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #B0331F; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-row > .btn { flex: 1; }

/* ── Listas & tabelas ── */
.list-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; margin-bottom: 2px; }
.list-item-meta { font-size: 12px; color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-danger  { background: var(--danger-bg); color: var(--danger); }
.tag-muted   { background: var(--line); color: var(--ink-soft); }

.diff-positive { color: var(--success); font-weight: 700; }
.diff-negative { color: var(--danger); font-weight: 700; }

/* ── Checkbox grid ── */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.check-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
}
.check-grid label:hover { background: var(--primary-light); }

.filter-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--paper);
  outline: none;
  font-size: 13px;
}
.filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* ── Toast & Spinner ── */
#toast {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; }
#toast.error { background: var(--danger); }
#toast.success { background: var(--success); }

#spinner {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
#spinner[hidden] { display: none; }
.spinner-ring {
  width: 40px; height: 40px;
  border: 4px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile ── */
@media (max-width: 480px) {
  #main { padding: 12px 12px calc(var(--bottomnav-h) + 12px); }
  .check-grid { grid-template-columns: 1fr; }
}

/* ── Sync info bar ── */
.sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}
.sync-bar button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 14px;
}

/* ── Scanner modal ── */
#scanner-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanner-frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanner-overlay::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 10%;
  right: 10%;
  bottom: 30%;
  border: 3px solid #E94F1D;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
}
.scanner-line {
  position: absolute;
  top: 50%;
  left: 12%;
  right: 12%;
  height: 2px;
  background: #E94F1D;
  box-shadow: 0 0 8px #E94F1D;
  animation: scanline 1.6s ease-in-out infinite;
}
@keyframes scanline {
  0%, 100% { top: 32%; }
  50% { top: 68%; }
}
.scanner-status {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0,0,0,.6);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  max-width: 80vw;
  text-align: center;
}
.scanner-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,.95);
  color: var(--ink);
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.scanner-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
}
.scanner-ctrl {
  background: rgba(255,255,255,.95);
  color: var(--ink);
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.scanner-ctrl[hidden] { display: none; }
.scanner-zoom-wrap {
  position: absolute;
  bottom: 150px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.55);
  padding: 8px 14px;
  border-radius: 22px;
  color: #fff;
  font-weight: 700;
}
.scanner-zoom-wrap input[type=range] {
  flex: 1;
  accent-color: #E94F1D;
}
.scanner-zoom-wrap[hidden] { display: none; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── Install banner ── */
#install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--bottomnav-h) + 12px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 90;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#install-banner[hidden] { display: none !important; }
.install-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.install-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}
.install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.install-text strong { font-size: 14px; color: var(--ink); }
.install-text small { font-size: 12px; color: var(--ink-soft); line-height: 1.35; }
.install-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.install-actions .btn-ghost-sm {
  color: var(--ink-soft);
  border-color: var(--line);
}
.install-actions .btn { padding: 8px 18px; font-size: 13px; }

/* ── Tabs (tela Itens) ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 12px;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.tab-active { background: var(--primary); color: #fff; }

.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ── Modal de edição de item ── */
#edit-modal {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
}
.edit-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
}
.edit-modal-card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 90vw;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.edit-modal-card h3 { color: var(--primary); margin-bottom: 4px; }

/* ─── Localizações ────────────────────────────────────────────── */
.loc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 600;
}
.chip small { color: var(--muted); font-weight: 400; }
.chip:hover { border-color: var(--ink-soft); }
.chip.chip-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.chip.chip-active small { color: rgba(255,255,255,0.7); }

.loc-row {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.loc-row:last-child { border-bottom: 0; }
.loc-row-info { flex: 1; min-width: 0; }
.loc-row-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}
.loc-row-inputs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  width: 110px;
}
.loc-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  text-transform: uppercase;
  width: 100%;
}
.loc-input:focus { outline: none; border-color: var(--ink-soft); }
.loc-row-saving .loc-input { border-color: #f0b400; }
.loc-row-ok     .loc-input { border-color: var(--success, #2a9d4a); }
.loc-row-err    .loc-input { border-color: var(--danger,  #c33); }

/* Form inline de troca de senha em Admin — usa atributo [hidden] em vez de
   inline style, pra que JS possa toggleHidden corretamente. */
.user-senha-form {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.user-senha-form[hidden] {
  display: none !important;
}
.user-senha-form input[type="password"] {
  flex: 1;
  padding: 6px;
}

/* ================================================================
   WAREHOUSE (Movimentação de Estoque) — scoped under .mov-* prefix
   and mov-screen elements to avoid collisions with counting screens.
   ================================================================ */

/* ── Topbar com seta de voltar (estilo almoxarifado) ── */
.mov-topbar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border-bottom: 1px solid var(--primary-dark);
  margin: -16px -16px 16px; /* cancela o padding do #main */
}
.mov-back-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.mov-back-arrow {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.mov-back-text {
  font-weight: 600;
  font-size: 15px;
}

/* ── Wrap de conteúdo ── */
.mov-wrap {
  /* herdado do #main padding; nenhum padding extra necessário */
}

/* ── Menu-grid de tiles (sub-home) ── */
.mov-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mov-menu-tile {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.mov-menu-tile:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.mov-menu-icon  { font-size: 26px; line-height: 1; margin-bottom: 8px; }
.mov-menu-label { font-weight: 700; font-size: 15px; color: var(--primary-dark, #133528); }
.mov-menu-sub   { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ── Cabeçalho de seção ── */
.mov-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 600;
}

/* ── Abas (tabs do movimento) — usa .mov-tab-btn para não colidir com .tab da contagem ── */
.mov-tabs {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 12px;
  gap: 2px;
}
.mov-tab-btn {
  flex: 1;
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 6px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
  text-align: center;
}
.mov-tab-btn:hover:not(.active) { background: var(--primary-light); color: var(--primary-dark); }
.mov-tab-btn.active { background: var(--primary); color: #fff; }

/* ── Lista de itens ── */
.mov-lista { margin-top: 8px; font-size: 14px; }
.mov-vazio {
  color: var(--muted);
  font-style: italic;
  padding: 14px 0;
  text-align: center;
}
.mov-vazio.err { color: var(--danger); font-style: normal; }

.mov-item-titulo  { font-weight: 600; color: var(--ink); }
.mov-item-meta    { color: var(--muted); font-size: 12px; margin-top: 3px; }
.mov-item-meta code {
  background: var(--primary-light);
  color: var(--primary-dark, #133528);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, monospace;
}
.mov-item-obs { color: var(--ink-soft); font-size: 12px; margin-top: 4px; font-style: italic; }

/* Sugestão de produto na busca */
.mov-sugestao-item {
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.mov-sugestao-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Item de saldo na lista */
.mov-saldo-item {
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.mov-saldo-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.mov-saldo-row {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}
.mov-label-muted { color: var(--muted); }

/* Item de alerta */
.mov-alerta-item {
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.mov-alerta-item.cancelado { opacity: .65; }
.mov-alerta-link { display: block; text-decoration: none; color: inherit; }

/* Item de histórico */
.mov-hist-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 14px;
}
.mov-hist-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.mov-hist-ts { font-size: 11px; color: var(--muted); white-space: nowrap; }
.mov-hist-meta {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.mov-hist-footer {
  font-size: 12px; margin-top: 4px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.mov-hist-cancel-btn { margin-left: auto; }
.mov-cancelamento-info {
  margin-top: 6px; font-size: 12px;
  background: var(--danger-bg); color: var(--danger-ink, #8E2A1B);
  padding: 6px 8px; border-radius: 6px;
}

/* ── Botões de cancelar ── */
.mov-btn-cancelar {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  background: var(--paper);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}
.mov-btn-cancelar:hover { background: var(--danger-bg); }
.mov-btn-cancelar-sm {
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  background: var(--paper);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}
.mov-btn-cancelar-sm:hover { background: var(--danger-bg); }

/* ── Badges ── */
.mov-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mov-badge.badge-entrada  { background: var(--success-bg); color: var(--success); }
.mov-badge.badge-saida    { background: var(--danger-bg);  color: var(--danger);  }
.mov-badge.badge-transf   { background: var(--warning-bg); color: var(--warning); }
.mov-badge-tipo {
  background: var(--primary-light);
  color: var(--primary-dark, #133528);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.mov-badge-cancelado {
  background: var(--danger-bg);
  color: var(--danger-ink, #8E2A1B);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.mov-badge-reverso {
  background: var(--accent-light);
  color: var(--accent, #E94F1D);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* ── Saldos coloridos ── */
.saldo-pos  { color: var(--success); }
.saldo-zero { color: var(--muted); }
.saldo-neg  { color: var(--danger); }

/* ── Saldo grande (detalhe) ── */
.mov-saldo-grande {
  text-align: center;
  font-size: 64px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  line-height: 1.1;
  margin: 20px 0 6px;
}
.mov-saldo-grande small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
  font-family: inherit;
}

/* ── Linhas de dado (detalhe) ── */
.mov-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.mov-detail-row:last-child { border-bottom: none; }
.mov-detail-k { color: var(--muted); }
.mov-detail-v { font-family: ui-monospace, monospace; color: var(--ink); }

/* ── Card info do produto (no formulário) ── */
.mov-produto-card {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}

/* ── Preview de movimento ── */
.mov-preview {
  background: var(--primary-light);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-family: ui-monospace, monospace;
  color: var(--primary-dark, #133528);
  margin: 8px 0;
}

/* ── Mensagem de feedback no formulário ── */
.mov-form-msg {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.mov-form-msg.show { display: block; }
.mov-form-msg.err  { background: var(--danger-bg);  color: var(--danger-ink, #8E2A1B);  border-left: 3px solid var(--danger); }
.mov-form-msg.ok   { background: var(--success-bg); color: var(--success); border-left: 3px solid var(--success); }
.mov-form-msg.warn { background: var(--warning-bg); color: var(--warning-ink, #8A6512); border-left: 3px solid var(--warning); }

/* ── Aviso de catálogo ── */
.mov-aviso {
  padding: 8px 12px;
  background: var(--warning-bg);
  color: var(--warning-ink, #8A6512);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 8px;
}

/* ── Texto de ajuda ── */
.mov-help-text {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* ── btn-danger (para o modal de cancelar) ── */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #B0331F; }
