:root {
  --bg: #f4eee6;
  --surface: #fffdf9;
  --ink: #1d1714;
  --muted: #7a6e66;
  --line: #e5dcd2;
  --brasa: #b8321e;
  --brasa-dark: #962614;
  --brasa-soft: #f8e6e2;
  --basil: #2f6b4f;
  --basil-soft: #e1efe7;
  --amber: #b45309;
  --amber-soft: #fbecd3;
  --azul: #2d5f8b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 23, 20, .05), 0 6px 20px rgba(29, 23, 20, .06);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(ellipse at 50% 40%, #3a2c24 0%, var(--ink) 62%); color: #f7f2eb; padding: 56px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 0; }
.login-logo { width: 220px; height: 220px; border-radius: 50%; box-shadow: 0 0 0 10px rgba(247, 242, 235, .07), 0 0 0 11px rgba(247, 242, 235, .14), 0 24px 60px rgba(0, 0, 0, .55); margin-bottom: 40px; }
/* ---------- Saída do dia (visual moderno) ---------- */
.saida-hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 26px 30px; margin-bottom: 18px; border-radius: 22px; color: #f7f2eb; background: radial-gradient(120% 150% at 100% 0%, #5b3a2a 0%, #2a1f1a 46%, #1d1714 100%); box-shadow: var(--shadow); }
.saida-hero::after { content: ''; position: absolute; right: -70px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(184, 50, 30, .5), transparent 66%); pointer-events: none; }
.hero-esq { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.hero-un { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: #e0a99d; font-weight: 600; }
.saida-hero h1 { font-size: 36px; color: #fff; margin: 2px 0 4px; }
.hero-data { color: #cfc4ba; font-size: 14px; }
.hero-data::first-letter { text-transform: uppercase; }
.hero-stats { display: flex; gap: 12px; position: relative; z-index: 1; flex-wrap: wrap; align-items: stretch; }
.stat { min-width: 120px; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .13); }
.stat span { display: block; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: #cfc4ba; }
.stat strong { font-family: var(--serif); font-size: 23px; color: #fff; }
.stat .pendente { display: block; font-size: 11px; color: #f3c27a; margin-top: 2px; }
.btn.fechar-dia { background: #f3c27a; color: #2a1f1a; }
.btn.fechar-dia:hover { background: #ffd28f; }
.stat .aberto { color: #9be3b6; }
.stat .fechado { color: #f3c27a; }
.btn.claro { background: #fff; color: var(--ink); align-self: center; }
.btn.claro:hover { background: #efe7dc; }
.saida-topo { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2.2fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.vb-topo { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.vb-topo h3 { margin: 0; font-size: 18px; }
.vb-topo p { margin: 0; font-size: 13px; }
.vb-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brasa-soft); color: var(--brasa); display: grid; place-items: center; flex: none; }
.vb-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vendas-big .moeda-grande { margin-bottom: 12px; padding-left: 16px; }
.vendas-big .moeda-grande input[type=number] { width: 100%; font-size: 26px; font-family: var(--serif); padding: 12px 14px; }
.saida-bar { position: sticky; top: 0; z-index: 20; display: flex; gap: 14px; align-items: center; padding: 12px 0; margin-bottom: 8px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); }
.saida-bar .busca { flex: none; margin: 0; }
.saida-bar .busca input { width: 230px; border-radius: 999px; }
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pills::-webkit-scrollbar { display: none; }
.pills button { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.pills button:hover { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 8%, #fff); }
.pills button i { width: 9px; height: 9px; border-radius: 50%; background: var(--cor); }
.saida-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.saida-aside { position: sticky; top: 78px; }
.saida-aside h3 { margin-bottom: 10px; }
.lancado { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow: auto; }
.lancado li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.grupo-card { --cor: var(--brasa); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--cor); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; scroll-margin-top: 84px; }
.grupo-top { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; user-select: none; }
.grupo-top:focus-visible { outline: 3px solid var(--cor); outline-offset: -3px; }
.grupo-badge { width: 36px; height: 36px; border-radius: 50%; background: var(--cor); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.grupo-tit { flex: 1; min-width: 0; }
.grupo-tit h3 { margin: 0; font-size: 20px; }
.grupo-sub { font-size: 13px; color: var(--muted); }
.grupo-chev { font-size: 24px; color: var(--muted); transition: transform .2s; line-height: 1; }
.grupo-card.recolhido .grupo-chev { transform: rotate(-90deg); }
.grupo-card.recolhido .item-grid, .grupo-card.recolhido .grupo-dica, .grupo-card.recolhido .grupo-recolher { display: none; }
.grupo-card.recolhido [data-apurar] { display: none; }
.grupo-card.recolhido .grupo-top { cursor: pointer; }
.grupo-card.recolhido:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(29, 23, 20, .12); }
.grupo-card { transition: transform .12s, box-shadow .15s; }
.grupo-card:not(.recolhido) > .grupo-top { border-bottom: 1px solid var(--line); }
.grupo-sel { flex: none; background: var(--cor); color: #fff; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.grupo-recolher { display: block; width: calc(100% - 36px); margin: 0 18px 16px; padding: 12px; border: 1.5px dashed var(--line); border-radius: 12px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.grupo-recolher:hover { border-color: var(--cor); color: var(--cor); }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; padding: 4px 18px 18px; }
.item { --cor: var(--brasa); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s, background .15s; }
.grupo-card .item { --cor: inherit; }
.item:hover { border-color: #cdbfb1; }
.item.sel { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 7%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor) 16%, transparent); }
.item.erro { border-color: var(--brasa); background: var(--brasa-soft); box-shadow: none; }
.item.sem-saldo { opacity: .55; }
.item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-nome { font-weight: 600; line-height: 1.25; }
.item-meta { font-size: 12px; color: var(--muted); }
.item-meta strong { color: var(--ink); font-weight: 600; }
.item-lado { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.stepper { display: inline-flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex: none; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 1px 2px rgba(29, 23, 20, .14); font-size: 21px; line-height: 1; cursor: pointer; color: var(--ink); transition: background .12s, color .12s; }
.stepper button:hover:not(:disabled) { background: var(--cor, var(--brasa)); color: #fff; }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper input[type=number] { width: 64px; border: 0 !important; background: transparent !important; box-shadow: none !important; text-align: center; font-weight: 600; font-size: 16px; padding: 6px 2px; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .unit { margin: 0 12px 0 9px; font-size: 12px; }
.consumo-pill { font-size: 12px; color: var(--amber); background: var(--amber-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.consumo-pill strong { font-weight: 700; }
.consumo-pill.erro { color: var(--brasa-dark); background: var(--brasa-soft); }
.saida-acao { position: sticky; bottom: 12px; z-index: 25; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-top: 8px; background: var(--ink); color: #fff; border-radius: 18px; box-shadow: 0 14px 40px rgba(29, 23, 20, .38); }
.saida-acao input[type=text][id] { max-width: 300px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }
.saida-acao input::placeholder { color: #b7aba1; }
.acao-info { flex: 1; min-width: 180px; }
.acao-info strong { display: block; font-size: 16px; }
.acao-info span { font-size: 13px; color: #cfc4ba; }
@media (max-width: 1180px) { .saida-layout, .saida-topo { grid-template-columns: minmax(0, 1fr); } .saida-aside { position: static; } }
@media (max-width: 640px) { .saida-hero { padding: 20px; } .saida-hero h1 { font-size: 28px; } .item-grid { grid-template-columns: minmax(0, 1fr); padding: 4px 12px 14px; } .saida-bar { flex-direction: column; align-items: stretch; } .saida-bar .busca input { width: 100%; } }
.grupo { margin-bottom: 18px; overflow: hidden; }
.grupo-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.grupo-head h3 { margin: 0; font-size: 18px; }
.grupo-num { width: 30px; height: 30px; border-radius: 50%; background: #3f5a2b; color: #f7f2eb; display: inline-grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.grupo-dica { margin: 0; padding: 10px 20px; background: var(--amber-soft); color: var(--amber); font-size: 13px; }
.prod-bloco { margin-top: 16px; }
.prod-titulo { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.prod { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.prod span { font-weight: 600; }
.prod input { text-align: right; }
.aside-sticky { position: sticky; top: 16px; }
@media (max-width: 1180px) { .aside-sticky { position: static; } }
.vendas-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.vendas-card > div:first-child { flex: 1 1 320px; max-width: 560px; }
.vendas-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.moeda { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding-left: 12px; }
.moeda:focus-within { border-color: var(--brasa); box-shadow: 0 0 0 3px var(--brasa-soft); }
.moeda span { color: var(--muted); font-weight: 600; }
.moeda input[type=number] { border: 0 !important; box-shadow: none !important; background: transparent !important; width: 140px; text-align: right; font-variant-numeric: tabular-nums; }
/* Selo verde das pizzarias (padrão do card da La Fontilla) */
.selo { --oliva: #3f5a2b; width: var(--d, 84px); height: var(--d, 84px); border-radius: 50%; background: var(--oliva); color: #f7f2eb; display: inline-grid; place-content: center; text-align: center; flex: none;
  font-family: Cambria, 'Times New Roman', Georgia, serif; font-variant: small-caps; font-weight: 600; letter-spacing: .03em; line-height: 1.02; box-shadow: inset 0 0 0 calc(var(--d, 84px) * .03) rgba(247, 242, 235, .12); }
.selo b { display: block; font-weight: 600; font-size: calc(var(--d, 84px) * .19); }
.selo b:first-child { font-size: calc(var(--d, 84px) * .27); }
.unid-cards { display: flex; gap: 14px; flex-wrap: wrap; }
.unid-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 22px 12px; min-width: 150px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s; }
.unid-card:hover { border-color: #b9ad9f; transform: translateY(-1px); }
.unid-card.on { border-color: var(--brasa); box-shadow: 0 0 0 4px var(--brasa-soft); }
.unid-nome { font-weight: 600; font-size: 14px; }
.ult-card { min-width: 260px; max-width: 340px; text-align: center; }
.ult-quem { font-size: 15px; }
.ult-oque { font-size: 13px; color: var(--ink); }
.ult-quando { font-size: 12px; color: var(--muted); }
.unid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.unid-full { padding: 28px 22px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.unid-full.off { opacity: .6; }
.unid-full h3 { margin: 0; }
.side-logo { width: 46px; height: 46px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(247, 242, 235, .18); }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 24px; font-weight: 600; position: relative; z-index: 1; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--brasa); display: grid; place-items: center; }
.login-art h1 { font-size: 34px; line-height: 1.1; }
.login-art p { color: #cfc4ba; max-width: 38ch; margin-top: 14px; }
.login-form-wrap { display: grid; place-items: center; padding: 32px; }
.login-form { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 28px; margin-bottom: 6px; }
.login-form .muted { margin: 0 0 26px; }

/* ---------- Formulários ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=password], input[type=number], input[type=month], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brasa); box-shadow: 0 0 0 3px var(--brasa-soft); }
input:disabled { background: #f0e9df; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; border: 1px solid transparent; background: var(--brasa); color: #fff; font-weight: 600; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: var(--brasa-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #f0e9df; }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: #3a2f2a; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.erro { background: var(--brasa-soft); color: var(--brasa-dark); padding: 10px 13px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #e9e0d7; padding: 22px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; padding: 0 10px 22px; font-size: 16px; line-height: 1.2; }
.side .brand-mark { width: 32px; height: 32px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: #8d8077; padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #d6ccc2; text-decoration: none; cursor: pointer; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .06); }
.nav a.on { background: var(--brasa); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.me { border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 10px 0; font-size: 13px; }
.me strong { display: block; color: #fff; font-size: 14px; }
.me span { color: #a89c92; }
.me .links { display: flex; gap: 14px; margin-top: 10px; }
.me .links button { background: none; border: 0; color: #d6ccc2; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.main { padding: 34px 40px 60px; max-width: 1280px; width: 100%; }
.topbar { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: 32px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card h3 { font-size: 18px; margin-bottom: 4px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g-saida { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1180px) { .g-saida, .g3 { grid-template-columns: minmax(0, 1fr); } }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.toolbar .field { margin: 0; min-width: 190px; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #faf5ee; white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tr.cat td { background: #faf5ee; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 16px; }
td input[type=number] { width: 120px; text-align: right; padding: 8px 10px; }
.unit { color: var(--muted); font-size: 13px; margin-left: 6px; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.ok { background: var(--basil-soft); color: var(--basil); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.bad { background: var(--brasa-soft); color: var(--brasa-dark); }
.chip.off { background: #ece4da; color: var(--muted); }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; margin-bottom: 18px; }
.kpi { padding: 20px 22px; border-left: 5px solid var(--cor, var(--brasa)); }
.kpi .t { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--serif); font-size: 32px; font-weight: 600; margin: 2px 0; }
.kpi .s { font-size: 13px; color: var(--muted); }
/* ---------- Relatórios ---------- */
a.btn { text-decoration: none; }
.rel-hoje { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px; margin-bottom: 16px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.rel-hoje strong { display: block; font-family: var(--serif); font-size: 19px; }
.rel-hoje span { font-size: 13px; color: var(--muted); }
.rel-hoje .acoes { display: flex; gap: 10px; }
.rel-hoje.ok { background: var(--basil-soft); border-color: color-mix(in srgb, var(--basil) 40%, transparent); }
.rel-hoje.ok strong { color: var(--basil); }
.rel-hoje.pend { background: linear-gradient(90deg, var(--amber-soft), #fff8ea); border-color: #e0a02b; }
.rel-hoje.pend strong { color: var(--amber); }
.rel-hoje .fechar-dia { background: var(--ink); color: #fff; }
.rel-barra { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.rel-datas { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); }
.rel-datas input[type=date] { width: auto; }
.rel-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1320px) { .rel-layout { grid-template-columns: minmax(0, 1fr); } #rel-cal { max-width: 440px; } }
#rel-lista th { white-space: nowrap; }
#rel-lista td .muted { white-space: nowrap; }
.cal-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-topo strong { font-family: var(--serif); font-size: 17px; }
.cal-topo strong::first-letter { text-transform: uppercase; }
.cal-topo button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--bg); font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink); }
.cal-topo button:hover:not(:disabled) { background: var(--brasa); color: #fff; }
.cal-topo button:disabled { opacity: .35; cursor: not-allowed; }
.cal-semana, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-semana span { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding-bottom: 4px; }
.cal-dia { aspect-ratio: 1; position: relative; display: grid; place-items: center; border-radius: 12px; border: 1.5px solid transparent; background: #f3ece2; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; transition: transform .1s, box-shadow .15s; }
.cal-dia small { position: absolute; bottom: 3px; font-size: 10px; line-height: 1; }
.cal-dia:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(29, 23, 20, .14); }
.cal-dia.vazio { background: #f7f2eb; color: var(--muted); font-weight: 500; }
.cal-dia.ok { background: var(--basil-soft); color: var(--basil); border-color: color-mix(in srgb, var(--basil) 45%, transparent); }
.cal-dia.pend { background: var(--brasa-soft); color: var(--brasa-dark); border-color: var(--brasa); }
.cal-dia.futuro { background: transparent; opacity: .35; cursor: default; }
.cal-dia.hoje { box-shadow: 0 0 0 2px var(--ink); }
.cal-leg { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.cal-leg i { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.pdf-frame { width: 100%; height: 68vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 10px; }
/* ---------- Estoque interativo ---------- */
.est-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.est-stat { --cor: var(--ink); text-align: left; padding: 14px 18px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .1s; }
.est-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cor); }
.est-stat:hover { transform: translateY(-1px); border-color: #cdbfb1; }
.est-stat.on { border-color: var(--cor); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor) 18%, transparent), var(--shadow); }
.est-stat span { display: block; font-size: 12px; letter-spacing: .04em; font-weight: 600; color: var(--muted); }
.est-stat strong { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.15; color: var(--cor); }
.est-barra { position: sticky; top: 0; z-index: 20; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 0; margin-bottom: 8px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); }
.est-barra .busca { margin: 0; flex: none; }
.est-barra .busca input { width: 230px; border-radius: 999px; }
.est-barra select { border-radius: 999px; }
.est-grid { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); }
.est-card { --cor: var(--brasa); display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: #fff; border: 1.5px solid var(--line); border-left: 5px solid var(--cor); border-radius: 16px; cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s; outline: none; }
.est-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(29, 23, 20, .12); }
.est-card:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor) 35%, transparent); }
.est-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.est-nome { font-weight: 600; line-height: 1.25; }
.est-grupo { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.est-saldo { display: flex; align-items: baseline; gap: 6px; }
.est-saldo strong { font-family: var(--serif); font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.est-saldo span { color: var(--muted); font-size: 14px; }
.est-min { font-size: 12px; color: var(--muted); }
.nivel { position: relative; height: 9px; border-radius: 999px; background: #efe7dc; overflow: hidden; }
.nivel.grande { height: 14px; margin-top: 14px; overflow: visible; }
.nivel-barra { height: 100%; border-radius: 999px; background: #b9ad9f; transition: width .4s ease; }
.nivel-min { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: rgba(29, 23, 20, .55); border-radius: 2px; }
.nv-baixo .nivel-barra { background: var(--brasa); }
.nv-atencao .nivel-barra { background: #e0a02b; }
.nv-ok .nivel-barra { background: var(--basil); }
.est-card.nv-baixo { background: linear-gradient(180deg, #fff 60%, var(--brasa-soft)); }
.est-card footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line); }
.est-card footer .btn { white-space: nowrap; margin-left: auto; }
.est-ult { font-size: 12px; color: var(--muted); }
.det-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.det-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.det-nums > div { background: #faf5ee; border-radius: 12px; padding: 12px 14px; }
.det-nums span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.det-nums strong { font-family: var(--serif); font-size: 20px; }
.det-min { display: flex; gap: 8px; align-items: center; }
.det-min input[type=number] { width: 100px; padding: 6px 8px; }
@media (max-width: 640px) { .det-nums { grid-template-columns: minmax(0, 1fr); } .est-barra .busca input { width: 100%; } }
/* ---------- Dashboard simplificado ---------- */
.dash-barra { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.mes-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.mes-nav strong { min-width: 160px; text-align: center; font-family: var(--serif); font-size: 17px; }
.mes-nav strong::first-letter { text-transform: uppercase; }
.mes-nav button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg); font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); }
.mes-nav button:hover:not(:disabled) { background: var(--brasa); color: #fff; }
.mes-nav button:disabled { opacity: .35; cursor: not-allowed; }
.seg.escopo { flex-wrap: wrap; }
.seg.escopo button { display: inline-flex; align-items: center; gap: 8px; }
.seg.escopo .selo { box-shadow: none; }
.kpi2-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi2 { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi2::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cor); }
.kpi2-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.kpi2-ico { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--cor) 12%, #fff); color: var(--cor); }
.kpi2-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi2-t { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi2-v { font-family: var(--serif); font-size: clamp(21px, 1.9vw, 30px); font-weight: 600; line-height: 1.15; white-space: nowrap; }
.kpi2-s { font-size: 12px; color: var(--muted); }
.kpi2-quebra { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; }
.kpi2-quebra span { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.kpi2-quebra strong { margin-left: auto; color: var(--ink); }
.kpi2-quebra i, .ins-nome i { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dash-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
@media (max-width: 1100px) { .dash-grid2 { grid-template-columns: minmax(0, 1fr); } }
.vazio-mini { margin-top: 14px; padding: 34px 16px; text-align: center; color: var(--muted); background: #faf5ee; border: 1px dashed var(--line); border-radius: 14px; font-size: 14px; line-height: 1.6; }
.ins-topo { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ins-linhas { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.ins-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ins-nome { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; min-width: 90px; }
.ins-chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: #f3ece2; color: var(--muted); }
.ins-chip strong { color: var(--ink); }
.ins-frase { font-size: 13px; color: var(--ink); background: var(--amber-soft); padding: 6px 12px; border-radius: 999px; }
.kpi-link { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .15s; }
.kpi-link:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(29, 23, 20, .06), 0 12px 28px rgba(29, 23, 20, .12); }
.kpi-link.on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor) 30%, transparent), var(--shadow); }
.kpi-link:focus-visible { outline: 3px solid var(--brasa); outline-offset: 2px; }
.kpi-go { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--cor); }
.comp-toggle-wrap { margin-bottom: 18px; }
.comp-toggle { width: 100%; display: flex; align-items: center; gap: 16px; text-align: left; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .1s; }
.comp-toggle:hover { border-color: var(--brasa); }
.comp-toggle strong { display: block; font-family: var(--serif); font-size: 18px; }
.comp-toggle small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.comp-toggle-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--brasa-soft); color: var(--brasa); display: grid; place-items: center; flex: none; }
.comp-toggle-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.comp-chevron { margin-left: auto; font-size: 22px; color: var(--muted); transition: transform .2s; }
.comp-toggle[aria-expanded="true"] .comp-chevron { transform: rotate(180deg); }
.comp-painel { margin-top: 12px; }
.seg { display: inline-flex; background: #efe7dc; border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 9px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(29, 23, 20, .12); }
.comp-body.wide { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.stack-box { position: relative; height: 200px; }
.leitura { margin: 14px 0 0; padding: 10px 12px; background: #faf5ee; border-radius: 10px; font-size: 13px; line-height: 1.5; color: var(--ink); }
.comp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.comp-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: center; margin-top: 8px; }
.donut-box { position: relative; height: 280px; }
.comp-frase { font-family: var(--serif); font-size: 22px; line-height: 1.3; margin: 0 0 18px; }
.comp-lista { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; max-width: 420px; }
.comp-linha { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.comp-linha .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.comp-nome { flex: 1; font-weight: 500; }
.comp-linha strong { font-size: 18px; }
@media (max-width: 900px) { .comp-body, .comp-body.wide { grid-template-columns: minmax(0, 1fr); } .donut-box { height: 240px; } }
.var-up { color: var(--brasa); font-weight: 600; }
.var-down { color: var(--basil); font-weight: 600; }
.chart-box { position: relative; height: 320px; margin-top: 14px; }
.chart-box.sm { height: 260px; }
.legend-note { font-size: 13px; color: var(--muted); }

/* ---------- Modal, toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(29, 23, 20, .55); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 480px; padding: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); max-height: 90vh; overflow-y: auto; }
.modal.wide { max-width: 760px; }
.modal h2 { font-size: 24px; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.senha-box { font: 600 26px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; background: var(--ink); color: #fff; padding: 18px; border-radius: 12px; text-align: center; margin: 16px 0; user-select: all; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; animation: sobe .2s ease; }
.toast.erro { background: var(--brasa); color: #fff; margin: 0; }
@keyframes sobe { from { transform: translateY(8px); opacity: 0; } }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 12px; margin-bottom: 18px; background: var(--basil-soft); color: var(--basil); font-weight: 500; }
.banner.warn { background: var(--amber-soft); color: var(--amber); }
.sticky-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 14px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-radius: 0 0 var(--radius) var(--radius); }

@media (max-width: 960px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar button { background: none; border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: 8px; padding: 6px 10px; }
  .main { padding: 22px 16px 60px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 26px; }
  td input[type=number] { width: 96px; }
}

/* ================= Celular (Android e iPhone) ================= */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: rgba(184, 50, 30, .12); }
a, button, input, select, summary, label { touch-action: manipulation; }
.login-mobile-logo { display: none; }
.obs-det summary { display: none; }
.obs-det { display: contents; }
@supports not (aspect-ratio: 1) { .cal-dia { height: 38px; } } /* aparelhos antigos sem aspect-ratio */
@supports (height: 100dvh) { .login, .shell { min-height: 100dvh; } }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { min-width: 0; padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); }
  .side { top: 0; bottom: 0; left: 0; height: auto; overflow-y: auto; padding-bottom: calc(22px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  .shell.menu-aberto::after { content: ''; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(29, 23, 20, .55); z-index: 35; }
  .topbar { padding: calc(10px + env(safe-area-inset-top)) 16px 10px; min-height: 56px; }
  .topbar button { min-height: 40px; padding: 6px 16px; font-weight: 600; font-size: 15px; }
  .nav a { padding: 13px 14px; }
  .me .links button { padding: 8px 0; font-size: 14px; }
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 40px; padding: 8px 14px; }
  .page-head { margin-bottom: 16px; gap: 10px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 auto; }
  .toolbar { gap: 10px; }
  .toolbar .field { min-width: 0; flex: 1 1 100%; }
  .card-pad { padding: 16px; }
  .login-form-wrap { place-items: start center; padding: calc(36px + env(safe-area-inset-top)) 24px 32px; }
  .login-mobile-logo { display: block; width: 112px; height: 112px; border-radius: 50%; margin: 0 auto 24px; box-shadow: 0 10px 30px rgba(29, 23, 20, .35); }
  .login-form h2, .login-form > .muted { text-align: center; }
  /* janelas viram painéis que sobem de baixo */
  .overlay { top: 0; right: 0; bottom: 0; left: 0; place-items: end center; padding: 0; }
  .modal, .modal.wide { max-width: none; width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 22px 16px calc(20px + env(safe-area-inset-bottom)); }
  .modal h2 { font-size: 22px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; }
  #toasts { left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { white-space: nowrap; flex: none; }
  .seg.escopo { flex-wrap: wrap; overflow: visible; }
  /* barras fixas: abaixo da barra do topo e acima da área segura do iPhone */
  /* no celular a busca rola junto com a página (fixa, ela ocuparia quase 20% da tela) */
  .saida-bar, .est-barra { position: static; background: transparent; padding: 4px 0 10px; }
  .est-barra .busca, .est-barra select, .saida-bar .busca { flex: 1 1 100%; width: 100%; }
  .grupo-card { scroll-margin-top: calc(72px + env(safe-area-inset-top)); }
  .grupo-recolher { width: calc(100% - 24px); margin: 0 12px 14px; min-height: 46px; }
  .grupo-top { gap: 12px; min-height: 68px; }
  .grupo-sel { padding: 3px 9px; font-size: 11px; }
  .saida-acao { bottom: calc(10px + env(safe-area-inset-bottom)); padding: 12px 14px; gap: 10px; border-radius: 16px; }
  .saida-acao .acao-info { flex: 1 1 100%; min-width: 0; }
  .saida-acao .acao-info span { display: none; }
  .saida-acao #fechar-barra { display: none; }
  .obs-det { display: block; flex: 1 1 100%; }
  .obs-det summary { display: block; cursor: pointer; font-size: 13px; color: #cfc4ba; padding: 2px 0; }
  .obs-det input[type=text] { max-width: none; width: 100%; margin-top: 6px; }
  .saida-acao #lancar { flex: 1 1 auto; }
  .saida-hero { padding: 18px; gap: 14px; }
  .saida-hero h1 { font-size: 28px; }
  .hero-stats { width: 100%; }
  .stat { flex: 1 1 90px; min-width: 0; padding: 10px 12px; }
  .stat strong { font-size: 19px; }
  .kpi2-grid, .est-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi2 { padding: 14px; }
  .kpi2-v { font-size: 22px; }
  .kpi2-t { font-size: 12px; }
  .item-grid, .est-grid { grid-template-columns: minmax(0, 1fr); padding: 4px 12px 14px; }
  .grupo-top { padding: 14px; }
  .grupo-tit h3 { font-size: 18px; }
  .dash-barra { flex-direction: column; align-items: stretch; }
  .mes-nav { justify-content: space-between; }
  .mes-nav strong { min-width: 0; flex: 1; }
  .rel-datas { width: 100%; }
  .rel-datas input[type=date] { flex: 1; width: auto; min-width: 0; }
  .rel-hoje { padding: 16px; }
  .rel-hoje .btn, .rel-hoje .acoes { width: 100%; }
  .rel-hoje .acoes .btn { flex: 1; }
  #rel-cal { max-width: none; }
  .unid-card { min-width: 0; flex: 1 1 140px; padding: 12px; }
  .ult-card { max-width: none; }
  .det-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .det-nums > div { padding: 10px; }
  .det-nums strong { font-size: 17px; }
  .det-min { flex-direction: column; align-items: stretch; }
  .det-min input[type=number] { width: 100%; }
  /* alvos de toque confortáveis (recomendação: pelo menos 40–44 px) */
  .stepper button { width: 42px; height: 42px; }
  .stepper input[type=number] { height: 42px; width: 58px; }
  .pills button { min-height: 40px; }
  .cal-topo button, .mes-nav button { width: 40px; height: 40px; }
  .seg button { padding: 10px 13px; }
}

/* tabelas largas viram cartões (as células recebem o título da coluna via JavaScript) */
@media (max-width: 760px) {
  .tabela-cartoes thead { display: none; }
  .tabela-cartoes, .tabela-cartoes tbody { display: block; width: 100%; }
  .tabela-cartoes tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tabela-cartoes tr.cat { padding: 0; border: 0; }
  .tabela-cartoes tr.cat td { display: block; }
  .tabela-cartoes td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 5px 0; border: 0; text-align: right; }
  .tabela-cartoes td[data-label]::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; text-align: left; }
  .tabela-cartoes td:first-child { display: block; text-align: left; padding-top: 0; font-size: 16px; }
  .tabela-cartoes td:first-child::before { display: none; }
  .tabela-cartoes td.empty { display: block; text-align: center; }
  .tabela-cartoes td, .tabela-cartoes td .muted { white-space: normal; min-width: 0; overflow-wrap: anywhere; }
  .tabela-cartoes td:last-child:not([data-label]) { justify-content: flex-end; flex-wrap: wrap; padding-top: 10px; }
}

/* ---------- Login: logo interativa ---------- */
.login-art.interativa { position: relative; overflow: hidden; perspective: 900px; }
.login-art.interativa::before { content: ''; position: absolute; width: 90%; aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(184, 50, 30, .22), transparent 62%); animation: respira 6s ease-in-out infinite; pointer-events: none; }
.logo-palco { position: relative; width: 260px; height: 260px; display: grid; place-items: center; transform-style: preserve-3d; transition: transform .25s ease-out; will-change: transform; }
.logo-palco .anel { position: absolute; inset: -14px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 55%, #e0784a 78%, #f7d9b8 92%, transparent 100%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); animation: gira 9s linear infinite; }
.logo-palco .anel.b { inset: -30px; opacity: .45; animation-duration: 16s; animation-direction: reverse; }
.logo-palco img { width: 220px; height: 220px; border-radius: 50%; box-shadow: 0 0 0 10px rgba(247, 242, 235, .07), 0 0 0 11px rgba(247, 242, 235, .14), 0 30px 70px rgba(0, 0, 0, .6); transform: translateZ(40px); transition: box-shadow .3s; }
.logo-palco:hover img { box-shadow: 0 0 0 10px rgba(224, 120, 70, .12), 0 0 0 11px rgba(224, 120, 70, .4), 0 30px 80px rgba(184, 50, 30, .35); }
.logo-palco .brilho { position: absolute; width: 220px; height: 220px; border-radius: 50%; pointer-events: none; transform: translateZ(41px); background: radial-gradient(circle at var(--mx, 30%) var(--my, 25%), rgba(255, 255, 255, .22), transparent 45%); mix-blend-mode: soft-light; }
.brasas { position: absolute; inset: 0; pointer-events: none; }
.brasas i { position: absolute; bottom: -10px; width: var(--t); height: var(--t); border-radius: 50%; background: #f0a066; box-shadow: 0 0 8px 2px rgba(240, 130, 60, .6); opacity: 0; animation: sobe var(--d) linear var(--a) infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
@keyframes respira { 50% { opacity: .55; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes sobe { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .9; } 100% { transform: translate(var(--x), -105vh); opacity: 0; } }
.login-art .assinatura { position: absolute; bottom: 28px; left: 0; right: 0; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: rgba(247, 242, 235, .35); }
.login-form-wrap { background: radial-gradient(ellipse at 100% 0%, rgba(184, 50, 30, .06), transparent 55%), var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 40px 36px 34px; box-shadow: 0 2px 4px rgba(29, 23, 20, .04), 0 24px 60px rgba(29, 23, 20, .09); animation: entra .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entra { from { opacity: 0; transform: translateY(14px); } }
.login-card h2 { font-size: 30px; }
.login-form .campo-senha { position: relative; }
.login-form .campo-senha input[type=password], .login-form .campo-senha input[type=text] { padding-right: 46px; }
.login-form .ver { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.login-form .ver:hover { color: var(--ink); background: rgba(29, 23, 20, .06); }
.login-form .btn.block { height: 46px; font-weight: 600; transition: transform .15s, box-shadow .2s, background .2s; }
.login-form .btn.block:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(184, 50, 30, .3); }
.login-rodape { margin: 22px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .logo-palco .anel, .brasas i, .login-art.interativa::before { animation: none; } .logo-palco { transition: none; } }
@media (max-width: 960px) { .login-card { background: none; border: 0; box-shadow: none; padding: 0; animation: none; } }

/* ---------- Movimentações por usuário ---------- */
.usr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.usr-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 14px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; }
.usr-card:hover { transform: translateY(-2px); border-color: var(--brasa); box-shadow: 0 10px 26px rgba(29, 23, 20, .1); }
.usr-av { grid-row: span 2; width: 48px; height: 48px; border-radius: 50%; background: var(--brasa-soft); color: var(--brasa-dark); display: grid; place-items: center; font-weight: 700; font-family: var(--serif); }
.usr-info { display: flex; flex-direction: column; min-width: 0; }
.usr-info strong, .usr-info .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usr-info .muted { font-size: 12.5px; }
.usr-nums { grid-column: 1 / -1; display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; }
.usr-nums b { font-size: 20px; font-variant-numeric: tabular-nums; margin-right: 3px; }
.usr-ult { grid-column: 1 / -1; font-size: 12px; margin-top: 4px; }
.usr-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }

/* ---------- Menu lateral e perfil ---------- */
.side { background: linear-gradient(180deg, #221a16 0%, var(--ink) 55%); border-right: 1px solid rgba(255, 255, 255, .05); }
.side .brand { padding: 4px 10px 20px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.side-logo { box-shadow: 0 0 0 2px rgba(247, 242, 235, .14), 0 6px 18px rgba(0, 0, 0, .4); }
.nav { padding-right: 2px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.nav-group { display: flex; align-items: center; gap: 10px; padding: 20px 12px 8px; font-weight: 600; letter-spacing: .12em; color: #7f7269; }
.nav-group::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .07); }
.nav a { position: relative; padding: 10px 12px; border-radius: 11px; color: #cfc5bb; transition: background .18s, color .18s, transform .18s; }
.nav a svg { opacity: .75; transition: opacity .18s, transform .18s; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(2px); }
.nav a:hover svg { opacity: 1; transform: scale(1.08); }
.nav a.on { background: linear-gradient(90deg, rgba(184, 50, 30, .95), rgba(184, 50, 30, .72)); color: #fff; box-shadow: 0 6px 18px rgba(184, 50, 30, .28), inset 0 1px 0 rgba(255, 255, 255, .14); transform: none; }
.nav a.on svg { opacity: 1; }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: #f0a066; }
.nav a:focus-visible { outline: 2px solid #f0a066; outline-offset: 1px; }

.perfil { position: relative; margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.perfil-btn { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 1px solid transparent; border-radius: 13px; background: rgba(255, 255, 255, .04); color: #fff; cursor: pointer; text-align: left; transition: background .18s, border-color .18s; }
.perfil-btn:hover, .perfil.aberto .perfil-btn { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .12); }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, #d4553a, var(--brasa-dark)); box-shadow: 0 0 0 2px rgba(247, 242, 235, .16); }
.avatar.grande { width: 48px; height: 48px; font-size: 17px; }
.pb-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.pb-txt strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-txt span { font-size: 12px; color: #a89c92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-seta { flex: none; width: 16px; height: 16px; fill: none; stroke: #a89c92; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.perfil.aberto .pb-seta { transform: rotate(180deg); }
.perfil-pop { position: absolute; left: 0; right: 0; bottom: calc(100% - 4px); background: #2a211c; border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; padding: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); animation: pop .16s ease-out; z-index: 5; }
.perfil-pop[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.pp-topo { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.pp-topo strong { display: block; color: #fff; font-size: 14.5px; line-height: 1.25; }
.pp-papel { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 99px; background: rgba(240, 160, 102, .16); color: #f0a066; font-size: 11.5px; font-weight: 600; }
.pp-dados { margin: 12px 0 8px; font-size: 12.5px; }
.pp-dados dt { color: #8d8077; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-top: 8px; }
.pp-dados dd { margin: 2px 0 0; color: #ece4db; word-break: break-all; }
.pp-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 0; border-radius: 10px; background: none; color: #e4dad0; font-size: 14px; cursor: pointer; text-align: left; transition: background .15s; }
.pp-item:hover { background: rgba(255, 255, 255, .08); }
.pp-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pp-item.sair { color: #ff9a86; }
.pp-item.sair:hover { background: rgba(255, 110, 86, .14); }

/* ---------- Cartão de perfil (v2) ---------- */
.perfil-pop { padding: 0; overflow: hidden; background: #261e19; border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06); }
.pp-capa { height: 64px; position: relative; background: radial-gradient(circle at 85% -20%, rgba(240, 160, 102, .55), transparent 55%), linear-gradient(135deg, #b8321e, #6e1d10); }
.pp-capa::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 12px); }
.pp-status { position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: rgba(0, 0, 0, .32); color: #e9f6ee; font-size: 11px; font-weight: 600; backdrop-filter: blur(4px); }
.pp-status i { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.pp-id { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 16px 14px; margin-top: -26px; position: relative; }
.pp-id .avatar.grande { width: 58px; height: 58px; font-size: 20px; box-shadow: 0 0 0 4px #261e19, 0 8px 20px rgba(0, 0, 0, .4); }
.pp-id strong { margin-top: 9px; color: #fff; font-family: var(--serif); font-size: 17px; line-height: 1.2; }
.pp-id .pp-papel { margin-top: 6px; }
.pp-dados { list-style: none; margin: 0 12px; padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.pp-dados li { display: flex; align-items: center; gap: 11px; padding: 9px 4px; color: #efe7de; font-size: 13px; min-width: 0; }
.pp-dados li svg { flex: none; width: 32px; height: 32px; padding: 8px; border-radius: 9px; background: rgba(255, 255, 255, .06); fill: none; stroke: #f0a066; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pp-dados li > span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.pp-dados small { color: #8d8077; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; }
.pp-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px 12px; }
.pp-acoes .pp-item { justify-content: center; padding: 10px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); font-weight: 500; }
.pp-acoes .pp-item:hover { background: rgba(255, 255, 255, .1); }
.pp-acoes .pp-item.sair { border-color: rgba(255, 130, 106, .3); }
.pp-acoes .pp-item.sair:hover { background: rgba(255, 110, 86, .16); }
.pp-acoes { grid-template-columns: 1.35fr 1fr; }
.pp-acoes .pp-item { white-space: nowrap; font-size: 13px; gap: 7px; padding: 10px 6px; }
.pp-acoes .pp-item svg { width: 15px; height: 15px; }

.btn.perigo { color: #b8321e; border-color: rgba(184, 50, 30, .35); }
.btn.perigo:hover { background: var(--brasa-soft); }

/* ---------- Estoque: escolha da pizzaria e saldo crítico ---------- */
.est-escolha { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.est-escolha .unid-card { padding: 26px 18px 20px; }
.est-escolha .unid-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(29, 23, 20, .12); border-color: var(--brasa); }
.unid-info { display: block; margin-top: 8px; font-size: 12.5px; color: var(--basil); font-weight: 600; }
.unid-info.critico { color: #c0261a; }
.est-voltar { margin-bottom: 10px; }
.est-saldo.critico strong, strong.critico { color: #c0261a; }
