:root { --brand: #10b981; --brand-2: #059669; }

body { background: #f4f6fa; color: #1e293b; }

/* ---------- Barras de rolagem discretas (quase invisíveis) ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(100,116,139,.28) transparent; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,.28); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,.5); }
/* Barra lateral: sem scrollbar visível */
.sidebar { scrollbar-width: none; }
.sidebar::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- Layout do painel (owner / saas) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 258px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow-y: auto;
  background: linear-gradient(180deg, #0c2a20 0%, #06140f 100%);
  color: #c7d2e0; box-shadow: 2px 0 12px rgba(2,6,23,.15);
}
.sidebar .brand {
  display: flex; align-items: center; gap: .55rem; color: #fff; font-weight: 800;
  letter-spacing: -.01em; padding: 1.15rem 1.25rem; font-size: 1.12rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar .brand .logo {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-size: 1rem;
  box-shadow: 0 3px 8px rgba(16,185,129,.4);
}
.sidebar .nav-scroll { flex: 1; padding: .4rem 0; }
.sidebar a {
  display: flex; align-items: center; gap: .7rem; color: #aeb9cc;
  padding: .6rem 1.25rem; text-decoration: none; font-size: .9rem; font-weight: 500;
  border-left: 3px solid transparent; transition: background .15s, color .15s;
}
.sidebar a:hover { background: rgba(255,255,255,.04); color: #fff; }
.sidebar a.active {
  background: linear-gradient(90deg, rgba(16,185,129,.16), transparent);
  color: #fff; border-left-color: var(--brand); font-weight: 600;
}
.sidebar .sep { color: #5b6b85; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; padding: 1rem 1.25rem .35rem; letter-spacing: .08em; }

/* Card do usuário (rodapé fixo da sidebar) */
.sidebar .user-card {
  margin-top: auto; padding: .85rem 1rem;
  border-top: 1px solid rgba(255,255,255,.07); background: rgba(2,6,23,.35);
}
.sidebar .user-card .who { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.sidebar .user-card .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .82rem;
}
.sidebar .user-card .name { color: #fff; font-weight: 600; font-size: .85rem; line-height: 1.15; }
.sidebar .user-card .role { color: #8896ac; font-size: .72rem; }
.sidebar .btn-sair {
  display: flex; align-items: center; justify-content: center; gap: .4rem; width: 100%;
  padding: .5rem; border: 1px solid rgba(255,255,255,.15); border-radius: 8px;
  background: transparent; color: #c7d2e0; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.sidebar .btn-sair:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Conteúdo */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content .topbar {
  background: #fff; border-bottom: 1px solid #e8ecf2; padding: .65rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1020; box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.content .topbar .page-title { font-weight: 700; color: #0f172a; font-size: 1.02rem; }
.content .clock { text-align: right; line-height: 1.15; }
.content .clock .time { font-weight: 700; font-size: 1.02rem; color: #0f172a;
  font-variant-numeric: tabular-nums; }
.content .clock .date { font-size: .72rem; color: #64748b; text-transform: capitalize; }
.content .inner { padding: 1.6rem; flex: 1; }
.hamburger { background: none; border: 1px solid #e2e8f0; border-radius: 8px; }

@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 1040; left: -270px; transition: left .2s; }
  .sidebar.open { left: 0; }
}

.stat-card { border: none; border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 10px 24px -14px rgba(15,23,42,.18); }
.stat-card .num { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; color: #0f172a; }

/* Refinos gerais do painel */
.content .card { border: 1px solid #eef1f6; border-radius: 14px; }
.content .card-header { background: #fff; border-bottom: 1px solid #f0f2f7; }
.min-width-0 { min-width: 0; }

/* ---------- Sidebar que expande no hover (desktop) ---------- */
.sidebar a .ic { width: 22px; text-align: center; flex-shrink: 0; font-size: 1rem; }
/* Ícones SVG monocromáticos (herdam a cor do link → certos no hover/ativo) */
.sidebar a .ic svg { width: 18px; height: 18px; vertical-align: middle;
  display: inline-block; }
.sidebar .brand .logo svg { width: 18px; height: 18px; color: #fff; }
.sidebar .btn-sair svg { width: 15px; height: 15px; vertical-align: -2px; }
.sidebar a .lbl, .sidebar .brand .txt, .sidebar .sep,
.sidebar .user-card .who .min-width-0, .sidebar .btn-sair .txt {
  white-space: nowrap; transition: opacity .15s;
}

@media (min-width: 769px) {
  /* Estado recolhido: só ícones */
  .app-shell.rail .sidebar {
    width: 64px; transition: width .18s ease;
  }
  .app-shell.rail .sidebar:hover { width: 258px; box-shadow: 6px 0 24px rgba(2,6,23,.28); }

  .app-shell.rail .sidebar .lbl,
  .app-shell.rail .sidebar .brand .txt,
  .app-shell.rail .sidebar .sep,
  .app-shell.rail .sidebar .user-card .who .min-width-0,
  .app-shell.rail .sidebar .btn-sair .txt {
    opacity: 0; pointer-events: none;
  }
  .app-shell.rail .sidebar:hover .lbl,
  .app-shell.rail .sidebar:hover .brand .txt,
  .app-shell.rail .sidebar:hover .sep,
  .app-shell.rail .sidebar:hover .user-card .who .min-width-0,
  .app-shell.rail .sidebar:hover .btn-sair .txt {
    opacity: 1; pointer-events: auto;
  }
  .app-shell.rail .sidebar .user-card { padding: .85rem .8rem; }
  .app-shell.rail .sidebar .brand { gap: 0; }
}

/* ---------- Ícone inline (tag {% ic %}) ---------- */
.ic-svg { width: 1em; height: 1em; vertical-align: -.14em; display: inline-block;
  flex-shrink: 0; }
.ic--sm { width: .85em; height: .85em; }
.ic--lg { width: 1.35em; height: 1.35em; }
.ic--xl { width: 1.7em; height: 1.7em; }
.ic--2x { width: 2.2em; height: 2.2em; }

/* ---------- Dashboard (KPIs, chips e mini-gráfico) ---------- */
.kpi { border: 1px solid #eef1f6; border-radius: 16px; background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.05), 0 12px 26px -18px rgba(15,23,42,.25);
  padding: 1.05rem 1.15rem; height: 100%; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15,23,42,.08), 0 18px 34px -20px rgba(15,23,42,.3); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .label { color: #64748b; font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; }
.kpi .kpi-ic { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; }
.kpi .kpi-ic svg { width: 20px; height: 20px; }
.kpi .num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em;
  color: #0f172a; line-height: 1.1; margin-top: .35rem; }
.kpi .sub { color: #64748b; font-size: .8rem; margin-top: .15rem; }
.kpi-ic.i-green { background: #dcfce7; color: #16a34a; }
.kpi-ic.i-blue  { background: #dbeafe; color: #2563eb; }
.kpi-ic.i-amber { background: #fef3c7; color: #d97706; }
.kpi-ic.i-violet{ background: #ede9fe; color: #7c3aed; }
.kpi-ic.i-red   { background: #fee2e2; color: #dc2626; }

.chip { display: inline-flex; align-items: center; gap: .2rem; font-size: .74rem;
  font-weight: 700; padding: .12rem .45rem; border-radius: 999px; }
.chip svg { width: 12px; height: 12px; }
.chip.up { background: #dcfce7; color: #15803d; }
.chip.down { background: #fee2e2; color: #b91c1c; }
.chip.flat { background: #eef1f6; color: #64748b; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: .25rem; vertical-align: 1px; }
.dot.g { background: #16a34a; } .dot.b { background: #2563eb; } .dot.r { background: #dc2626; }

.barchart { display: flex; align-items: flex-end; gap: .55rem; padding-top: .5rem; }
.barchart .col { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: .35rem; }
.barchart .bar { width: 100%; max-width: 42px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  transition: filter .15s; }
.barchart .col:hover .bar { filter: brightness(1.12); }
.barchart .bar.bar-hoje { background: linear-gradient(180deg, #f59e0b, #d97706); }
.barchart .col .v { font-size: .78rem; font-weight: 700; color: #0f172a; }
.barchart .col .m { font-size: .68rem; color: #94a3b8; text-transform: uppercase; }

.attn-item { display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .1rem; border-bottom: 1px solid #f1f4f9; }
.attn-item:last-child { border-bottom: 0; }
.attn-item .a-ic { width: 30px; height: 30px; border-radius: 8px; display: grid;
  place-items: center; flex-shrink: 0; }
.attn-item .a-ic svg { width: 16px; height: 16px; }
.attn-item:hover { background: #f8fafc; }
.a-ic.i-red   { background: #fee2e2; color: #dc2626; }
.a-ic.i-amber { background: #fef3c7; color: #d97706; }
.a-ic.i-blue  { background: #dbeafe; color: #2563eb; }
.attn-badge { font-weight: 800; font-size: 1rem; }

/* ---------- Frente de caixa (PDV) ---------- */
.pos { display: flex; gap: 1rem; align-items: flex-start; }
.pos-produtos { flex: 1; min-width: 0; }
.pos-venda { width: 350px; flex-shrink: 0; position: sticky; top: 80px;
  background: #fff; border: 1px solid #e6eaf1; border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,.05), 0 14px 30px -20px rgba(15,23,42,.3);
  display: flex; flex-direction: column; max-height: calc(100vh - 100px); }

.pos-toolbar { display: flex; gap: .5rem; margin-bottom: .7rem; }
.pos-search { position: relative; flex: 1; }
.pos-search .ic-svg { position: absolute; left: .7rem; top: 50%;
  transform: translateY(-50%); color: #94a3b8; width: 1.05em; height: 1.05em; }
.pos-search input { width: 100%; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: .5rem .8rem .5rem 2.2rem; font-size: .9rem; outline: none; }
.pos-search input:focus { border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16,185,129,.12); }

.pos-chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem;
  margin-bottom: .5rem; }
.pos-chip { border: 1px solid #e2e8f0; background: #fff; border-radius: 999px;
  padding: .32rem .85rem; font-size: .82rem; font-weight: 600; color: #475569;
  white-space: nowrap; cursor: pointer; transition: all .12s; }
.pos-chip:hover { border-color: #cbd5e1; }
.pos-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.pos-grid { display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); }
.pos-tile { border: 1px solid #e6eaf1; background: #fff; border-radius: 13px;
  padding: .7rem .75rem; text-align: left; cursor: pointer; display: flex;
  flex-direction: column; gap: .25rem; min-height: 82px;
  transition: transform .1s, box-shadow .12s, border-color .12s; }
.pos-tile:hover { border-color: var(--brand);
  box-shadow: 0 6px 16px -8px rgba(16,185,129,.5); transform: translateY(-1px); }
.pos-tile:active { transform: scale(.97); }
.pos-tile .t-nome { font-weight: 600; font-size: .9rem; line-height: 1.15;
  color: #0f172a; }
.pos-tile .t-preco { font-size: .82rem; color: var(--brand); font-weight: 700;
  margin-top: auto; }

.pos-venda-head { display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; border-bottom: 1px solid #eef1f6; font-size: .98rem; }
.pos-itens { overflow-y: auto; flex: 1; }
.pos-item { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem;
  align-items: center; padding: .55rem 1rem; border-bottom: 1px solid #f3f5f9; }
.pos-item .pi-nome { font-weight: 600; font-size: .86rem; color: #0f172a; }
.pos-item .pi-sub { font-size: .72rem; color: #94a3b8; }
.pos-item .pi-qtd { display: flex; align-items: center; gap: .35rem; }
.pos-item .pi-qtd span { min-width: 18px; text-align: center; font-weight: 700;
  font-size: .88rem; }
.qbtn { width: 26px; height: 26px; border-radius: 7px; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #0f172a; font-size: 1rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; }
.qbtn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.pos-item .pi-sub-total { font-weight: 700; font-size: .86rem; text-align: right;
  white-space: nowrap; display: flex; align-items: center; gap: .4rem; }
.pi-rem { border: none; background: none; color: #cbd5e1; cursor: pointer;
  padding: 2px; display: grid; place-items: center; }
.pi-rem:hover { color: #dc2626; }

.pos-venda-foot { border-top: 1px solid #eef1f6; padding: .85rem 1rem; }
.pos-total { display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; font-size: 1.25rem; color: #0f172a; margin: .3rem 0 .6rem; }
.pos-total span:last-child { color: var(--brand); }

@media (max-width: 991px) {
  .pos { flex-direction: column; }
  .pos-venda { width: 100%; position: static; max-height: none; }
}

/* ---------- Opções selecionáveis (cards de rádio) ---------- */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.opt-card { margin: 0; cursor: pointer; }
.opt-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt-card .opt-box { display: block; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: .7rem .85rem; transition: border-color .12s, background .12s, box-shadow .12s; }
.opt-card .opt-sub { display: block; font-size: .78rem; color: #64748b; margin-top: .1rem; }
.opt-card:hover .opt-box { border-color: #cbd5e1; }
.opt-card input:checked + .opt-box { border-color: var(--brand);
  background: rgba(16,185,129,.06); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
@media (max-width: 440px) { .opt-grid { grid-template-columns: 1fr; } }

/* ---------- Cardápio público ---------- */
.menu-header { background: var(--brand); color: #fff; }
.cat-nav { position: sticky; top: 0; z-index: 10; background: #fff;
  border-bottom: 1px solid #eee; overflow-x: auto; white-space: nowrap; }
.cat-nav a { display: inline-block; padding: .8rem 1rem; color: #333;
  text-decoration: none; font-weight: 600; font-size: .9rem; }
.produto-card { border: 1px solid #eee; border-radius: 12px; overflow: hidden;
  background: #fff; height: 100%; transition: box-shadow .15s; }
.produto-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.produto-card img { width: 100%; height: 150px; object-fit: cover; }
.produto-thumb-ph { height: 150px; background: #f0f0f0; display: flex;
  align-items: center; justify-content: center; color: #bbb; font-size: 2rem; }
.badge-fire { background: #fff3cd; color: #b7791f; }
.price { color: var(--brand); font-weight: 700; }
.cart-fab { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 1030; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { filter: brightness(.92); color: #fff; }
.btn-outline-brand { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }
.wa-btn { background: #25d366; border-color: #25d366; color: #fff; }
.wa-btn:hover { background: #1ebe5b; color: #fff; }
