/* WPDV — design system "Noite de bar": escuro, quente, WhatsApp-first */
:root {
  --bg: #0b0f14; --bg2: #0f151c; --surface: #131a23; --surface2: #1a232e; --border: #223040; --border2: #2d3d50;
  --text: #e8eef4; --muted: #8b9bab; --dim: #5d6c7b;
  --wa: #25d366; --wa2: #128c7e; --amber: #f5a524; --red: #f04452; --blue: #4c8dff; --purple: #a78bfa; --pink: #f472b6;
  --ok: var(--wa); --warn: var(--amber); --err: var(--red);
  --r: 14px; --r2: 10px; --r3: 22px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 232px; --rail: 68px; --topbar: 60px; --feed: 340px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f5f8; --bg2: #eaeef3; --surface: #ffffff; --surface2: #f6f8fb; --border: #dfe5ec; --border2: #c9d3de;
  --text: #0f1720; --muted: #55657a; --dim: #8b98a8; --shadow: 0 10px 30px rgba(15,23,32,.08); color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.has-modal { overflow: hidden; }
a { color: var(--wa); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 8px; }
small, .hint { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.right { text-align: right; } .center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .row.start { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.gap4 { gap: 4px } .gap6 { gap: 6px } .gap16 { gap: 16px } .gap20 { gap: 20px }
.mt8 { margin-top: 8px } .mt12 { margin-top: 12px } .mt16 { margin-top: 16px } .mt24 { margin-top: 24px } .mb8 { margin-bottom: 8px } .mb12 { margin-bottom: 12px } .mb16 { margin-bottom: 16px }
.hide { display: none !important; }
::selection { background: rgba(37,211,102,.3); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; grid-template-rows: var(--topbar) 1fr; min-height: 100vh; }
.app.feed-open { grid-template-columns: var(--sidebar) 1fr var(--feed); }
.sidebar { grid-row: 1 / 3; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 14px 12px; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; color: var(--text); border-radius: 12px; transition: .15s; }
a.brand:hover .logo { transform: translateY(-1px) scale(1.04); box-shadow: 0 8px 22px rgba(37,211,102,.5); }
a.brand.active .logo { box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px var(--wa); }
.brand .logo { transition: .15s; }
.logo .mark { width: 62%; height: 62%; display: block; }
.logo.mini { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--wa), var(--wa2)); display: grid; place-items: center; }
.brand .logo { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, var(--wa), var(--wa2)); display: grid; place-items: center; font-size: 18px; box-shadow: 0 6px 18px rgba(37,211,102,.35); }
.brand b { display: block; font-size: 15px; } .brand small { display: block; margin-top: -2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: .15s; position: relative; }
.nav a .ic { width: 22px; text-align: center; font-size: 16px; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border2); }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--wa); }
.nav a .nk { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--dim); border: 1px solid var(--border); padding: 0 5px; border-radius: 5px; opacity: 0; transition: .15s; }
.nav a:hover .nk, .nav a.active .nk { opacity: 1; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.help-grid h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.help-list > * { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--text); font-size: 13px; }
.help-list a:hover { background: var(--surface2); }
.help-list .kbd { min-width: 34px; text-align: center; white-space: nowrap; }
.help-list .ic { width: 20px; text-align: center; }
@media (max-width: 720px) { .help-grid { grid-template-columns: 1fr; } }
.nav a .cnt { margin-left: auto; background: var(--wa); color: #06281a; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.nav a .cnt.warn { background: var(--amber); color: #2b1a00; } .nav a .cnt.err { background: var(--red); color: #fff; }
.nav .sep { height: 1px; background: var(--border); margin: 8px 6px; }
.sidebar .foot { margin-top: auto; padding: 10px 8px 0; font-size: 12px; color: var(--dim); }
.sidebar .foot .who { margin-bottom: 8px; } .sidebar .foot .who .avatar { width: 30px; height: 30px; font-size: 14px; }
.rail-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 6px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border2); background: transparent; color: var(--dim); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s; }
.rail-btn:hover { color: var(--text); background: var(--surface); border-style: solid; }
.rail-btn .ic { width: 22px; text-align: center; font-size: 14px; }
/* Menu recolhido (rail): só ícones; passar o mouse expande o menu sobre o conteúdo */
.app.rail { grid-template-columns: var(--rail) 1fr; }
.app.rail.feed-open { grid-template-columns: var(--rail) 1fr var(--feed); }
.app.rail .topbar .lbl { display: none !important; }
.app.rail .sidebar { width: var(--rail); padding: 14px 10px; transition: width .14s ease, padding .14s ease, box-shadow .14s ease; }
.app.rail .sidebar:not(:hover) .txt, .app.rail .sidebar:not(:hover) .lbl, .app.rail .sidebar:not(:hover) .nav a .nk { display: none !important; }
.app.rail .sidebar:not(:hover) .brand { flex-direction: column; padding: 4px 0 12px; justify-content: center; }
.app.rail .sidebar:not(:hover) .nav a { justify-content: center; padding: 10px 0; }
.app.rail .sidebar:not(:hover) .nav a .ic { width: auto; font-size: 18px; }
.app.rail .sidebar:not(:hover) .nav a .cnt { position: absolute; top: 3px; right: 3px; margin: 0; font-size: 9.5px; padding: 0 4px; min-width: 15px; text-align: center; line-height: 15px; }
.app.rail .sidebar:not(:hover) .nav a.active::before { left: -10px; }
.app.rail .sidebar:not(:hover) .rail-btn { justify-content: center; padding: 8px 0; }
.app.rail .sidebar:not(:hover) .foot { padding: 10px 0 0; }
.app.rail .sidebar:not(:hover) .foot .who { flex-direction: column; gap: 6px; }
.app.rail .sidebar:not(:hover) .foot .who .btn { padding: 0 6px; }
/* Expandido no hover: flutua sobre o conteúdo, sem empurrar a página */
@media (hover: hover) {
  .app.rail .sidebar:hover { position: fixed; left: 0; top: 0; width: var(--sidebar); padding: 14px 12px; z-index: 80; box-shadow: var(--shadow); }
}
.topbar { grid-column: 2 / -1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.cmd { flex: 1; max-width: 640px; position: relative; }
.cmd input { width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 40px 0 40px; font: inherit; font-size: 14px; outline: none; transition: .15s; }
.cmd input:focus { border-color: var(--wa); box-shadow: 0 0 0 3px rgba(37,211,102,.15); }
.cmd .k { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; }
.cmd .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--dim); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-family: var(--mono); }
.cmd-sugg { position: absolute; top: 46px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 50; }
.cmd-sugg div { padding: 9px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.cmd-sugg div:hover, .cmd-sugg div.sel { background: var(--surface2); }
.cmd-sugg small { margin-left: auto; }
.main { grid-column: 2; padding: 22px 24px 90px; min-width: 0; max-width: 100vw; overflow-x: hidden; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.feed { grid-column: 3; grid-row: 1 / 3; border-left: 1px solid var(--border); background: var(--bg2); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.feed .fh { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.feed .fl { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 92%; padding: 9px 12px; border-radius: 14px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; background: var(--surface); border: 1px solid var(--border); position: relative; }
.bubble.out { align-self: flex-end; background: #0f3d2a; border-color: #17573c; border-bottom-right-radius: 4px; }
[data-theme="light"] .bubble.out { background: #d9fdd3; border-color: #b8e8b0; }
.bubble.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble .meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 11px; color: var(--muted); }
.bubble .meta b { color: var(--text); }
.bubble a.open { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; }

/* ---------- Componentes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border2); background: var(--surface2); color: var(--text); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--wa); border-color: var(--wa); color: #05261a; }
.btn.primary:hover { background: #33e076; }
.btn.wa { background: #0f3d2a; border-color: #1c6a48; color: #7ef0ad; }
.btn.wa:hover { background: #145236; }
[data-theme="light"] .btn.wa { background: #e6f9ec; border-color: #9ad9ad; color: #0d6b3a; }
.btn.amber { background: rgba(245,165,36,.15); border-color: rgba(245,165,36,.5); color: var(--amber); }
.btn.danger { background: rgba(240,68,82,.12); border-color: rgba(240,68,82,.5); color: #ff7b85; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--text); background: var(--surface); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 11px; border-radius: 7px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.card.pad0 { padding: 0; overflow: hidden; }
.card .ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; position: relative; overflow: hidden; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .l { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .d { font-size: 12px; margin-top: 4px; color: var(--muted); }
.stat.accent::after { content: ''; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(37,211,102,.25), transparent 70%); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .02em; border: 1px solid transparent; }
.badge.ok { background: rgba(37,211,102,.14); color: #5ee592; border-color: rgba(37,211,102,.35); }
.badge.warn { background: rgba(245,165,36,.14); color: var(--amber); border-color: rgba(245,165,36,.35); }
.badge.err { background: rgba(240,68,82,.14); color: #ff7b85; border-color: rgba(240,68,82,.35); }
.badge.info { background: rgba(76,141,255,.14); color: #86b3ff; border-color: rgba(76,141,255,.35); }
.badge.purple { background: rgba(167,139,250,.14); color: #c4b5fd; border-color: rgba(167,139,250,.35); }
.badge.dim { background: var(--surface2); color: var(--muted); border-color: var(--border); }
.badge.plat { color: #fff; }
.pill-tabs { display: inline-flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 12px; border: 1px solid var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.pill-tabs::-webkit-scrollbar { display: none; }
.pill-tabs button { white-space: nowrap; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.pill-tabs button.active { background: var(--surface2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field .lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
input, select, textarea { width: 100%; background: var(--bg2); border: 1px solid var(--border2); color: var(--text); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 14px; outline: none; transition: .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--wa); box-shadow: 0 0 0 3px rgba(37,211,102,.15); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: auto; }
/* Validação de formulários: campo inválido, mensagem inline e marcador de obrigatório */
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); box-shadow: 0 0 0 3px rgba(240,68,82,.15); }
.field-err { color: var(--red); font-size: 11.5px; line-height: 1.3; }
.req { color: var(--red); margin-left: 3px; font-weight: 700; }
.form-legend { color: var(--muted); font-size: 11.5px; margin-right: auto; align-self: center; white-space: nowrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 40px; height: 22px; background: var(--border2); border-radius: 99px; position: relative; transition: .2s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .track { background: var(--wa); } .switch input:checked + .track::after { left: 21px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface2); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border2); border-radius: var(--r); }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, var(--surface2), var(--border2)); color: var(--text); flex-shrink: 0; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--border2); border-bottom-width: 2px; padding: 1px 6px; border-radius: 6px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 11px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--border); font-size: 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.chip.active, .chip:hover { border-color: var(--wa); color: var(--text); }
.progress { height: 8px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--wa); border-radius: 99px; transition: width .4s; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.callout { border-left: 3px solid var(--wa); background: rgba(37,211,102,.06); padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 13px; }
.callout.warn { border-color: var(--amber); background: rgba(245,165,36,.07); }
.callout.info { border-color: var(--blue); background: rgba(76,141,255,.07); }
.callout.err { border-color: var(--red); background: rgba(240,68,82,.07); }
.callout.ok { border-color: var(--wa); background: rgba(37,211,102,.08); }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline .ti { position: relative; padding: 4px 0 10px; font-size: 13px; }
.timeline .ti::before { content: ''; position: absolute; left: -17px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--wa); box-shadow: 0 0 0 3px var(--surface); }
.timeline .ti small { display: block; }

/* ---------- Toast & modal ---------- */
#toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--surface); border: 1px solid var(--border2); color: var(--text); padding: 11px 14px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; opacity: 0; transform: translateY(10px); transition: .25s; max-width: 380px; border-left-width: 3px; }
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-left-color: var(--wa); } .toast-warn { border-left-color: var(--amber); } .toast-err { border-left-color: var(--red); } .toast-wa { border-left-color: var(--wa); background: #0f3d2a; }
.toast-link { margin-left: 8px; font-weight: 700; }
.modal-wrap { position: fixed; inset: 0; background: rgba(4,8,12,.65); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 12px; animation: fade .15s; overflow: hidden; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--r3); width: min(560px, 100%); max-width: calc(100vw - 24px); min-width: 0; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.lg { width: min(860px, 100%); } .modal.xl { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; overflow-y: auto; overflow-x: hidden; min-width: 0; }
.modal-body .card.pad0, .modal-body table { max-width: 100%; }
.modal-body .card.pad0 { overflow-x: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Mapa de mesas ---------- */
.floor { display: flex; flex-direction: column; gap: 22px; }
.sector { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r3); padding: 16px 18px 18px; position: relative; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px; }
.sector .sh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sector .sh h3 { display: flex; gap: 8px; align-items: center; }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tbl { --c: var(--dim); background: var(--surface2); border: 1px solid var(--border2); border-radius: 18px; padding: 12px 12px 10px; cursor: pointer; position: relative; transition: .18s; min-height: 118px; display: flex; flex-direction: column; box-shadow: inset 0 0 0 0 var(--c); user-select: none; }
.tbl:hover { transform: translateY(-2px); border-color: var(--c); box-shadow: 0 8px 22px rgba(0,0,0,.3), inset 0 0 0 1px var(--c); }
.tbl.livre { --c: var(--wa); } .tbl.ocupada { --c: var(--amber); } .tbl.conta { --c: var(--blue); } .tbl.reservada { --c: var(--purple); } .tbl.limpeza { --c: var(--red); }
.tbl .num { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.tbl .shape { position: absolute; right: 12px; top: 12px; width: 26px; height: 26px; border: 2px solid var(--c); border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--c); }
.tbl.retangular .shape { border-radius: 6px; }
.tbl .st { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--c); text-transform: uppercase; letter-spacing: .05em; }
.tbl .st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.tbl.ocupada .st::before { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 10%, transparent); } }
.tbl .info { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.tbl .info b.total { width: 100%; text-align: right; font-size: 13px; color: var(--text); }
.tbl .info b { color: var(--text); font-family: var(--mono); font-size: 12px; }
.tbl .alert { margin-top: 6px; font-size: 11px; color: var(--amber); font-weight: 700; line-height: 1.2; }
.tbl.hot { animation: hot 2s infinite; }
@keyframes hot { 0%, 100% { border-color: var(--border2); } 50% { border-color: var(--amber); } }
/* Mapa livre (componente floormap.js): cartões absolutos, arrastáveis no modo edição */
.fm-wrap { overflow-x: auto; overflow-y: visible; margin: 0 -6px; padding: 0 6px 4px; }
.floor-map { --tw: 150px; position: relative; min-height: 72px; transition: min-height .15s; border-radius: 12px; }
.floor-map.edit { outline: 1px dashed var(--border2); outline-offset: 6px; }
.floor-map.over { outline: 2px dashed var(--wa); background: color-mix(in srgb, var(--wa) 6%, transparent); }
.floor-map .empty { padding: 22px; text-align: center; }
.fm-item { position: absolute; width: var(--tw); }
.fm-item > .tbl { height: 100%; }
.fm-item.dim { opacity: .22; pointer-events: none; }
.floor-map.edit .fm-item { touch-action: none; cursor: grab; }
.floor-map.edit .fm-item > .tbl { cursor: grab; }
.floor-map.edit .fm-item > .tbl::after { content: '⠿'; position: absolute; left: 8px; bottom: 6px; font-size: 12px; color: var(--muted); opacity: .6; }
.fm-item.dragging { z-index: 20; cursor: grabbing; }
.fm-item.dragging > .tbl { transform: scale(1.04) rotate(-1deg); box-shadow: 0 16px 36px rgba(0,0,0,.45), inset 0 0 0 1px var(--c); transition: none; cursor: grabbing; }
body.fm-dragging { user-select: none; -webkit-user-select: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--c); }

/* ---------- Comanda / KDS ---------- */
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.ticket { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.ticket .th { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px dashed var(--border2); background: var(--surface2); }
.ticket .th b { font-size: 16px; }
.ticket .tl { padding: 8px 6px; }
.line { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; }
.line:hover { background: var(--surface2); }
.line .q { font-family: var(--mono); font-weight: 700; min-width: 28px; color: var(--amber); }
.line .n { flex: 1; } .line .n small { display: block; color: var(--amber); }
.line.novo .q { color: var(--red); } .line.preparo .q { color: var(--amber); } .line.pronto .q { color: var(--wa); } .line.entregue { opacity: .45; } .line.entregue .n { text-decoration: line-through; }
.line .act { display: flex; gap: 4px; }
.ticket.late .th { background: rgba(240,68,82,.15); }
.ticket .tf { padding: 8px 14px; border-top: 1px solid var(--border); display: flex; gap: 6px; flex-wrap: wrap; }
.menu-pick { display: grid; grid-template-columns: 200px 1fr 300px; gap: 14px; min-height: 420px; }
.menu-pick .cats { display: flex; flex-direction: column; gap: 4px; }
.menu-pick .cats button { text-align: left; border: 1px solid transparent; background: transparent; color: var(--muted); padding: 9px 12px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 600; }
.menu-pick .cats button.active { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.menu-pick .items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
.mi { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; cursor: pointer; transition: .15s; }
.mi:hover { border-color: var(--wa); transform: translateY(-1px); }
.mi .e { font-size: 22px; } .mi .n { font-weight: 600; font-size: 13px; margin-top: 4px; line-height: 1.25; } .mi .p { color: var(--wa); font-weight: 700; margin-top: 4px; font-size: 13px; }
.mi.off { opacity: .4; pointer-events: none; }
.cart { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.cart .cl { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.cart .ci { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--surface); }
.cart .ci input { padding: 4px 8px; font-size: 12px; border-radius: 6px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border2); border-radius: 8px; overflow: hidden; }
.qty button { width: 26px; height: 26px; border: 0; background: var(--surface2); color: var(--text); cursor: pointer; font-weight: 700; }
.qty span { min-width: 26px; text-align: center; font-family: var(--mono); font-size: 12px; }

/* ---------- Delivery ---------- */
.plat { border-top: 3px solid var(--pc); }
.plat .logo { display: grid; place-items: center; }
.plogo, .pmark { display: inline-block; vertical-align: middle; flex: none; }
.pmark { border-radius: 25%; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.plogo { box-shadow: 0 2px 8px rgba(0,0,0,.25); border-radius: 10px; }
.dcard .dt b, .badge.plat, .ticket .th b { display: inline-flex; align-items: center; gap: 5px; }
.dcol { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; }
.dcol .dh { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 4px 10px; }
.dcol .dh .cnt { background: var(--surface2); padding: 1px 8px; border-radius: 99px; }
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 10px; border-left: 3px solid var(--pc); }
.dcard .dt { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dcard .items { font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.dcard .items div { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bars .b { flex: 1; background: linear-gradient(180deg, var(--wa), var(--wa2)); border-radius: 6px 6px 2px 2px; position: relative; min-height: 2px; transition: height .4s; }
.bars .b:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--surface2); border: 1px solid var(--border2); padding: 3px 7px; border-radius: 6px; font-size: 11px; white-space: nowrap; margin-bottom: 4px; }
.bars-x { display: flex; gap: 6px; margin-top: 6px; } .bars-x span { flex: 1; text-align: center; font-size: 10px; color: var(--dim); font-family: var(--mono); }
.hbar { display: grid; grid-template-columns: 1fr 100px; gap: 6px 10px; align-items: center; font-size: 13px; }
.hbar .t { display: flex; justify-content: space-between; }
.hbar i { display: block; height: 8px; border-radius: 99px; background: var(--amber); }

/* ---------- Cardápio público (cliente) ---------- */
body.pub-body { background: var(--bg2); }
.pub { --pubw: 560px; max-width: var(--pubw); margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 110px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.pub .hero { padding: 26px 20px 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--wa) 22%, var(--bg)), var(--bg) 70%); border-bottom: 1px solid var(--border); }
.pub .hero h1 { font-size: 24px; }
.pub .hero p { font-size: 13px; }
.pub .cats { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); scrollbar-width: none; scroll-snap-type: x proximity; }
.pub .cats::-webkit-scrollbar { display: none; }
.pub .cats .chip { flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; font-size: 13px; line-height: 1; scroll-snap-align: start; }
.pub section { padding: 12px 16px 4px; }
.pub section h2 { padding: 10px 0 4px; font-size: 19px; scroll-margin-top: 60px; }
.pub .pi { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.pub .pi .e { width: 56px; height: 56px; border-radius: 14px; background: var(--surface2); display: grid; place-items: center; font-size: 26px; flex-shrink: 0; }
.pub .pi .n { font-weight: 700; font-size: 15px; } .pub .pi .d { font-size: 12px; color: var(--muted); margin-top: 2px; } .pub .pi .p { font-weight: 800; color: var(--wa); margin-top: 4px; font-size: 15px; }
.pub .pi .al { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.pub .pi .al span { font-size: 10px; background: var(--surface2); border: 1px solid var(--border2); padding: 1px 6px; border-radius: 99px; color: var(--muted); }
.pub .pi > .btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; font-size: 18px; flex-shrink: 0; }
.pub .pi .qty { flex-shrink: 0; } .pub .pi .qty button { width: 34px; height: 34px; font-size: 16px; } .pub .pi .qty span { min-width: 30px; font-size: 14px; }
.pub .fab { position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); display: flex; gap: 8px; max-width: var(--pubw); margin: 0 auto; }
.pub.a11y-big { font-size: 18px; } .pub.a11y-big .pi .n { font-size: 20px; } .pub.a11y-big .pi .p { font-size: 18px; } .pub.a11y-big .cats .chip { font-size: 16px; }
.pub.a11y-contrast { --bg: #000; --bg2: #000; --surface: #000; --surface2: #111; --text: #fff; --muted: #ffd; --border: #666; --wa: #7cff9d; }
.wa-big { background: var(--wa); color: #05261a; height: 52px; border-radius: 16px; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; border: 0; cursor: pointer; font-family: inherit; box-shadow: 0 8px 24px rgba(37,211,102,.35); }
.wa-big:disabled { opacity: .5; box-shadow: none; }
/* Desktop: coluna mais larga e itens em duas colunas */
@media (min-width: 960px) {
  .pub { --pubw: 880px; }
  .pub .hero { padding: 34px 28px 22px; } .pub .hero h1 { font-size: 30px; }
  .pub .cats, .pub section { padding-left: 28px; padding-right: 28px; }
  .pub section .items { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .pub .fab { padding-left: 28px; padding-right: 28px; }
}
@media (max-width: 600px) { .pub { border-left: 0; border-right: 0; } }

/* ---------- Recibo / impressão ---------- */
.receipt { font-family: var(--mono); font-size: 12px; background: #fff; color: #000; padding: 16px; border-radius: 8px; max-width: 320px; margin: 0 auto; white-space: pre-wrap; }

/* ---------- Mobile ---------- */
.mobile-nav { display: none; }
@media (max-width: 1100px) { .app.feed-open { grid-template-columns: var(--sidebar) 1fr; } .feed { position: fixed; right: 0; top: 0; width: min(360px, 100%); z-index: 60; box-shadow: var(--shadow); } .dcol { grid-template-columns: repeat(2, 1fr); } .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .app, .app.rail, .app.feed-open, .app.rail.feed-open { grid-template-columns: 1fr; } .sidebar { display: none; } .topbar, .main { grid-column: 1; } .main { padding: 16px 14px 100px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .dcol { grid-template-columns: 1fr; } .menu-pick { grid-template-columns: 1fr; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg2); border-top: 1px solid var(--border); z-index: 40; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); padding: 4px 8px; border-radius: 10px; }
  .mobile-nav a.active { color: var(--wa); } .mobile-nav a .ic { font-size: 20px; }
  .cmd .kbd { display: none; } .cmd { max-width: none; } .cmd input { padding-right: 12px; font-size: 13px; }
  .topbar { padding: 0 12px; gap: 8px; } .topbar .grow { display: none; }
  #feedBtn { padding: 0 10px; } #feedBtn .lbl { display: none; }
  .page-head { margin-bottom: 14px; } .page-head h1 { font-size: 21px; }
  .stat .v { font-size: 22px; }
  .modal { border-radius: 18px; max-height: 94vh; } .modal-body { padding: 14px; } .modal-head, .modal-foot { padding: 12px 14px; } .modal-foot { flex-wrap: wrap; } .modal-foot .btn { flex: 1; } .modal-foot .form-legend { flex-basis: 100%; margin: 0 0 2px; }
  .kds { grid-template-columns: 1fr; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .table { font-size: 12px; } .table th, .table td { padding: 8px 8px; } .card.pad0 { overflow-x: auto; }
  .tables-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .floor-map { --tw: 136px; }
  .menu-pick .cats { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; } .menu-pick .cats button { white-space: nowrap; }
  .menu-pick .items { grid-template-columns: repeat(3, 1fr); max-height: 240px; overflow-y: auto; }
  .main .row { flex-wrap: wrap; } .main .row > * { min-width: 0; } .main .card { min-width: 0; max-width: 100%; }
  .page-head .row .pill-tabs { max-width: 100%; }
  .bubble { max-width: 100%; }
  .main .row > .row { flex-basis: 100%; padding-left: 46px; }
}

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(600px 400px at 50% 0%, rgba(37,211,102,.14), transparent 70%), var(--bg); }
.login-stack { width: min(420px, 100%); display: grid; gap: 12px; }
.login-card { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r3); padding: 24px; box-shadow: var(--shadow); }
.login-site { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; }
.login-site small { display: block; font-size: 12px; margin-top: 2px; }
.login-site .btn { flex: none; }
.ops { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.op { background: var(--surface2); border: 1px solid var(--border2); border-radius: 16px; padding: 16px 10px; color: var(--text); cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: .15s; }
.op:hover { border-color: var(--wa); transform: translateY(-2px); } .op .e { font-size: 30px; } .op small { color: var(--muted); }
.pin { display: flex; justify-content: center; gap: 14px; margin: 6px 0 18px; } .pin i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border2); } .pin i.on { background: var(--wa); border-color: var(--wa); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .pad button { height: 54px; border-radius: 14px; border: 1px solid var(--border2); background: var(--surface2); color: var(--text); font: inherit; font-size: 20px; font-weight: 600; cursor: pointer; }
.pad button:active { background: var(--border2); } .pad button.ok { background: var(--wa); color: #05261a; border-color: var(--wa); }
.mobile-only { display: none !important; }
@media (max-width: 820px) { .mobile-only { display: inline-grid !important; } }

/* NFC-e / homologação */
.homolog { background: repeating-linear-gradient(45deg, rgba(245,165,36,.16) 0 10px, rgba(245,165,36,.05) 10px 20px); border: 1px solid rgba(245,165,36,.55); color: var(--amber); font-weight: 800; letter-spacing: .05em; text-align: center; padding: 7px 12px; border-radius: 9px; font-size: 12px; }
.fx-grid { grid-template-columns: 1.1fr 1fr; }
.fx-steps { display: flex; flex-direction: column; gap: 6px; }
.fx-step { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; opacity: .45; transition: .25s; font-size: 13px; }
.fx-step .st { width: 22px; height: 22px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface2); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.fx-step.run { opacity: 1; border-color: var(--blue); background: rgba(76,141,255,.07); }
.fx-step.done { opacity: 1; border-color: rgba(37,211,102,.45); } .fx-step.done .st { background: var(--wa); color: #06210f; }
.fx-step.err { opacity: 1; border-color: var(--red); background: rgba(240,68,82,.07); } .fx-step.err .st { background: var(--red); color: #fff; }
.fx-step.off { opacity: .3; }
.fx-checks .row { display: grid; grid-template-columns: 18px 1fr; gap: 2px 8px; } .fx-checks .row small { grid-column: 2; text-align: left; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--border2); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.danfe { font-family: var(--mono); font-size: 11px; background: #fff; color: #000; padding: 14px; border-radius: 8px; max-width: 340px; margin: 0 auto; line-height: 1.35; }
.danfe table { width: 100%; border-collapse: collapse; } .danfe td, .danfe th { padding: 1px 2px; vertical-align: top; font-size: 10px; font-weight: 400; } .danfe th { font-weight: 700; }
.danfe .r { text-align: right; } .danfe .c { text-align: center; }
.danfe .tarja { border: 2px solid #000; text-align: center; font-weight: 700; padding: 4px; margin: 6px 0; }
.danfe .tarja.hom { background: #000; color: #fff; font-size: 12px; letter-spacing: .04em; }
.danfe hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.danfe .chave { font-weight: 700; word-break: break-all; }
.danfe .qr { display: flex; justify-content: center; margin: 8px 0; } .danfe .qr img, .danfe .qr canvas { image-rendering: pixelated; }
.xmlview { font-family: var(--mono); font-size: 11px; white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; max-height: 60vh; overflow: auto; margin: 0; }
@media (max-width: 760px) { .fx-grid { grid-template-columns: 1fr; } }

/* ---------- Operação do dia (painel ao vivo) ---------- */
.opsd { position: relative; }
.ops-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ops-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--wa); text-transform: uppercase; letter-spacing: .08em; }
.live i { --c: var(--wa); width: 8px; height: 8px; border-radius: 50%; background: var(--wa); box-shadow: 0 0 0 3px rgba(37,211,102,.25); animation: pulse 1.6s infinite; }
.ops-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ops-clock { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; text-align: right; }
.ops-clock small { display: block; font-size: 11px; color: var(--dim); margin-top: 5px; font-family: var(--font); }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 13px 14px 12px; position: relative; overflow: hidden; min-height: 112px; display: flex; flex-direction: column; cursor: pointer; transition: .15s; }
.kpi:hover { border-color: var(--border2); transform: translateY(-1px); }
.kpi .l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.kpi .l .badge { text-transform: none; letter-spacing: 0; font-size: 10px; padding: 0 6px; }
.kpi .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; line-height: 1.1; }
.kpi .d { font-size: 11.5px; color: var(--muted); margin-top: auto; padding-top: 6px; line-height: 1.35; }
.kpi .d u { text-decoration-style: dotted; cursor: pointer; }
.kpi .spark { position: absolute; right: 12px; top: 34px; width: 96px; height: 32px; }
.kpi.accent::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(37,211,102,.2), transparent 70%); pointer-events: none; }
.kpi.hot { border-color: rgba(240,68,82,.55); box-shadow: inset 0 0 0 1px rgba(240,68,82,.25); } .kpi.warm { border-color: rgba(245,165,36,.5); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 99px; }
.delta.up { color: #5ee592; background: rgba(37,211,102,.12); } .delta.down { color: #ff7b85; background: rgba(240,68,82,.12); } .delta.flat { color: var(--muted); background: var(--surface2); }
[data-theme="light"] .delta.up { color: #0d6b3a; } [data-theme="light"] .delta.down { color: #b3212d; }
.ops-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.ops-grid .card { min-width: 0; }
.sp3 { grid-column: span 3; } .sp4 { grid-column: span 4; } .sp6 { grid-column: span 6; } .sp8 { grid-column: span 8; } .sp12 { grid-column: span 12; }
.opsd .card .ch h3 { font-size: 14px; }
.opsd .card .ch .more { font-size: 12px; color: var(--muted); white-space: nowrap; } .opsd .card .ch .more:hover { color: var(--wa); }
.opsd .card .ch h4 { margin: 0; }
.legend2 { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend2 i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: -1px; }
.legend2 i.line { height: 2px; width: 14px; border-radius: 2px; vertical-align: 3px; }
.ritmo { width: 100%; height: auto; display: block; overflow: visible; }
.ritmo .grid line { stroke: var(--border); stroke-width: 1; }
.ritmo .yl { fill: var(--dim); font-size: 10px; font-family: var(--mono); }
.ritmo .xl { fill: var(--dim); font-size: 10.5px; font-family: var(--mono); } .ritmo .xl.now { fill: var(--text); font-weight: 700; }
.ritmo .bar { fill: var(--wa); opacity: .85; } .ritmo .bar.now { opacity: 1; }
.ritmo .avg { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ritmo .avgdot { fill: var(--surface); stroke: var(--blue); stroke-width: 2; }
.ritmo .lbl { fill: var(--text); font-size: 10.5px; font-weight: 700; font-family: var(--mono); }
.ritmo .hit { fill: transparent; } .ritmo .hit:hover { fill: rgba(128,160,190,.08); }
.ritmo .nowline { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ops-tip { position: absolute; z-index: 30; pointer-events: none; background: var(--surface2); border: 1px solid var(--border2); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); max-width: 240px; line-height: 1.35; color: var(--text); }
.ops-tip b { display: block; margin-bottom: 2px; }
.alerts { display: flex; flex-direction: column; gap: 6px; max-height: 292px; overflow: auto; padding-right: 2px; }
.alert { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); border-left-width: 3px; background: var(--surface2); font-size: 13px; }
.alert.crit { border-left-color: var(--red); } .alert.warn { border-left-color: var(--amber); } .alert.info { border-left-color: var(--blue); }
.alert .ic { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.alert .t { flex: 1; min-width: 0; } .alert .t span, .alert .t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .alert .t span { font-weight: 600; } .alert .t small { color: var(--muted); }
.sec-row { display: grid; grid-template-columns: 82px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sec-row:last-of-type { border-bottom: 0; }
.sec-row .bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface2); gap: 2px; }
.sec-row .bar i { display: block; height: 100%; background: var(--c); }
.sec-row .n { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; } .sec-row .n b { color: var(--text); }
.kds2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dtable { overflow-x: auto; margin: 0 -4px; } .dtable .table th, .dtable .table td { padding: 7px 8px; white-space: nowrap; }
.kds-box { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.kds-box h4 { margin-bottom: 8px; }
.kds-box .nums { display: flex; gap: 14px; font-family: var(--mono); font-size: 11px; }
.kds-box .nums b { display: block; font-size: 20px; letter-spacing: -.02em; line-height: 1.1; } .kds-box .nums span { color: var(--muted); }
.kds-box .nums .novo b { color: var(--red); } .kds-box .nums .preparo b { color: var(--amber); } .kds-box .nums .pronto b { color: var(--wa); }
.kds-box .wait { margin-top: 8px; font-size: 12px; color: var(--muted); } .kds-box .wait b { color: var(--text); font-family: var(--mono); } .kds-box .wait.late b { color: var(--red); }
.mini-list { display: flex; flex-direction: column; }
.mini-list .it { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.mini-list .it:last-child { border-bottom: 0; }
.mini-list .it .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .it .mono { font-size: 12px; }
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface2); margin: 4px 0 10px; }
.stack i { display: block; height: 100%; background: var(--c); min-width: 3px; }
.hbar2 { display: grid; grid-template-columns: 1fr; gap: 3px 10px; align-items: center; font-size: 12.5px; }
.hbar2 .t { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 5px; } .hbar2 .t > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar2 i { display: block; height: 6px; border-radius: 99px; background: var(--c, var(--wa)); min-width: 3px; }
.hbar2 .mono { font-size: 12px; }
.gauge { width: 64px; height: 64px; }
.gauge .bg { fill: none; stroke: var(--surface2); stroke-width: 7; } .gauge .fg { fill: none; stroke: var(--c); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .4s; }
.gauge text { fill: var(--text); font-size: 14px; font-weight: 800; font-family: var(--font); }
.kpi .gauge { position: absolute; right: 12px; top: 12px; }
.meta-bar { height: 8px; border-radius: 99px; background: var(--surface2); position: relative; margin-top: 8px; }
.meta-bar i { display: block; height: 100%; border-radius: 99px; background: var(--wa); }
.meta-bar b { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--amber); }
.agenda .it .when { font-family: var(--mono); font-weight: 700; min-width: 48px; }
.agenda .it.soon .when { color: var(--amber); } .agenda .it.late .when { color: var(--red); }
@media (max-width: 1300px) { .kpis { grid-template-columns: repeat(3, 1fr); } .sp3 { grid-column: span 6; } }
@media (max-width: 1100px) { .sp4, .sp8 { grid-column: span 12; } }
@media (max-width: 820px) { .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; } .sp3, .sp6 { grid-column: span 12; } .ops-clock { display: none; } .kpi .v { font-size: 20px; } .kpi .spark { width: 70px; } .ops-head .row { width: 100%; } .ops-head .col { flex: 1; } .kds2 { grid-template-columns: 1fr 1fr; } }
/* Hub de delivery — card "adicionar plataforma customizada" */
.add-plat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; border-style: dashed; cursor: pointer; color: var(--text); font: inherit; min-height: 180px; transition: .15s; }
.add-plat:hover { border-color: var(--wa); background: rgba(37,211,102,.05); }
.add-plat small { max-width: 300px; line-height: 1.4; }

/* ---------- Central de relatórios ---------- */
.rp { display: grid; grid-template-columns: 272px 1fr; gap: 18px; align-items: start; }
.rp-cat { position: sticky; top: calc(var(--topbar) + 14px); max-height: calc(100vh - var(--topbar) - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.rp-search { position: relative; display: flex; align-items: center; }
.rp-search > span { position: absolute; left: 10px; font-size: 13px; opacity: .7; pointer-events: none; }
.rp-search input { padding-left: 32px; height: 38px; border-radius: 10px; font-size: 13px; }
.rp-search .icon-btn { position: absolute; right: 4px; width: 28px; height: 28px; font-size: 12px; }
.rp-search.sm input { height: 32px; font-size: 12.5px; width: 220px; }
.rp-groups { display: flex; flex-direction: column; gap: 2px; }
.rp-g .rp-gh { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700; font-size: 12.5px; padding: 8px 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.rp-g .rp-gh:hover { background: var(--surface2); }
.rp-g .rp-gh .ic { width: 20px; text-align: center; } .rp-g .rp-gh .cnt { font-family: var(--mono); font-size: 10px; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); padding: 0 6px; border-radius: 99px; }
.rp-g .rp-gh .chev { color: var(--dim); transform: rotate(90deg); transition: .15s; font-size: 14px; }
.rp-g.col .rp-gh .chev { transform: none; } .rp-g.col .rp-gl { display: none; }
.rp-gl { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 6px; }
.rp-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; position: relative; }
.rp-item:hover { background: var(--surface2); color: var(--text); }
.rp-item.active { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border2); }
.rp-item.active::before { content: ''; position: absolute; left: -4px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--wa); }
.rp-item .ic { width: 20px; text-align: center; font-size: 14px; }
.rp-item .star { border: 0; background: transparent; color: var(--dim); cursor: pointer; font-size: 13px; padding: 0 2px; opacity: 0; transition: .15s; }
.rp-item:hover .star, .rp-item .star.on { opacity: 1; } .rp-item .star.on { color: var(--amber); }
.rp-main { min-width: 0; }
.rp-rh { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.rp-rh .crumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; } .rp-rh .crumb a { color: var(--muted); } .rp-rh .crumb a:hover { color: var(--wa); }
.rp-rh h2 { font-size: 20px; } .rp-rh p { margin: 4px 0 0; font-size: 13px; max-width: 720px; }
.rp-range { display: inline-flex; align-items: center; gap: 6px; } .rp-range input { width: 140px; height: 36px; padding: 0 10px; font-size: 13px; } .rp-range span { color: var(--muted); font-size: 12px; }
.stat .v.ok { color: var(--wa); } .stat .v.warn { color: var(--amber); } .stat .v.err { color: var(--red); } .stat .v.info { color: var(--blue); }
.rp-kpis .stat .v { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g1 { grid-template-columns: 1fr; }
.rp-chart h3 { margin-bottom: 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rp-svg { width: 100%; height: auto; display: block; font-family: var(--mono); font-size: 10px; }
.rp-svg text { fill: var(--dim); } .rp-svg .ymax { fill: var(--muted); font-size: 9.5px; }
.rp-svg .axis { stroke: var(--border2); } .rp-svg .grid { stroke: var(--border); stroke-dasharray: 2 4; }
.rp-svg.bars rect { fill: var(--wa); opacity: .9; transition: .15s; } .rp-svg.bars rect:hover { opacity: 1; filter: brightness(1.15); } .rp-svg.bars rect.neg { fill: var(--red); }
.rp-svg .meta { stroke: var(--amber); stroke-dasharray: 5 4; stroke-width: 1.2; } .rp-svg .meta-l { fill: var(--amber); font-size: 9.5px; }
.rp-svg.line path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.rp-legend span { display: inline-flex; align-items: center; gap: 6px; } .rp-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rp-donut { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.rp-donut svg { width: 140px; height: 140px; } .rp-donut svg .big { fill: var(--text); font-size: 20px; font-weight: 800; } .rp-donut svg .small { fill: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.rp-donut path:hover { opacity: .8; }
.rp-dl { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; max-height: 190px; overflow-y: auto; }
.rp-dl div { display: flex; align-items: center; gap: 8px; } .rp-dl i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; } .rp-dl b { min-width: 48px; text-align: right; } .rp-dl small { min-width: 80px; text-align: right; color: var(--dim); }
.rp-dl .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-hbar { display: grid; gap: 4px 0; font-size: 12.5px; }
.rp-hbar .t { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; } .rp-hbar .t span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-hbar .tr { position: relative; height: 8px; background: var(--surface2); border-radius: 99px; overflow: visible; }
.rp-hbar .tr i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--wa2), var(--wa)); transition: width .4s; } .rp-hbar .tr i.over { background: linear-gradient(90deg, #b3341f, var(--red)); }
.rp-hbar .tr u { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--amber); border-radius: 2px; }
.rp-heat { display: grid; gap: 3px; font-size: 10.5px; font-family: var(--mono); align-items: center; }
.rp-heat .h { color: var(--muted); text-align: center; padding: 2px; } .rp-heat span.h:nth-child(n+2) { font-size: 9.5px; }
.rp-heat b { display: block; aspect-ratio: 1.6; min-height: 22px; border-radius: 5px; background: color-mix(in srgb, var(--wa) calc(var(--a) * 100%), var(--surface2)); transition: .15s; cursor: default; }
.rp-heat b:hover { outline: 2px solid var(--text); outline-offset: -2px; }
.rp-table { margin-bottom: 12px; }
.rp-tb { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rp-scroll { overflow-x: auto; max-width: 100%; }
.rp-table .table { min-width: 640px; } .rp-table .table th { white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.rp-table .table th:hover { color: var(--text); } .rp-table .table th.sorted { color: var(--wa); }
.rp-table .table td { font-size: 13px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.rp-table .table tr.tot td { font-weight: 800; background: var(--surface2); border-top: 2px solid var(--border2); }
.rp-table .neg { color: var(--red); }
.rp-bar { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; justify-content: flex-end; } .rp-bar i { display: block; width: 60px; height: 6px; border-radius: 99px; background: var(--wa); max-width: 60px; } .rp-bar span { font-size: 11.5px; color: var(--muted); }
.rp-more { padding: 12px; text-align: center; border-top: 1px solid var(--border); }
.rp-notes { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.rp-home .rp-cards, .rp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.rp-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); transition: .15s; }
.rp-card:hover { border-color: var(--wa); transform: translateY(-1px); }
.rp-card .ic { font-size: 20px; width: 34px; height: 34px; display: grid; place-items: center; background: var(--surface2); border-radius: 10px; flex-shrink: 0; }
.rp-card b { display: block; font-size: 13px; } .rp-card small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; margin-top: 2px; }
.rp-gsec { margin-bottom: 18px; } .rp-gsec h3 { display: flex; align-items: center; gap: 8px; } .rp-gsec h3 small { font-weight: 500; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; } .rp-chips .chip { color: var(--text); }
@media (max-width: 1100px) { .rp { grid-template-columns: 232px 1fr; } .rp-donut { grid-template-columns: 110px 1fr; } .rp-donut svg { width: 110px; height: 110px; } }
@media (max-width: 900px) {
  .rp { grid-template-columns: 1fr; } .rp-cat { display: none; position: static; max-height: none; }
  .rp.cat-open .rp-cat { display: flex; } .rp.cat-open .rp-main { display: none; }
  .rp-kpis.g4 { grid-template-columns: 1fr 1fr; } .rp-charts.g2 { grid-template-columns: 1fr; } .rp-kpis .stat .v { font-size: 19px; white-space: normal; word-break: break-word; }
  .rp-search.sm input { width: 150px; } .rp-heat b { min-height: 16px; }
}
@media print {
  .sidebar, .topbar, .feed, .mobile-nav, .rp-cat, .page-head .row, .rp-rh .row, .rp-tb, .rp-more, #toasts { display: none !important; }
  .app { display: block; } .main { padding: 0; } body { background: #fff; color: #000; }
  .card, .stat { border-color: #ccc; break-inside: avoid; } .rp { display: block; } .rp-table .table td, .rp-table .table th { white-space: normal; }
}

/* ---------- Estoque ---------- */
.est-drop { border-style: dashed; transition: .15s; }
.est-drop.over { border-color: var(--wa); background: rgba(37,211,102,.06); }
.est-drop h3 { font-size: 16px; }
.table tr.tot td { background: var(--surface2); font-weight: 700; border-top: 2px solid var(--border2); }
