:root {
  --bg: #0d1117;
  --sidebar: #161b22;
  --card: #21262d;
  --border: #30363d;
  --accent: #e85d04;
  --accent2: #f48c06;
  --success: #238636;
  --warning: #9e6a03;
  --danger: #da3633;
  --info: #1f6feb;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --sidebar-width: 240px;
}

/* ── Light mode ──────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:         #f6f8fa;
  --sidebar:    #ffffff;
  --card:       #ffffff;
  --border:     #d0d7de;
  --text:       #1f2328;
  --text-muted: #636c76;
  --warning:    #7a4f00;
}

/* Transição suave ao trocar tema (classe adicionada por theme.js por ~380ms) */
.theme-switching * {
  transition:
    background-color .25s ease,
    border-color     .25s ease,
    color            .2s  ease,
    box-shadow       .25s ease !important;
}

/* Ajustes de contraste para light mode (elementos com rgba hardcoded) */
[data-theme="light"] .nav-item:hover       { background: rgba(0,0,0,.05); }
[data-theme="light"] tr:hover td           { background: rgba(0,0,0,.03); }
[data-theme="light"] td                    { border-bottom-color: var(--border); }
[data-theme="light"] .kanban-body          { background: rgba(0,0,0,.02); }
[data-theme="light"] .btn-outline:hover    { background: rgba(0,0,0,.04); }
[data-theme="light"] .btn-ghost:hover      { background: rgba(0,0,0,.04); }
[data-theme="light"] .cart-item:hover      { background: rgba(0,0,0,.04); }
[data-theme="light"] .nav-soon             { background: rgba(0,0,0,.05); }
[data-theme="light"] .pedido-card.ativo    { background: rgba(232,93,4,.05); }
[data-theme="light"] .nav-item.active      { background: rgba(232,93,4,.10); }
[data-theme="light"] .card,
[data-theme="light"] .kpi-card,
[data-theme="light"] .modal,
[data-theme="light"] .toast                { box-shadow: 0 1px 4px rgba(0,0,0,.08); }
[data-theme="light"] .sidebar              { box-shadow: 2px 0 8px rgba(0,0,0,.06); }
[data-theme="light"] .topbar               { box-shadow: 0 1px 4px rgba(0,0,0,.06); }
[data-theme="light"] .badge-novo           { background: rgba(31,111,235,.12); }
[data-theme="light"] .badge-preparo        { background: rgba(158,106,3,.15); }
[data-theme="light"] .badge-pronto         { background: rgba(35,134,54,.12); }
[data-theme="light"] .badge-saiu_entrega   { background: rgba(232,93,4,.12); }
[data-theme="light"] .badge-cancelado      { background: rgba(218,54,51,.12); }
[data-theme="light"] .badge-delivery       { background: rgba(232,93,4,.12); }
[data-theme="light"] .badge-local          { background: rgba(31,111,235,.12); }
[data-theme="light"] .badge-retirada       { background: rgba(158,106,3,.12); }

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* LAYOUT */
.layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s;
}
.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo { font-size: 28px; }
.sidebar-title { font-size: 15px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.sidebar-subtitle { font-size: 11px; color: var(--text-muted); }
.sidebar-header-logo { flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.sidebar-logo-img { max-height: 110px; width: auto; max-width: 100%; object-fit: contain; transition: opacity .15s; }
.sidebar-header-logo .sidebar-subtitle { font-size: 14px; font-weight: 700; color: var(--text); }

.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.nav-section { padding: 14px 16px 5px; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  color: var(--text);
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .2px;
  border-left: 3px solid transparent;
  transition:
    background .18s ease,
    color       .18s ease,
    border-left-color .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: rgba(232,93,4,.15);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 800;
}
.nav-item .icon { width: 22px; text-align: center; font-size: 18px; }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.badge-count { background: var(--accent); color: white; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600; margin-left: auto; }

/* ── Caixa status block ──────────────────────────────────────────────────── */
.sb-caixa {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; margin: 8px 10px 4px;
  border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--text);
  transition: background .15s;
  text-decoration: none;
}
.sb-caixa:hover { background: rgba(255,255,255,.11); }
.sb-caixa .icon { font-size: 16px; width: 18px; text-align: center; }
.sb-caixa-label { flex: 1; }
.sb-caixa-badge {
  font-size: 10px; font-weight: 800; letter-spacing: .4px;
  padding: 2px 8px; border-radius: 20px; text-transform: uppercase;
}
.sb-caixa-badge.aberto { background: rgba(34,197,94,.18); color: #4ade80; border: 1px solid rgba(34,197,94,.35); }
.sb-caixa-badge.fechado { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.35); }
.sb-caixa-arrow { font-size: 11px; color: var(--text-muted); margin-left: 2px; transition: transform .2s; }
.sb-caixa-abrir-btn {
  font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 20px;
  background: rgba(34,197,94,.18); color: #4ade80; border: 1px solid rgba(34,197,94,.35);
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.sb-caixa-abrir-btn:hover { background: rgba(34,197,94,.3); }

/* Dropdown do Caixa */
.sb-caixa-drop {
  display: none; flex-direction: column;
  margin: 0 10px 6px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  overflow: hidden;
}
.sb-caixa-drop.open { display: flex; }
.sb-caixa-drop-time {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  padding: 8px 14px 6px; border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .4px;
}
.sb-caixa-drop-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 14px; font-size: 13px; font-weight: 600;
  color: var(--text); background: none; border: none;
  cursor: pointer; text-decoration: none;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.sb-caixa-drop-item:last-child { border-bottom: none; }
.sb-caixa-drop-item:hover { background: rgba(255,255,255,.06); }
.sb-caixa-drop-item.danger { color: #f87171; }
.sb-caixa-drop-item.danger:hover { background: rgba(239,68,68,.08); }

/* Mini modal de retirada/suprimento */
#sb-mini-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.sb-mm-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sb-mm-box {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; width: 300px; max-width: calc(100vw - 32px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 10px;
}
.sb-mm-title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.sb-mm-input { background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px; color: var(--text); outline: none; width: 100%; box-sizing: border-box; }
.sb-mm-input:focus { border-color: var(--accent); }
.sb-mm-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.sb-mm-btn { padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 700; border: none; cursor: pointer; }
.sb-mm-btn.cancel  { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.sb-mm-btn.confirm { background: var(--accent); color: #fff; }
.sb-mm-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 3px; }
.sb-mm-label-hint { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); text-transform: none; letter-spacing: 0; margin-top: 1px; }

/* ── Sidebar dropdown ────────────────────────────────────────────────────── */
.nav-dd-toggle { cursor: pointer; user-select: none; }

/* Seta do dropdown */
.nav-dd-arrow {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
  display: inline-block;
  line-height: 1;
  transition: transform .26s cubic-bezier(.4,0,.2,1), color .15s ease;
  transform-origin: center;
}
.nav-dd-toggle.open .nav-dd-arrow  { transform: rotate(180deg); color: var(--accent); }
.nav-dd-toggle.open               { color: var(--text); }

/* Wrapper animado: usa grid-template-rows para animar até a altura REAL do conteúdo */
.nav-dd-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows .26s cubic-bezier(.4,0,.2,1),
    opacity            .2s  ease;
}
.nav-dd-wrap.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

/* Container interno — overflow:hidden é obrigatório pro grid funcionar */
.nav-dd-body {
  overflow: hidden;
  padding: 2px 0;
}

/* Sub-itens do dropdown */
.nav-sub        { padding-left: 40px !important; font-size: 14.5px; font-weight: 600; }
.nav-sub .icon  { font-size: 14px; }

/* Sub-itens nível 2 (dentro do dropdown Estabelecimento) */
.nav-sub2       { padding-left: 54px !important; font-size: 12.5px; }
.nav-sub2 .icon { font-size: 13px; }

/* Animação sutil dos itens ao abrir (só quando disparado por usuário via .anim) */
.nav-dd-wrap.open.anim .nav-sub {
  animation: navSubIn .22s ease both;
}
.nav-dd-wrap.open.anim .nav-sub:nth-child(2)  { animation-delay: .03s; }
.nav-dd-wrap.open.anim .nav-sub:nth-child(3)  { animation-delay: .06s; }
.nav-dd-wrap.open.anim .nav-sub:nth-child(4)  { animation-delay: .08s; }
.nav-dd-wrap.open.anim .nav-sub:nth-child(5)  { animation-delay: .10s; }
.nav-dd-wrap.open.anim .nav-sub:nth-child(6)  { animation-delay: .12s; }
.nav-dd-wrap.open.anim .nav-sub:nth-child(7)  { animation-delay: .13s; }
.nav-dd-wrap.open.anim .nav-sub:nth-child(8)  { animation-delay: .14s; }
.nav-dd-wrap.open.anim .nav-sub:nth-child(n+9){ animation-delay: .15s; }

@keyframes navSubIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0);    }
}

.nav-disabled { opacity: .38; pointer-events: none; cursor: default; }
.nav-soon {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1px 6px;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* MAIN CONTENT */
.main { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 600; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ── Botão de alternância de tema ────────────────────────────────────────── */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.theme-toggle-btn:hover {
  background: rgba(255,255,255,.08);
  color: var(--text);
  border-color: var(--text-muted);
}
[data-theme="light"] .theme-toggle-btn:hover { background: rgba(0,0,0,.06); }

.content { padding: 24px; flex: 1; }

/* CARDS KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); }
.kpi-card.success::before { background: var(--success); }
.kpi-card.info::before { background: var(--info); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1; }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.kpi-icon { position: absolute; right: 16px; top: 16px; font-size: 32px; opacity: .2; }

/* CARDS GENÉRICOS */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; }

/* BOTÕES */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: all .15s;
}
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent2); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: rgba(255,255,255,.05); }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 6px 8px; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }

/* FORMULÁRIOS */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 9px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px;
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--accent); }
select.form-control { cursor: pointer; }
/* Sem isso, um campo readonly é visualmente idêntico a um editável — já gerou
   confusão real (usuário tentando editar a URL de webhook, só de exibição). */
.form-control[readonly], .form-control:disabled { background: var(--card); color: var(--text-muted); cursor: not-allowed; }

/* TABELAS */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 10px 12px; text-align: left; color: var(--text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.05); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.03); }

/* BADGES STATUS */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.badge-novo { background: rgba(31,111,235,.2); color: #58a6ff; }
.badge-pronto { background: rgba(35,134,54,.2); color: #3fb950; }
.badge-cancelado { background: rgba(218,54,51,.2); color: #f85149; }
.badge-local { background: rgba(31,111,235,.2); color: #58a6ff; }
.badge-retirada { background: rgba(158,106,3,.2); color: #e3b341; }

/* KANBAN */
.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { min-width: 260px; max-width: 300px; flex-shrink: 0; }
.kanban-header { padding: 10px 12px; border-radius: 8px 8px 0 0; font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.kanban-body { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; padding: 8px; min-height: 80px; display: flex; flex-direction: column; gap: 8px; }
.pedido-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.pedido-card:hover { border-color: var(--accent); }
.pedido-time { font-size: 11px; color: var(--text-muted); }
.pedido-items { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.6; }
.pedido-footer { display: flex; justify-content: space-between; align-items: center; }
.pedido-total { font-weight: 700; color: var(--accent); }

.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-tab { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; transition: all .15s; }
.cat-tab.active, .cat-tab:hover { background: var(--accent); color: white; border-color: var(--accent); }

.cart-header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.cart-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; margin-bottom: 4px; }
.cart-item:hover { background: rgba(255,255,255,.05); }
.qty-btn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; }
.qty-btn:hover { background: var(--accent); border-color: var(--accent); }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
}
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 90%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }

/* TOASTS */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; min-width: 280px; max-width: 360px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: slideIn .3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }
.toast.warning { border-left: 4px solid #e3b341; }
.toast-msg { font-size: 14px; flex: 1; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse-bell { from { transform: scale(1) rotate(-8deg); } to { transform: scale(1.15) rotate(8deg); } }

/* CHART AREA */
.chart-container { position: relative; height: 280px; }

/* SEARCH */
.search-box { position: relative; }
.search-box input { padding-left: 36px; }
.search-box::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; }

/* STATUS INDICATOR */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.status-dot.online { background: #3fb950; box-shadow: 0 0 6px #3fb950; }
.status-dot.offline { background: var(--danger); }
.status-dot.pending { background: #e3b341; }

/* GRID RESPONSIVO */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* NOTIFICAÇÃO SONORA VISUAL */
.pulse { animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ══ DESKTOP (≥1100px) ══════════════════════════════════════════════════════ */
@media (min-width: 1100px) {
  :root { --sidebar-width: 260px; }

  .topbar  { padding: 13px 32px; }
  .content { padding: 28px 32px; }

  /* KPI: sempre 4 colunas */
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }

  /* Kanban: colunas preenchem o espaço disponível */
  .kanban     { display: grid; grid-template-columns: repeat(var(--kanban-cols, 5), minmax(180px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .kanban-col { min-width: 0; max-width: none; flex-shrink: 0; }
  .kanban-body { max-height: calc(100vh - 310px); overflow-y: auto; }

  /* ── Painel divisório — Pedidos ──────────────────────────── */
  .ped-split {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 16px;
    align-items: start;
  }
  .ped-split-left { min-width: 0; overflow: hidden; }
  .ped-split-right {
    display: flex !important;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 80px);
  }
}

/* ══ ULTRAWIDE (≥1500px) ════════════════════════════════════════════════════ */
@media (min-width: 1500px) {
  .ped-split { grid-template-columns: 1fr 460px; }
  .kpi-value { font-size: 32px; }
}

/* ── Kanban: cor da coluna entregue (estava faltando) ──────── */
.kanban-col-entregue .kanban-header { background: rgba(35,134,54,.2); color: #3fb950; }
.kanban-col-cancelado .kanban-header { background: rgba(218,54,51,.2); color: #f85149; }

/* ── Pedido-card: estado selecionado no painel ─────────────── */
.pedido-card.ativo {
  border-color: var(--accent);
  background: rgba(232,93,4,.07);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ── Painel de detalhe ─────────────────────────────────────── */
.ped-split-right { display: none; }       /* oculto em mobile por padrão */
.ped-panel-vazio {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; color: var(--text-muted); padding: 32px;
  text-align: center;
}
.ped-panel-vazio .vazio-icon { font-size: 52px; opacity: .2; }
.ped-panel-vazio p { font-size: 14px; line-height: 1.6; }
.ped-panel-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-shrink: 0;
}
.ped-panel-header .ped-panel-titulo { font-size: 15px; font-weight: 700; }
.ped-panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.ped-panel-footer {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0;
}

/* MOBILE */
.menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .pdv-layout { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kanban { padding-bottom: 16px; }
  .content { padding: 16px; }
}
