/* =========================================================
   Brasa PDV — mesmo design system do Nexo
   Tokens, tipografia, raios, sombras e componentes copiados do
   frontend/css/style.css do Nexo, para os dois apps parecerem
   o mesmo produto. Claro por padrão, escuro em [data-theme="dark"].

   Diferença de nome proposital: aqui `.btn` é o botão neutro e
   `.btn-primary` é o escuro de destaque (no Nexo é o contrário).
   A aparência é a mesma; só a convenção de classe muda.
   ========================================================= */

:root {
  --bg-0: #fafaf9;
  --bg-1: #ffffff;
  --bg-2: #f5f5f4;
  --bg-3: #e7e5e4;
  --bg-4: #d6d3d1;

  --primary: #18181b;
  --primary-light: #3f3f46;
  --primary-dark: #09090b;

  --text-1: #18181b;
  --text-2: #3f3f46;
  --text-3: #71717a;
  --text-4: #a1a1aa;
  --text-5: #d4d4d8;

  --border-1: #e4e4e7;
  --border-2: #d4d4d8;
  --border-focus: #18181b;

  --accent-blue: #2563eb;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --accent-amber: #d97706;

  /* Única cor da marca do cliente: painel do login e selo da logo. */
  --brand-1: #b8410f;
  --brand-2: #7a2708;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

  --transition: 150ms ease;
  --transition-slow: 250ms ease;

  --sidebar-w: 240px;
  --header-h: 56px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-0: #09090b;
  --bg-1: #18181b;
  --bg-2: #27272a;
  --bg-3: #3f3f46;
  --bg-4: #52525b;

  --primary: #fafafa;
  --primary-light: #e4e4e7;
  --primary-dark: #ffffff;

  --text-1: #fafafa;
  --text-2: #d4d4d8;
  --text-3: #a1a1aa;
  --text-4: #71717a;
  --text-5: #52525b;

  --border-1: #27272a;
  --border-2: #3f3f46;
  --border-focus: #fafafa;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
button, a, .sidebar-item, .chip, .btn, .icon-btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, textarea, select, .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--primary); color: var(--bg-1); }

.hidden { display: none !important; }
.muted { color: var(--text-3); }
.dim { color: var(--text-4); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ===== Selo da marca ===== */
.logo-mark {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--brand-1), var(--brand-2));
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.logo-mark::after {
  content: "";
  width: 9px; height: 11px;
  background: #ffd9a8;
  clip-path: polygon(50% 0%, 76% 34%, 68% 46%, 88% 68%, 66% 100%, 30% 100%, 12% 70%, 34% 44%, 26% 30%);
}
.logo-mark.has-logo { background-image: var(--logo); }
.logo-mark.has-logo::after { display: none; }
.logo-mark-lg { width: 34px; height: 34px; border-radius: var(--radius-md); }
.logo-mark-lg::after { width: 14px; height: 17px; }

/* ===== Login ===== */
.auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; background: var(--bg-2); z-index: 1000; overflow: auto;
}
.auth-split {
  width: 100%; max-width: 860px; min-height: 520px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--bg-1); border: 1px solid var(--border-1);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  animation: rise 0.35s ease both;
}
.auth-brand {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--brand-1) 0%, #932f0a 45%, var(--brand-2) 100%);
  color: #fff; padding: 2.5rem 2.25rem;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
}
.auth-brand::after {
  content: ""; position: absolute; right: -25%; bottom: -35%;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,190,120,0.30), transparent 62%);
  pointer-events: none;
}
.auth-brand-logo {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em;
}
.auth-brand-copy { position: relative; z-index: 1; }
.auth-brand-copy h2 { font-size: 1.6rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; max-width: 16ch; }
.auth-brand-copy p { color: rgba(255,255,255,0.75); font-size: 0.9rem; line-height: 1.6; margin-top: 0.7rem; max-width: 32ch; }

.auth-form { padding: 2.75rem 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.auth-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.25rem; letter-spacing: -0.01em; }
.auth-subtitle { font-size: 0.85rem; color: var(--text-3); margin-bottom: 1.25rem; }
.auth-error {
  background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.3);
  color: var(--accent-red); padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md); font-size: 0.82rem; margin-bottom: 0.85rem;
}

@media (max-width: 760px) {
  .auth-split { grid-template-columns: 1fr; min-height: 0; max-width: 420px; }
  .auth-brand { padding: 1.75rem; gap: 1rem; }
  .auth-brand-copy h2 { font-size: 1.25rem; }
  .auth-form { padding: 1.75rem; }
}

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-areas: "sidebar header" "sidebar main";
  height: 100vh; height: 100dvh;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.sidebar {
  grid-area: sidebar;
  background: var(--bg-1);
  border-right: 1px solid var(--border-1);
  display: flex; flex-direction: column;
  padding: 1.25rem 0;
  padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
  height: 100%; overflow-y: auto;
}
.sidebar-logo { display: flex; align-items: center; gap: 0.6rem; padding: 0 1.25rem; margin-bottom: 2rem; }
.sidebar-logo-text { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 0.7rem; }
.sidebar-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: 1.03rem; font-weight: 500;
  transition: all var(--transition);
  text-align: left; width: 100%; user-select: none;
}
.sidebar-group { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-4); padding: 0.85rem 0.8rem 0.25rem; user-select: none; }
.sidebar-group:first-child { padding-top: 0.2rem; }
.sidebar-item:hover { background: var(--bg-2); color: var(--text-1); }
.sidebar-item.active { background: var(--primary); color: var(--bg-1); }
.si-ic { width: 19px; height: 19px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.si-ic svg { width: 100%; height: 100%; display: block; }
.si-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-foot { margin-top: auto; padding: 0.7rem; display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-user {
  font-size: 0.72rem; color: var(--text-4); padding: 0 0.8rem;
  display: flex; gap: 0.4rem; justify-content: space-between;
}

/* Assinatura de quem fez o sistema */
.sidebar-vendor {
  padding: 0.5rem 0.8rem 0;
  border-top: 1px solid var(--border-1);
  font-size: 0.72rem; letter-spacing: 0.02em;
  color: var(--text-4); text-align: center; user-select: none;
}
.sidebar-vendor b { color: var(--text-2); font-weight: 700; }
.vendor-short { display: none; }

/* ===== Menu recolhido (rail) — mesmo comportamento do Nexo ===== */
.rail-btn {
  margin-left: auto; width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: var(--radius-sm);
  color: var(--text-4); cursor: pointer; transition: all var(--transition);
}
.rail-btn svg { width: 15px; height: 15px; }
.rail-btn:hover { background: var(--bg-2); color: var(--text-1); }

.app.rail { --sidebar-w: 66px; }

@media (min-width: 769px) {
  .app.rail .sidebar { overflow: hidden; }
  .app.rail .sidebar-logo { padding: 0 0.4rem; justify-content: center; gap: 0; }
  .app.rail .logo-mark { display: none; }        /* sobra só o botão de reexpandir */
  .app.rail .sidebar-logo-text { display: none; }
  .app.rail .rail-btn { margin: 0 auto; }
  .app.rail .rail-btn svg { transform: scaleX(-1); }

  .app.rail .si-tx { display: none; }
  .app.rail .sidebar-group { font-size: 0; padding: 0.5rem 0 0.1rem; border-top: 1px solid var(--border-1); margin: 0.35rem 0.4rem 0; }
  .app.rail .sidebar-group:first-child { border-top: 0; margin-top: 0; }
  .app.rail .sidebar-item { position: relative; }
  .app.rail .si-conta { position: absolute; top: 1px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 0.62rem; }
  .app.rail .sidebar-nav { padding: 0 0.5rem; gap: 3px; }
  .app.rail .sidebar-item { justify-content: center; padding: 0.55rem 0; gap: 0; }
  .app.rail .sidebar-foot { padding: 0.5rem 0.4rem; }
  .app.rail .sidebar-user { display: none; }
  .app.rail .sidebar-vendor { padding: 0.5rem 0 0; }
  .app.rail .vendor-full { display: none; }
  .app.rail .vendor-short { display: inline; font-weight: 700; color: var(--text-3); }
}

/* No celular a barra já é gaveta — o rail não se aplica */
@media (max-width: 768px) {
  .app.rail { --sidebar-w: 260px; }
  .rail-btn { display: none; }
}

/* ===== Header ===== */
.header {
  grid-area: header;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center;
  padding: 0 1.5rem; gap: 1rem;
  padding-top: env(safe-area-inset-top, 0px);
  z-index: 10;
}
.header-title { font-size: 0.95rem; font-weight: 600; color: var(--text-2); }
.header-actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }

.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); transition: all var(--transition); flex-shrink: 0;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--bg-2); color: var(--text-1); }

.mobile-toggle { display: none; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 40; display: none; }
.sidebar-overlay.active { display: block; }

.main { grid-area: main; overflow: auto; width: 100%; min-width: 0; }
.main > .page { padding: 1.75rem 2rem 3rem; animation: fadeIn 0.2s ease; }
/* A frente de caixa ocupa a área inteira, sem o respiro das outras telas. */
.main.flush { overflow: hidden; }

.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
/* Aliases: o JV do PDV usa .page-head/.card-head; mapeiam para o
   .page-header/.card-header do Nexo sem precisar reescrever o markup. */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-head h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.page-head p { color: var(--text-3); font-size: 0.85rem; margin-top: 0.2rem; }
.page-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-3); font-size: 0.85rem; margin-top: 0.2rem; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.section-title {
  font-size: 0.78rem; font-weight: 600; color: var(--text-4);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem;
}

/* ===== Botões ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg-1); color: var(--text-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 500;
  transition: all var(--transition); white-space: nowrap;
}
.btn:hover { background: var(--bg-2); border-color: var(--text-4); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary, .btn-secondary { /* .btn-secondary existe para casar com o Nexo */ }
.btn-primary {
  background: var(--primary); color: var(--bg-1); border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }

.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-2); color: var(--text-1); }

.btn-danger { background: var(--accent-red); color: #fff; border-color: var(--accent-red); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.1rem; font-size: 0.95rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 0.4rem; width: 32px; height: 32px; }
.btn-block { width: 100%; }

/* ===== Cards ===== */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color var(--transition);
}
.card-head, .card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; gap: 0.75rem;
}
.card-head h3, .card-title { font-size: 0.9rem; font-weight: 600; }
.card-subtitle { font-size: 0.78rem; color: var(--text-3); margin-top: 0.1rem; }

.grid { display: grid; gap: 0.75rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ===== Indicadores (equivalente ao .stat-card do Nexo) ===== */
.kpi {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  transition: all var(--transition);
}
.kpi:hover { border-color: var(--border-2); }
.kpi-label { font-size: 0.78rem; color: var(--text-3); font-weight: 500; }
.kpi-value { font-size: 1.5rem; font-weight: 600; margin-top: 0.25rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 0.75rem; margin-top: 0.4rem; color: var(--text-3); }
.kpi-foot .up { color: var(--accent-green); }
.kpi-foot .down { color: var(--accent-red); }
.kpi.green .kpi-value { color: var(--accent-green); }
.kpi.red .kpi-value { color: var(--accent-red); }

/* ===== Tabelas ===== */
.table-wrap {
  overflow-x: auto;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
}
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th {
  text-align: left; font-weight: 600; color: var(--text-3);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border-1);
  white-space: nowrap; background: var(--bg-1);
}
tbody td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border-1); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--bg-2); }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: 0.35rem; }

/* ===== Vazio ===== */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--text-3); font-size: 0.8rem; }
.empty strong { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.3rem; }

/* ===== Selos ===== */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--bg-2); border: 1px solid var(--border-1);
  color: var(--text-2);
  border-radius: 999px; padding: 0.12rem 0.55rem;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge.green { color: var(--accent-green); border-color: rgba(22,163,74,0.3); }
.badge.red   { color: var(--accent-red);   border-color: rgba(220,38,38,0.3); }
.badge.blue  { color: var(--accent-blue);  border-color: rgba(37,99,235,0.3); }
.badge.gold  { color: var(--accent-amber); border-color: rgba(217,119,6,0.3); }
.badge.ember { color: var(--brand-1);      border-color: rgba(184,65,15,0.35); }
[data-theme="dark"] .badge.ember { color: #f79b63; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ===== Chips ===== */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--border-1);
  background: var(--bg-2); color: var(--text-2);
  border-radius: 999px; font-size: 0.8rem; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--text-1); }
.chip.on, .chip.active { background: var(--primary); color: var(--bg-1); border-color: var(--primary); }

/* ===== Formulários ===== */
.form-group { margin-bottom: 0.85rem; }
.form-label, .field > span {
  display: block; margin-bottom: 0.3rem;
  font-size: 0.78rem; font-weight: 500; color: var(--text-2);
}
.field { display: block; min-width: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.85rem; }

.form-input, input[type=text], input[type=password], input[type=number], input[type=email],
input[type=date], input[type=search], input[type=tel], input[type=color], select, textarea {
  width: 100%;
  padding: 0.5rem 0.7rem;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-size: 0.875rem;
  transition: all var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.05);
}
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus {
  box-shadow: 0 0 0 3px rgba(250, 250, 250, 0.07);
}
input::placeholder { color: var(--text-4); }
input[readonly] { color: var(--text-3); background: var(--bg-2); }
textarea { resize: vertical; min-height: 70px; }
input[type=color] { padding: 3px; height: 34px; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 14px;
  padding-right: 2rem; cursor: pointer;
}

.check { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.82rem; user-select: none; }
details summary { cursor: pointer; font-size: 0.78rem; color: var(--text-3); }

/* ===== Modal ===== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 520px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.15s ease;
}
.modal.wide { max-width: 720px; }
.modal.slim { max-width: 400px; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-1);
}
.modal-head h2 { font-size: 0.95rem; font-weight: 600; }
.modal-body { padding: 1.25rem; overflow-y: auto; display: grid; gap: 0.85rem; }
.modal-foot {
  display: flex; gap: 0.5rem; padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-1); justify-content: flex-end; flex-wrap: wrap;
}
.close-x {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 1.25rem; line-height: 1;
  transition: all var(--transition);
}
.close-x:hover { background: var(--bg-2); color: var(--text-1); }

/* ===== Toast ===== */
.toast-container {
  position: fixed; bottom: 1rem; right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 0.4rem; z-index: 200;
}
.toast {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  box-shadow: var(--shadow-lg);
  min-width: 220px; max-width: 340px;
  font-size: 0.85rem;
  animation: slideInRight 0.2s ease;
}
.toast.ok { border-left: 2px solid var(--accent-green); }
.toast.err { border-left: 2px solid var(--accent-red); }

/* Miniatura da foto do produto no cadastro */
.prod-photo {
  width: 96px; height: 96px; flex-shrink: 0;
  border-radius: var(--radius-md); overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--border-1);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-4); font-size: 0.72rem;
}
.prod-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== Alerta de pedido novo ===== */
.alert-overlay { background: rgba(0,0,0,0.62); }
.alert-modal { max-width: 620px; border-color: var(--brand-1); box-shadow: 0 0 0 1px var(--brand-1), var(--shadow-lg); }

.alert-top {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
}
.alert-top > div:nth-child(2) { flex: 1; min-width: 0; }
.alert-kicker {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.09em;
  font-weight: 700; color: rgba(255,255,255,0.85);
}
.alert-top h2 {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 0.1rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.alert-sub { font-size: 0.78rem; color: rgba(255,255,255,0.8); }
.alert-total { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.alert-pulse {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.18); color: #fff;
  display: flex; align-items: center; justify-content: center;
  animation: alertPulse 1.4s ease-in-out infinite;
}
.alert-pulse svg { width: 22px; height: 22px; }
@keyframes alertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.45); }
  70%      { box-shadow: 0 0 0 14px rgba(255,255,255,0); }
}
@media (prefers-reduced-motion: reduce) { .alert-pulse { animation: none; } }

/* Sino do header: risco aparece só quando está mudo */
#btnMute .mute-slash { opacity: 0; }
#btnMute.muted { color: var(--accent-red); }
#btnMute.muted .mute-slash { opacity: 1; }

/* ===== Precificação ===== */
.pricing {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 0.9rem; display: grid; gap: 0.7rem;
}
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 0.7rem; }
.pricing-cell span { display: block; font-size: 0.72rem; color: var(--text-3); font-weight: 500; }
.pricing-cell strong { display: block; font-size: 1rem; font-weight: 600; margin-top: 0.1rem; font-variant-numeric: tabular-nums; }
.pricing-suggest {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--radius-md); padding: 0.65rem 0.85rem; flex-wrap: wrap;
}
.pricing-suggest .label { font-size: 0.78rem; color: var(--text-2); font-weight: 600; }
.pricing-suggest .value { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.margin-meter { height: 4px; border-radius: 4px; background: var(--bg-3); overflow: hidden; }
.margin-meter i { display: block; height: 100%; border-radius: 4px; transition: width 0.2s; }

/* ===== Gráficos — mesmo donut + legenda do financeiro do Nexo ===== */
.donut-row { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.donut-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; pointer-events: none;
}
.donut-center span { font-size: 0.6rem; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.05em; }
.donut-center b { font-size: 0.95rem; font-weight: 700; }
.donut-legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 7px; }
.dleg { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.dleg-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dleg-nm { flex: 0 1 auto; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dleg-bar { flex: 0 0 46px; height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.dleg-bar > span { display: block; height: 100%; border-radius: 3px; }
.dleg-val { font-weight: 600; white-space: nowrap; margin-left: auto; font-variant-numeric: tabular-nums; }
.dleg-val i { opacity: 0.6; font-style: normal; font-size: 0.9em; margin-left: 3px; }
.chart-scope-tag { font-size: 0.72rem; opacity: 0.6; }
.chart-insight {
  font-size: 0.84rem; margin-bottom: 0.9rem; padding: 8px 10px;
  border-radius: var(--radius-lg); background: var(--bg-2);
}
.chart-insight i { opacity: 0.65; font-style: normal; }

/* ===== Rankings ===== */
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-1); }
.bar-row:last-child { border-bottom: none; }
.bar-row .name { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .val { font-size: 0.82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1/-1; height: 4px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--primary); }
.bar-fill.cold { background: var(--bg-4); }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 96px; }
.spark-col { flex: 1; min-width: 3px; background: var(--bg-3); border-radius: 3px 3px 0 0; transition: all var(--transition); }
.spark-col.on { background: var(--primary); }
.spark-col:hover { opacity: 0.7; }

/* =========================================================
   FRENTE DE CAIXA
   ========================================================= */
.pdv { display: grid; grid-template-columns: 1fr 372px; height: 100%; min-height: 0; }
.pdv-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border-1); }

/* Aviso de caixa fechado, acima da barra de leitura */
.register-warn {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  background: rgba(217, 119, 6, 0.10);
  border-bottom: 1px solid rgba(217, 119, 6, 0.28);
  color: var(--accent-amber);
  font-size: 0.8rem; line-height: 1.35;
}
.register-warn strong { display: block; font-size: 0.85rem; }
.register-warn > div { flex: 1; min-width: 0; }
.register-warn > div > div { color: var(--text-3); }
.register-warn .si-ic { color: var(--accent-amber); }
.register-warn .btn { flex-shrink: 0; }

/* Caixa aberto: mesma faixa, mas sem alarme — é só situação, não aviso. */
.register-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 1.25rem;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-1);
  font-size: 0.78rem; line-height: 1.35;
}
.register-bar > div { flex: 1; min-width: 0; }
.register-bar strong { display: block; font-size: 0.82rem; }
.register-bar > div > div { color: var(--text-3); }
.register-bar .btn { flex-shrink: 0; }
/* a loja online na barra do caixa: o ponto diz se está recebendo pedidos */
.loja-btn { display: inline-flex; align-items: center; gap: 6px; }
.loja-btn .loja-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-red, #dc2626); flex-shrink: 0; }
.loja-btn.aberta .loja-dot { background: var(--accent-green); }
.loja-status { font-size: 0.75rem; color: var(--text-3); flex-shrink: 0; }
/* o atalho Pedidos na barra do caixa: o número em aberto; âmbar quando chegou pedido da loja que ninguém abriu */
.pedidos-btn { display: inline-flex; align-items: center; gap: 6px; }
.pedidos-conta { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700;
  background: var(--text-1, #18181b); color: var(--bg-1, #fff); }
.pedidos-btn.tem-novo { border-color: var(--accent-amber); color: var(--accent-amber); }
.pedidos-btn.tem-novo .pedidos-conta { background: var(--accent-amber); color: #fff; }

.pdv-scan { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-1); background: var(--bg-1); }
.scan-box { position: relative; display: flex; gap: 0.5rem; align-items: center; }
.scan-box input {
  font-size: 1rem; padding: 0.75rem 0.85rem 0.75rem 2.5rem;
  background: var(--bg-2); border-color: transparent; border-radius: var(--radius-lg);
}
.scan-box input:focus { background: var(--bg-1); }
.scan-box .scan-icon {
  position: absolute; left: 0.9rem; width: 17px; height: 17px; pointer-events: none;
  background: var(--text-4);
  -webkit-mask: var(--i-scan) center/contain no-repeat; mask: var(--i-scan) center/contain no-repeat;
}
.scan-hint { display: flex; gap: 0.9rem; margin-top: 0.6rem; font-size: 0.72rem; color: var(--text-4); flex-wrap: wrap; }
.scan-hint kbd {
  background: var(--bg-2); border: 1px solid var(--border-1); border-bottom-width: 2px;
  border-radius: var(--radius-sm); padding: 0 5px; font-size: 0.7rem;
  font-family: var(--font-sans); color: var(--text-3);
}

.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: var(--bg-1); border: 1px solid var(--border-1); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-height: 340px; overflow: auto;
}
.suggest-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.85rem; cursor: pointer; border-bottom: 1px solid var(--border-1);
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.on { background: var(--bg-2); }
.suggest-item .s-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.suggest-item .s-meta { font-size: 0.72rem; color: var(--text-4); }
.suggest-item .s-price { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 0.88rem; }

.cart { flex: 1; overflow: auto; min-height: 0; background: var(--bg-0); }
.cart-item {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 0.85rem;
  padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--border-1); background: var(--bg-1);
}
.cart-item:hover { background: var(--bg-2); }
.cart-idx {
  width: 24px; height: 24px; border-radius: var(--radius-sm); background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; color: var(--text-3); font-weight: 600;
}
.cart-name { font-size: 0.9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-sub { font-size: 0.75rem; color: var(--text-4); margin-top: 0.1rem; font-variant-numeric: tabular-nums; }
.cart-qty { display: flex; align-items: center; gap: 0.3rem; }
.qty-btn {
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--bg-1); color: var(--text-3);
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem; line-height: 1;
  transition: all var(--transition);
}
.qty-btn:hover { background: var(--bg-2); color: var(--text-1); }
.qty-val {
  min-width: 62px; text-align: center; font-weight: 600; font-size: 0.85rem;
  font-variant-numeric: tabular-nums; cursor: pointer; border-radius: var(--radius-sm); padding: 0.15rem 0.25rem;
}
.qty-val:hover { background: var(--bg-2); }
.cart-total { min-width: 84px; text-align: right; font-weight: 600; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.cart-del {
  color: var(--text-4); padding: 0.2rem 0.35rem; border-radius: var(--radius-sm);
  font-size: 1rem; line-height: 1; transition: all var(--transition);
}
.cart-del:hover { color: var(--accent-red); background: var(--bg-2); }

.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
  height: 100%; color: var(--text-4); text-align: center; padding: 2.5rem; font-size: 0.85rem;
}
.cart-empty .big { font-size: 1rem; color: var(--text-3); font-weight: 600; }

.pdv-right { display: flex; flex-direction: column; background: var(--bg-1); min-height: 0; }
.pdv-customer { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border-1); }
.customer-slot {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.7rem; border-radius: var(--radius-md);
  background: var(--bg-2); border: 1px dashed var(--border-2);
  cursor: pointer; transition: all var(--transition);
}
.customer-slot:hover { border-color: var(--primary); }
.customer-slot.filled { border-style: solid; border-color: var(--border-2); background: var(--bg-2); }
.customer-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.75rem; color: var(--text-2); flex-shrink: 0;
}
.customer-info { flex: 1; min-width: 0; line-height: 1.3; }
.customer-info strong { display: block; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-info span { font-size: 0.72rem; color: var(--text-3); }

.pdv-totals { padding: 1rem 1.1rem; display: grid; gap: 0.5rem; flex: 1; align-content: start; overflow: auto; }
.total-line { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-3); }
.total-line strong { color: var(--text-1); font-variant-numeric: tabular-nums; }
.total-line.discount strong { color: var(--accent-amber); }
.total-big {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem;
  padding-top: 0.75rem; margin-top: 0.25rem; border-top: 1px solid var(--border-1);
}
.total-big span { font-size: 0.78rem; color: var(--text-3); font-weight: 600; }
.total-big strong { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.35rem; margin-top: 0.35rem; }
.pay-btn {
  padding: 0.6rem 0.4rem; border-radius: var(--radius-md);
  border: 1px solid var(--border-1); background: var(--bg-2); color: var(--text-2);
  font-size: 0.8rem; text-align: center; transition: all var(--transition); font-weight: 500;
}
.pay-btn:hover { border-color: var(--primary); color: var(--text-1); }
.pay-btn.on { background: var(--primary); border-color: var(--primary); color: var(--bg-1); font-weight: 600; }

.pdv-actions { padding: 0.85rem 1.1rem 1.1rem; display: grid; gap: 0.5rem; border-top: 1px solid var(--border-1); }
.pdv-actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.btn-finish {
  padding: 0.9rem 1rem; font-size: 1rem; font-weight: 600; border-radius: var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center;
}
.btn-finish small { font-size: 0.68rem; opacity: 0.7; font-weight: 500; display: block; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.keypad button {
  padding: 0.85rem 0; font-size: 1.05rem; font-weight: 600;
  border-radius: var(--radius-md); background: var(--bg-2);
  border: 1px solid var(--border-1); font-variant-numeric: tabular-nums;
  transition: all var(--transition);
}
.keypad button:hover { background: var(--bg-3); }
.keypad-display {
  background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-lg);
  padding: 0.85rem 1rem; text-align: right;
  font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
.keypad-display small { display: block; font-size: 0.72rem; color: var(--text-3); font-weight: 500; letter-spacing: 0; }

.cam-wrap { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #000; aspect-ratio: 4/3; }
.cam-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-target { position: absolute; inset: 22% 12%; border: 2px solid #fff; border-radius: var(--radius-md); box-shadow: 0 0 0 2000px rgba(0,0,0,0.42); }

/* =========================================================
   COMPROVANTE (impressão térmica)
   ========================================================= */
.print-root { display: none; }
.receipt {
  background: #fff; color: #000;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 12px; line-height: 1.42; padding: 6mm 4mm; width: 80mm;
}
.receipt.w58 { width: 58mm; font-size: 11px; }
.receipt h1 { font-size: 15px; margin: 0 0 2px; text-align: center; text-transform: uppercase; }
.receipt .sub { text-align: center; font-size: 10px; margin-bottom: 6px; }
.receipt hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
.receipt table { width: 100%; font-size: 11px; border-collapse: collapse; color: #000; }
.receipt table td { padding: 1px 0; border: none; vertical-align: top; color: #000; }
.receipt .r { text-align: right; }
.receipt .tot { font-size: 15px; font-weight: bold; }
.receipt .foot { text-align: center; font-size: 10px; margin-top: 8px; }

@media print {
  body > * { display: none !important; }
  .print-root { display: block !important; }
  .print-root .receipt { width: auto; padding: 0; }
  @page { margin: 3mm; }
}

.receipt-preview {
  background: #fff; border-radius: var(--radius-md); padding: 4px;
  display: flex; justify-content: center; max-height: 52vh; overflow: auto;
}

/* ===== Responsivo (mesma quebra do Nexo) ===== */
@media (max-width: 1080px) {
  .pdv { grid-template-columns: 1fr 320px; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "header" "main"; }
  .sidebar {
    position: fixed; top: 0; left: -100%;
    width: 260px; height: 100dvh;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 50; transition: left var(--transition-slow);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { left: 0; }
  .mobile-toggle { display: flex; }
  .header { padding: 0 1rem; }
  .main > .page { padding: 1.25rem 1rem 3rem; }
  .page-title { font-size: 1.25rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pdv { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .pdv-left { border-right: none; }
  .pdv-right { border-top: 1px solid var(--border-1); max-height: 54vh; }
}

/* ===== Ícone do leitor ===== */
:root {
  --i-scan: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2'/%3E%3Cpath d='M7 8v8M10.5 8v8M14 8v8M17 8v8'/%3E%3C/svg%3E");
}

/* ===== Disponíveis — o que dá para oferecer no balcão ===== */
.disp-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.disp-card {
  display: flex; align-items: center; gap: 0.8rem;
  background: var(--bg-1); border: 1px solid var(--border-1); border-radius: var(--radius-lg);
  padding: 0.8rem 0.95rem;
}
.disp-card.disp-off { opacity: 0.55; }
.disp-foto { width: 52px; height: 52px; flex: none; border-radius: var(--radius-md); object-fit: cover; background: var(--bg-2); }
.disp-corpo { flex: 1; min-width: 0; }
.disp-nome { font-weight: 600; font-size: 0.95rem; line-height: 1.25; }
.disp-preco { color: var(--text-3); font-size: 0.8rem; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.disp-qtd { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.disp-num { font-size: 1.9rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.disp-un { font-size: 0.72rem; color: var(--text-3); margin-top: 0.2rem; }
.disp-esgotado { font-size: 0.78rem; font-weight: 700; color: var(--accent-red); text-transform: uppercase; letter-spacing: 0.04em; }
.disp-res { font-size: 0.7rem; color: var(--accent-amber); margin-top: 0.3rem; white-space: nowrap; }
.disp-soltos { display: flex; flex-wrap: wrap; gap: 6px; }
.disp-solto { background: var(--bg-1); border: 1px solid var(--border-1); border-radius: 999px; padding: 4px 11px; font-size: 0.8rem; }

/* ===== Contador no menu (pós-venda do dia) ===== */
.si-conta {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--accent-amber); color: #fff;
  font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
/* display fixo passaria por cima do atributo hidden */
.si-conta[hidden] { display: none; }

/* O mapa (Leaflet) numera as camadas dele de 400 a 1000. Sem isolar, essas camadas
   passavam por cima das janelas do painel (z-index 100): em Entregas ao vivo o mapa
   cobria "Textos e raio dos avisos" e o dono nao via os campos. */
.leaflet-container { isolation: isolate; }

/* a galeria do produto no cadastro: fotos extras e o video curto */
.midia-lista { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.midia-item { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.midia-item img, .midia-item video { width: 78px; height: 60px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--bd); background: var(--bg-2); }

/* versão nova no servidor: aviso que recarrega num toque (25/09/2026) */
.aviso-versao { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9999;
  background: var(--accent-amber); color: #fff; border: 0; border-radius: 999px; padding: 10px 18px;
  font-weight: 700; font-size: 0.85rem; box-shadow: 0 8px 24px rgba(0,0,0,0.18); cursor: pointer; }
/* o gerenciador de reserva na lista de produtos */
.enc-toggle.on { background: var(--accent-amber); border-color: var(--accent-amber); color: #fff; }
.loja-online { border-top: 1px solid var(--border-1); margin-top: 0.4rem; padding-top: 0.4rem; }

/* as abas do cadastro do produto: "Cadastro" e "Loja online" (25/09/2026) */
.form-abas { display: flex; gap: 6px; margin: -4px 0 14px; border-bottom: 1px solid var(--border-1);
  position: sticky; top: -1px; background: var(--bg-1); z-index: 2; padding-top: 4px; }
.form-aba { border: 0; background: none; padding: 9px 12px; border-bottom: 2px solid transparent;
  color: var(--text-3); font-weight: 600; font-size: 0.86rem; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 1px; }
.form-aba small { font-weight: 500; font-size: 0.68rem; color: var(--text-4); }
.form-aba.on { color: var(--text-1); border-bottom-color: var(--accent-amber); }
[data-painel][hidden] { display: none !important; }

/* os botoes da loja ficam embaixo do nome: na coluna de acoes, no celular, eles
   ficavam fora da tela (tabela de 897 px numa tela de 337) */
.prod-loja { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* serve até quantas pessoas: os bonequinhos do cadastro (pedido do dono em 24/09/2026) */
.serve-escolha { background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-md);
  padding: 0.7rem 0.8rem; margin: 0 0 0.8rem; }
.serve-cabeca { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.serve-num { font-size: 0.8rem; font-weight: 600; color: var(--accent-amber, #d97706); }
.serve-bonecos { display: flex; flex-wrap: wrap; gap: 2px; margin: 0.5rem 0; align-items: center; }
.serve-bonecos button { border: 0; background: none; padding: 3px; cursor: pointer; color: var(--text-4);
  border-radius: 8px; line-height: 0; transition: color 0.15s, transform 0.15s; }
.serve-bonecos button svg { width: 22px; height: 22px; }
.serve-bonecos button.on { color: var(--accent-amber, #d97706); }
@media (hover: hover) {
  .serve-bonecos:hover button[data-serve] { color: #f5b565; }
  .serve-bonecos button[data-serve]:hover ~ button[data-serve] { color: var(--text-4); }
  .serve-bonecos button:hover { transform: translateY(-2px); }
}
.serve-bonecos button.pula { animation: serveEscolhe 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) calc(var(--i, 0) * 35ms) both; }
@keyframes serveEscolhe { 0% { transform: scale(0.6) translateY(4px); } 60% { transform: scale(1.25) translateY(-4px); }
  100% { transform: none; } }
.serve-mais { font-weight: 700; font-size: 0.85rem; color: var(--accent-amber, #d97706); margin-left: 4px; }
.serve-acoes { display: flex; gap: 0.4rem; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .serve-bonecos button.pula { animation: none; } }

/* Gravação em andamento: faixa fina no topo e botões "apagados" (o clique é barrado em api.js). */
body.gravando::before {
  content: ""; position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 9999;
  background: linear-gradient(90deg, transparent, var(--accent-amber, #d4a017), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: gravando-faixa 1s linear infinite;
}
body.gravando .modal-foot .btn, body.gravando .page-actions .btn { opacity: .55; cursor: progress; }
@keyframes gravando-faixa { from { background-position: -40% 0; } to { background-position: 140% 0; } }
