@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Manrope:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  --white: #FFFFFF;
  --cream: #FFFCF3;
  --yellow: #FFC72C;
  --yellow-deep: #E6A800;
  --black: #1B1B1B;
  --ink: #2A2A2A;
  --gray: #767268;
  --gray-light: #E9E4D6;
  --green: #1E8E5A;
  --green-dark: #146641;
  --red: #D93B32;
  --red-dark: #A82A23;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(27,27,27,0.06);
  --shadow-lg: 0 12px 30px rgba(27,27,27,0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Manrope', sans-serif;
  background: var(--cream);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-font { font-family: 'Archivo Black', sans-serif; letter-spacing: -0.02em; }
.mono { font-family: 'Space Mono', monospace; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }

/* ===== Login ===== */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, #FFE694 0%, var(--yellow) 45%, var(--black) 46%, var(--black) 100%);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 42px 38px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--black);
}
.login-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.login-logo .slice { width: 34px; height: 34px; }
.login-card h1 { font-size: 26px; margin: 0; }
.login-card .tag { color: var(--gray); font-size: 13px; margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 2px solid var(--gray-light);
  font-size: 15px; background: var(--cream); color: var(--black);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--yellow-deep); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 10px; font-weight: 700; font-size: 14px;
  transition: transform .08s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--black); color: var(--yellow); width: 100%; padding: 13px; font-size: 15px; }
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: var(--green-dark); }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-dark); }
.btn-outline { background: transparent; border: 2px solid var(--black); color: var(--black); }
.btn-yellow { background: var(--yellow); color: var(--black); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.error-msg { background: #FCE8E6; color: var(--red-dark); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; display:none; }

/* ===== App shell ===== */
/* Barra lateral travada: a página toda não rola mais — só o conteúdo da
   direita (.main) tem rolagem própria. É mais confiável que "sticky" (que
   depende de como o resto da página se comporta); assim o menu fica sempre
   no lugar, parado, não importa o quanto role o conteúdo. Só vale pro
   desktop — no celular o menu já é outro (dropdown), tratado à parte na
   media query mais abaixo. */
html, body { height: 100%; overflow: hidden; }
.app { display: flex; height: 100vh; }
.sidebar {
  width: 230px; background: var(--black); color: var(--white); flex-shrink: 0;
  display: flex; flex-direction: column; padding: 22px 16px; height: 100vh; overflow-y: auto;
}

.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.sidebar .brand .slice { width: 28px; height: 28px; }
.sidebar .brand span { font-size: 17px; color: var(--white); }
.sidebar .brand b { color: var(--yellow); }
.mobile-bar { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: #C9C6BE; margin-bottom: 2px;
}
.nav-item:hover { background: #2C2C2C; color: var(--white); }
.nav-item.active { background: var(--yellow); color: var(--black); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid #333; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: var(--black); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:14px; }
.user-chip .name { font-size: 13px; font-weight: 700; color: var(--white); }
.user-chip .role { font-size: 11px; color: #999; }
.logout-link { display:block; margin-top: 10px; font-size: 12.5px; color: #C9C6BE; padding: 6px 8px; }
.logout-link:hover { color: var(--red); }

.main { flex: 1; padding: 28px 34px; max-width: 1240px; overflow-y: auto; height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.topbar h2 { margin: 0; font-size: 22px; }
.topbar .subtitle { color: var(--gray); font-size: 13.5px; margin-top: 2px; }

.card {
  background: var(--white); border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow); border: 1px solid #F0EBDA;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border-left: 5px solid var(--yellow); }
.stat-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--gray); font-weight: 700; }
.stat-card .value { font-family: 'Space Mono', monospace; font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat-card.profit { border-left-color: var(--green); }
.stat-card.alert { border-left-color: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
@media (max-width: 980px) {
  /* No celular a barra lateral não existe mais do jeito travado — o menu
     vira dropdown (mais abaixo) e a página inteira volta a rolar normal,
     junto com o conteúdo. A trava de rolagem é só pro layout de desktop. */
  html, body { overflow: visible; height: auto; }
  .grid-2 { grid-template-columns: 1fr; }
  .app { flex-direction: column; height: auto; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: column; padding: 0; overflow: visible; z-index: 40; }
  .sidebar .brand { display: none; }
  .sidebar-footer { display: none; }
  .main { padding: 18px; height: auto; overflow-y: visible; }

  /* Barra compacta: nome da tela atual + botão de 3 pontos. Só aparece no
     celular/tablet — no desktop o menu lateral de sempre continua igual. */
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
  .mobile-page-title { font-family: 'Archivo Black', sans-serif; color: var(--white); font-size: 16px; letter-spacing: -0.02em; }
  .mobile-menu-btn {
    background: #2C2C2C; color: var(--white); width: 38px; height: 38px; border-radius: 10px;
    font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
  }
  .mobile-menu-btn:active { background: var(--yellow); color: var(--black); }

  /* O nav fica escondido até o botão de 3 pontos abrir — aí vira um menu
     dropdown por cima do conteúdo, ancorado no canto onde está o botão. */
  #nav { display: none; }
  .sidebar.nav-open #nav {
    display: flex; flex-direction: column; gap: 2px;
    position: absolute; top: 100%; right: 16px; width: 240px; max-height: 70vh; overflow-y: auto;
    background: var(--black); border-radius: 12px; padding: 8px; box-shadow: var(--shadow-lg);
  }
  .sidebar.nav-open .nav-item { white-space: normal; margin-bottom: 0; }
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); padding: 10px 12px; border-bottom: 2px solid var(--gray-light); }
td { padding: 11px 12px; border-bottom: 1px solid #F2EEDF; }
tr:hover td { background: #FFFBF0; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-ok { background: #E4F4EA; color: var(--green-dark); }
.badge-low { background: #FFF3D6; color: #92700A; }
.badge-out { background: #FCE4E2; color: var(--red-dark); }
.badge-gray { background: #EFEFEF; color: #555; }

.section-title { font-size: 15px; font-weight: 800; margin: 0 0 14px; display:flex; align-items:center; justify-content:space-between; }

.rank-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #F2EEDF; }
.rank-item:last-child { border: none; }
.rank-item .n { width: 24px; height: 24px; border-radius: 6px; background: var(--yellow); color: var(--black); font-weight: 800; font-size: 12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.rank-item .info { flex: 1; }
.rank-item .info .name { font-weight: 700; font-size: 13.5px; }
.rank-item .info .sub { font-size: 11.5px; color: var(--gray); }
.rank-item .qty { font-family: 'Space Mono', monospace; font-weight: 700; }

.alert-item { display:flex; align-items:center; gap:10px; padding: 9px 10px; border-radius: 10px; background:#FFF6E0; margin-bottom:8px; font-size:13px; }
.alert-item.out { background:#FDEAE8; }

.toolbar { display: flex; gap: 10px; align-items:center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 9px 12px; border-radius: 8px; border: 2px solid var(--gray-light); font-size: 13.5px; }
.spacer { flex: 1; }

.modal-overlay { position: fixed; inset: 0; background: rgba(27,27,27,0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--white); border-radius: 16px; padding: 26px; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); position: relative; }
.modal h3 { margin-top: 0; padding-right: 30px; }
.modal-close-x { position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--gray-light); color: var(--black); font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center; line-height: 1; }
.modal-close-x:hover { background: var(--red); color: #fff; }

.bom-row { display: grid; grid-template-columns: 2fr 1fr 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.bom-row select, .bom-row input { padding: 8px 10px; border-radius: 8px; border: 2px solid var(--gray-light); font-size: 13px; }
.remove-row { background: #FCE4E2; color: var(--red-dark); border-radius: 8px; height: 34px; font-weight: 800; }

.pill-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.pill-tab { padding: 8px 16px; border-radius: 20px; background: var(--white); border: 2px solid var(--gray-light); font-weight: 700; font-size: 13px; }
.pill-tab.active { background: var(--yellow); border-color: var(--yellow-deep); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--gray); }

.toast { position: fixed; bottom: 22px; right: 22px; background: var(--black); color: var(--white); padding: 13px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600; z-index: 200; box-shadow: var(--shadow-lg); }
.toast.error { background: var(--red-dark); }
.toast.success { background: var(--green-dark); }

.code-box { background: var(--black); color: #B9F5D0; font-family: 'Space Mono', monospace; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; overflow-x: auto; user-select: all; }

.checkbox-row { display:flex; align-items:center; gap: 8px; font-size: 13px; margin-bottom: 6px; }

.hidden { display: none !important; }

/* ===== Checklist de fechamento ===== */
.pill-tab { cursor: pointer; }
.checklist-item-row { background: var(--white); border: 1px solid #F0EBDA; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.ci-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ci-check { display: flex; align-items: center; gap: 9px; font-size: 14.5px; flex: 1; cursor: pointer; }
.ci-check input { width: 19px; height: 19px; accent-color: var(--green); cursor: pointer; }
.checklist-item-row textarea { width: 100%; border-radius: 8px; border: 2px solid var(--gray-light); padding: 8px 10px; font-size: 13px; font-family: inherit; resize: vertical; min-height: 38px; }
.ci-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ci-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid var(--gray-light); }
.ci-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-thumb .rm { position: absolute; top: 2px; right: 2px; background: rgba(217,59,50,0.9); color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 18px; text-align: center; padding: 0; }
.item-unchecked { border-left: 4px solid var(--red); background: #FFF9F5; }
.item-checked { border-left: 4px solid var(--green); }
.sig-wrap { border: 2px dashed var(--gray-light); border-radius: 12px; background: var(--cream); position: relative; touch-action: none; }
.sig-wrap canvas { width: 100%; height: 160px; display: block; cursor: crosshair; touch-action: none; }
.sig-placeholder { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: var(--gray); font-size: 13px; pointer-events: none; }
.photo-lightbox { position: fixed; inset:0; background: rgba(0,0,0,.85); display:flex; align-items:center; justify-content:center; z-index:300; padding: 20px; }
.photo-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }

/* ===== Celular ===== */
/* Nunca deixa a página inteira rolar de lado — sempre ativo, não só no
   celular, mas só tem efeito visível quando algo realmente estica além da
   tela (o que só costuma acontecer em telas estreitas). */
html, body { overflow-x: hidden; max-width: 100%; }

@media (max-width: 900px) {
  /* Todo card com tabela ganha rolagem HORIZONTAL própria quando não cabe na
     tela — a tabela não encolhe a ponto de ficar ilegível, e a página em
     volta não quebra nem estica. "overflow-x: auto" só tem efeito quando o
     conteúdo realmente não cabe, então não muda nada nos cards sem tabela.
     Evitei usar ":has()" aqui de propósito — ainda não funciona em alguns
     celulares Android mais antigos. */
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card table { min-width: 560px; }
}

@media (max-width: 640px) {
  .main { padding: 14px; }
  .topbar { margin-bottom: 16px; }
  .topbar h2 { font-size: 19px; }
  .topbar .btn { width: 100%; justify-content: center; }
  .card { padding: 14px 14px; border-radius: 12px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 13px 14px; }
  .stat-card .value { font-size: 21px; }

  /* Itens do menu dropdown (ver a media query de 980px pra estrutura) —
     aqui só ajusto o tamanho pra caber bem num celular pequeno. */
  .nav-item { padding: 9px 10px; font-size: 12.5px; gap: 7px; }
  .nav-item svg { width: 16px; height: 16px; }

  /* Modal ocupa a tela quase inteira, sem sobra de espaço em volta, e com
     padding menor pra sobrar mais área útil pro conteúdo. */
  .modal-overlay { padding: 8px; align-items: flex-end; }
  .modal { padding: 18px 16px; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-close-x { top: 12px; right: 12px; }

  /* Pills e botões de ação ficam um pouco maiores — dedo é menos preciso que
     mouse, então o alvo de toque precisa ser maior. */
  .pill-tab { padding: 9px 14px; font-size: 12.5px; }
  .btn { padding: 12px 16px; }
  .btn-sm { padding: 9px 13px; font-size: 12.5px; }

  /* Linha do topo de cada item do checklist (nome + botão de foto) empilha
     bonito em vez de espremer tudo numa linha só. */
  .ci-header { gap: 8px; }
  .ci-header .btn-sm { width: 100%; }

  .toolbar { gap: 8px; }
  .toolbar input, .toolbar select { flex: 1; min-width: 0; }

  .grid-2 { gap: 12px; }
  .bom-row { grid-template-columns: 1fr 70px 32px; gap: 6px; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ---------- Comando de voz ---------- */
.voice-fab { position: fixed; right: 20px; bottom: 20px; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--red); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 90; box-shadow: var(--shadow-lg); }
.voice-fab:hover { background: var(--red-dark); }
.voice-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 12px; }
.voice-mic { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--red); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-lg); transition: transform .15s; }
.voice-mic:hover { transform: scale(1.04); }
.voice-mic:disabled { opacity: .55; cursor: default; transform: none; }
.voice-mic.rec { background: var(--black); animation: voicePulse 1.2s infinite; }
@keyframes voicePulse { 0% { box-shadow: 0 0 0 0 rgba(217,59,50,.55); } 70% { box-shadow: 0 0 0 20px rgba(217,59,50,0); } 100% { box-shadow: 0 0 0 0 rgba(217,59,50,0); } }
.voice-status { font-size: 13.5px; font-weight: 600; text-align: center; color: var(--gray); min-height: 20px; max-width: 460px; line-height: 1.4; }
.voice-status.rec { color: var(--red-dark); }
.voice-status.busy { color: var(--ink); }
.voice-status.warn { color: var(--red-dark); }
.voice-tip { font-size: 12px; color: var(--gray); line-height: 1.5; margin-bottom: 12px; text-align: center; }
.voice-lbl { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); margin-bottom: 6px; }
.voice-text { width: 100%; padding: 10px 12px; border: 1px solid var(--gray-light); border-radius: 8px; font: inherit; font-size: 14px; resize: vertical; margin-bottom: 8px; }
.voice-text:focus { outline: none; border-color: var(--yellow-deep); }
.voice-note { background: #FFF3D6; color: #92700A; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; margin: 10px 0 4px; }
#voice-result { margin-top: 14px; }
.voice-row { border: 1px solid var(--gray-light); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--white); }
.voice-row.bad { border-color: #E8B4B0; background: #FFF8F7; }
.voice-row-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.voice-row select, .voice-row input { padding: 9px 10px; border: 1px solid var(--gray-light); border-radius: 8px; font: inherit; font-size: 14px; background: var(--white); min-width: 0; }
.voice-row select:focus, .voice-row input:focus { outline: none; border-color: var(--yellow-deep); }
.voice-row .v-del { border: 0; background: transparent; color: var(--gray); font-size: 16px; cursor: pointer; padding: 6px 8px; }
.voice-row-body { display: flex; flex-direction: column; gap: 8px; }
.voice-row .v-new { gap: 8px; }
.voice-row .v-new input { flex: 1; }
.voice-row .v-qtyrow { display: flex; align-items: center; gap: 8px; }
.voice-row .v-qty { width: 120px; }
.voice-row .v-unit { font-weight: 700; color: var(--gray); }
.v-prev { font-size: 12.5px; margin-top: 8px; line-height: 1.45; }
.v-ok { color: var(--green-dark); }
.v-err { color: var(--red-dark); font-weight: 600; }
.v-warn { color: #92700A; margin-top: 3px; }
.voice-done { margin: 8px 0 16px 18px; line-height: 1.8; font-size: 14px; }
@media (max-width: 640px) { .voice-fab { right: 14px; bottom: 14px; } .voice-row .v-qty { width: 100px; } }

.voice-confirm-bar { position: sticky; bottom: -26px; background: linear-gradient(to top, var(--white) 78%, rgba(255,255,255,0)); padding: 14px 0 4px; margin-top: 4px; }
#voice-root.has-rows .voice-mic { width: 56px; height: 56px; }
#voice-root.has-rows .voice-mic svg { width: 24px; height: 24px; }
#voice-root.has-rows .voice-tip { display: none; }
@media (max-width: 640px) { .voice-confirm-bar { bottom: -18px; } }

/* ---- Assistente de voz: conversa e cartões de ação ---- */
.voice-head { padding-right: 38px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.voice-head h3 { margin: 0; }
.voice-log { display: none; max-height: 34vh; overflow-y: auto; padding: 4px 2px; margin-bottom: 8px; }
.v-bub { max-width: 92%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; margin: 6px 0; word-wrap: break-word; }
.v-bub.v-me { background: var(--yellow, #FFD54A); color: var(--ink, #222); margin-left: auto; border-bottom-right-radius: 4px; }
.v-bub.v-bot { background: #F3F3F1; color: var(--ink, #222); margin-right: auto; border-bottom-left-radius: 4px; }
.v-bub.v-okb { background: #E8F6EC; color: #1E6B3A; }
.v-listen { display: block; margin-top: 6px; border: 1px solid var(--gray-light); background: var(--white); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.voice-card { border: 1px solid var(--gray-light); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--white); }
.voice-card.danger { border-color: #E8B4B0; background: #FFF8F7; }
.voice-card .v-cdel { border: 0; background: transparent; color: var(--gray); font-size: 16px; cursor: pointer; padding: 6px 8px; }
.voice-card-lines { margin: 4px 0 0 18px; font-size: 13.5px; line-height: 1.55; }
.voice-card .v-warn { margin-top: 6px; }
.voice-confirm-bar .btn.danger { background: var(--red); }
@media (max-width: 640px) { .voice-log { max-height: 28vh; } }

/* ---- Tela Aprendizagem ---- */
.apr-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.apr-tab { border: 2px solid var(--gray-light); background: var(--white); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.apr-tab.active { border-color: var(--black); background: var(--black); color: var(--white); }
.apr-count { display: inline-block; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--gray-light); color: var(--black); font-size: 12px; margin-left: 4px; }
.apr-count.has { background: var(--red); color: var(--white); }
.apr-wait { font-size: 12.5px; font-weight: 700; color: #B7791F; margin-left: 6px; }
.apr-item { display: flex; gap: 14px; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.apr-meta { font-size: 13px; color: var(--gray); line-height: 1.5; margin-top: 4px; }
.apr-ctx { font-size: 12.5px; color: var(--gray); font-weight: 500; }
.apr-sug { font-size: 12.5px; color: #1d5fa8; margin-top: 4px; }
.apr-actions { display: flex; gap: 8px; flex-shrink: 0; }
.apr-mode { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0 12px; font-size: 14px; font-weight: 600; }
.apr-mode label, .apr-check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.apr-check { font-size: 13.5px; margin-top: 10px; }
.apr-bom { display: grid; grid-template-columns: 1fr 120px 32px; gap: 8px; margin-bottom: 10px; align-items: center; }
.apr-bom select, .apr-bom input { padding: 8px 10px; border-radius: 8px; border: 2px solid var(--gray-light); font-size: 13px; font: inherit; min-width: 0; }
.apr-bom .ab-new { grid-column: 1 / -1; gap: 8px; }
.apr-bom .ab-new input { flex: 1; }
.apr-bom .ab-cost { grid-column: 1 / -1; font-size: 12.5px; }
.apr-bom .ab-cost label { display: block; color: var(--gray); margin-bottom: 3px; font-weight: 600; }
.apr-bom .ab-cost input { width: 160px; }
.apr-cmv { margin-top: 10px; padding: 8px 10px; background: #F3F8F4; border-radius: 8px; font-size: 13px; }
.apr-cost { padding: 8px 10px; border: 2px solid var(--gray-light); border-radius: 8px; font: inherit; width: 170px; }
.apr-done p { line-height: 1.6; font-size: 14px; }
@media (max-width: 640px) { .apr-item { flex-direction: column; align-items: stretch; } .apr-actions { justify-content: flex-end; } .apr-bom { grid-template-columns: 1fr 96px 32px; } }

/* Fluxo de caixa: lançamento dividido */
.fx-split-btn{margin-top:4px;font-size:11.5px;padding:3px 8px}
.fx-split-chips{display:flex;flex-direction:column;gap:3px;cursor:pointer;max-width:260px}
.fx-chip{background:#FFF8E1;border:1px solid #FFE49A;border-radius:8px;padding:3px 8px;font-size:12px;line-height:1.3}
.fx-chip span{display:block;color:var(--gray);font-size:11px}
.fx-sp-row{display:grid;grid-template-columns:1fr 110px 34px;gap:6px;margin-bottom:10px}
.fx-sp-row .sp-note{grid-column:1 / -1}
.fx-sp-row select,.fx-sp-row input{min-width:0}
.fx-sp-status{margin:10px 0 0;padding:8px 10px;border-radius:8px;font-size:13px;font-weight:600}
.fx-sp-status.ok{background:#E6F4EA;color:#1E7B3A}
.fx-sp-status.bad{background:#FDECEA;color:#B3261E}
.fx-sp-row select,.fx-sp-row input{padding:9px 10px;border:1px solid var(--gray-light);border-radius:8px;font:inherit;font-size:14px;background:#fff}
.fx-item-in{display:block;margin-top:5px;width:100%;max-width:260px;font-size:12px;padding:4px 8px;border:1px solid var(--gray-light);border-radius:6px;background:#fff}
.fx-filters{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end;margin-bottom:8px}
.fx-filters .field{margin:0;min-width:180px;flex:1;max-width:320px}
.fx-filters select{width:100%}

/* preços por canal + uso do insumo no cardápio */
.apr-prices{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.apr-prices>div{display:flex;flex-direction:column;gap:3px}
.apr-prices span{font-size:12px;color:var(--gray);font-weight:600}
.apr-ch{display:inline-block;background:#F3EEDD;border-radius:6px;padding:1px 7px;font-size:11.5px;font-weight:700;margin-right:2px}
.apr-cmv-line{font-size:13px;margin-top:3px}
.apr-ch-table{width:100%;margin:6px 0;font-size:13px}
.prod-ch div{font-size:12.5px;white-space:nowrap;margin-bottom:2px}
.uso-box{border:1px dashed #D9CFA8;border-radius:12px;padding:12px;margin:12px 0;background:#FFFCF2}
.uso-title{font-weight:800;font-size:14px;margin-bottom:2px}
.uso-help{font-size:12px;color:var(--gray);margin-bottom:8px;line-height:1.4}
.uso-row{display:grid;grid-template-columns:1fr 90px 28px 32px;gap:6px;align-items:center;margin-bottom:6px}
.uso-row .uso-un{font-size:12px;color:var(--gray)}
.uso-details{margin-top:8px;border-top:1px dashed #E8E0C4;padding-top:8px}
.uso-details summary{cursor:pointer;font-weight:700;font-size:13px}
.uso-count{color:var(--green-dark)}
@media(max-width:560px){.uso-row{grid-template-columns:1fr 70px 24px 30px}.apr-prices{grid-template-columns:1fr 1fr}}
.uso-row input{padding:9px 10px;border:1.5px solid #E5DDBF;border-radius:10px;background:#fff;font:inherit;font-size:14px;min-width:0;width:100%}

.bom-row{grid-template-columns:2fr 1fr 70px 32px}
.bom-row .bom-calc{grid-column:1/-1;font-size:12px;color:var(--gray);margin-top:-4px}
@media(max-width:640px){.bom-row{grid-template-columns:1fr 70px 60px 32px}}
.apr-bom{grid-template-columns:1fr 100px 64px 32px}
@media(max-width:640px){.apr-bom{grid-template-columns:1fr 80px 60px 30px}}
.uso-row{grid-template-columns:1fr 80px 60px 32px}
.uso-row select.uso-un{padding:8px 4px;border:1.5px solid #E5DDBF;border-radius:10px;background:#fff;font:inherit;font-size:13px}
.prod-ficha{width:100%;font-size:13px;background:#FFFCF2;border-radius:8px}
.prod-ficha th{font-size:11.5px;text-align:left}
.prod-ficha-row td{padding-top:0}

.pack-grid{display:grid;grid-template-columns:1fr 1.2fr 70px;gap:8px}
.pack-grid>div{display:flex;flex-direction:column;gap:3px}
.pack-grid span{font-size:12px;color:var(--gray);font-weight:600}
.pack-grid input,.pack-grid select{padding:9px 10px;border:1.5px solid #E5DDBF;border-radius:10px;background:#fff;font:inherit;font-size:14px;min-width:0;width:100%}
.pack-grid-sm{grid-template-columns:1fr 1fr 64px;min-width:260px}
.pack-res{font-size:13px;margin-top:8px;color:var(--green-dark)}
@media(max-width:560px){.pack-grid{grid-template-columns:1fr 1fr 64px}}

.extra-row{display:grid;grid-template-columns:1.6fr 1fr 32px;gap:8px;margin-bottom:8px;align-items:center}
.extra-row input{padding:8px 10px;border-radius:8px;border:2px solid var(--gray-light);font:inherit;font-size:13px;min-width:0}

.pc-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
.pc-up{display:flex;gap:6px}.pc-up input{flex:1;min-width:0}.pc-up select{width:92px;flex:none}
.pc-cam-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.pc-ocr-badge{font-size:12px;font-weight:700;color:#8a6d0b;background:#FFF4CC;border-radius:8px;padding:4px 8px;margin-bottom:8px;display:inline-block}
