/* Nexo Stock — complementos ao app.css do Nexo */
.icon-btn { background: none; border: 0; cursor: pointer; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.brand-sm .gold { color: var(--gold-2); font-weight: 700; }
.nav-sec { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #9aa3ad; padding: 14px 12px 4px; }
.nav-sec:first-child { padding-top: 2px; }
.user-menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 42px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md);
  min-width: 230px; padding: 6px; z-index: 60; }
.menu-pop .head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-pop a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); cursor: pointer; }
.menu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop svg { width: 16px; height: 16px; color: var(--muted); }

.tipo-badge { font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: .02em; }
.badge.gold { background: var(--gold-soft); color: var(--gold-2); border-color: transparent; }
.kpi-ic { position: absolute; right: 16px; top: 18px; width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.kpi-ic svg { width: 19px; height: 19px; }
.kpi-ic.gold { background: var(--gold-soft); color: var(--gold-2); }
.kpi-ic.red { background: var(--red-soft); color: var(--red); }
.kpi-ic.amber { background: var(--amber-soft); color: var(--amber); }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); transition: transform var(--t), box-shadow var(--t); }
.quick a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.quick a i { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-style: normal; flex: none; }
.quick a i svg { width: 17px; height: 17px; }
.quick .in i { background: var(--green-soft); color: var(--green); }
.quick .out i { background: var(--red-soft); color: var(--red); }
.quick .tr i { background: var(--primary-soft); color: var(--primary); }
.quick .inv i { background: var(--gold-soft); color: var(--gold-2); }
.chart-svg { width: 100%; height: 220px; display: block; }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* editor de documentos */
.add-bar { display: flex; gap: 8px; align-items: end; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin: 16px 0 12px; flex-wrap: wrap; }
.add-bar .field { flex: 1; min-width: 220px; }
.add-bar .field.q { flex: 0 0 110px; min-width: 90px; }
table.t.lines td { padding: 6px 8px; }
table.t.lines input.input { width: 100%; min-width: 70px; text-align: right; }
table.t.lines td.desc input.input { text-align: left; min-width: 200px; }
.totais { display: flex; justify-content: flex-end; margin-top: 14px; }
.totais table { min-width: 300px; border-collapse: collapse; }
.totais td { padding: 5px 10px; }
.totais tr.g td { font-size: 1.15rem; font-weight: 800; color: var(--primary); border-top: 2px solid var(--border-2); padding-top: 9px; }
.doc-head { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 16px; }
.doc-head .box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
.doc-head .box .label { margin-bottom: 4px; }
@media (max-width: 760px) { .doc-head { grid-template-columns: 1fr; } }
.anulado-banner { background: var(--red-soft); color: var(--red); border: 1px solid #f0b4b4; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.diff-pos { color: var(--green); font-weight: 700; }
.diff-neg { color: var(--red); font-weight: 700; }
.pick-list { max-height: 420px; overflow: auto; }
tr.sel td { background: var(--gold-soft) !important; }
.kbd { font-family: ui-monospace, Consolas, monospace; font-size: .75rem; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .field { min-width: 140px; }
.filters .field.grow { flex: 1; min-width: 200px; }
.count { color: var(--muted); font-size: .85rem; }
.seg.tipos button { padding: 6px 12px; font-size: .85rem; }
@media (max-width: 700px) { .seg.tipos { overflow-x: auto; max-width: 100%; } }
.login-card .brand { margin-bottom: 28px; }
.login-card h2 { margin-bottom: 4px; }
.login-demo { margin-top: 18px; padding: 10px 12px; border: 1px dashed var(--border-2); border-radius: 10px; font-size: .82rem; color: var(--muted); }

/* ponto de venda */
.pos-wrap { display: grid; grid-template-columns: 1fr 380px; gap: 16px; height: calc(100vh - var(--topbar) - 40px); }
.pos-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pos-top { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pos-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 0 12px; }
.pos-search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.pos-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pos-search input { border: 0; outline: 0; background: none; flex: 1; padding: 11px 0; font-size: 1rem; }
.pos-fams { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
.pos-fams button { border: 1px solid var(--border-2); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pos-fams button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; padding: 2px; }
.pos-tile { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  min-height: 112px; box-shadow: var(--shadow-xs); transition: transform var(--t), box-shadow var(--t), border-color var(--t); position: relative; overflow: hidden; }
.pos-tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--gold)); }
.pos-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gold); }
.pos-tile:active { transform: scale(.98); }
.pos-tile .d { font-weight: 600; font-size: .86rem; line-height: 1.25; flex: 1; }
.pos-tile .c { font-size: .72rem; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.pos-tile .p { font-weight: 800; color: var(--primary); }
.pos-tile .s { font-size: .74rem; color: var(--green); font-weight: 600; }
.pos-tile.zero { opacity: .55; } .pos-tile.zero .s { color: var(--red); }
.pos-cart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pos-cart-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-size: 1.05rem; }
.pos-lines { flex: 1; overflow-y: auto; border-top: 1px solid var(--border); }
.pos-line { display: grid; grid-template-columns: 1fr auto 90px; gap: 8px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.pos-line .i { display: flex; flex-direction: column; min-width: 0; } .pos-line .i b { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-line .q { display: flex; align-items: center; gap: 6px; } .pos-line .q span { min-width: 22px; text-align: center; font-weight: 700; }
.pos-line .q button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.pos-line .q svg { width: 14px; height: 14px; }
.pos-line .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-tot { padding: 10px 14px; background: var(--surface-2); border-top: 1px solid var(--border); }
.pos-tot div { display: flex; justify-content: space-between; padding: 2px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.pos-tot .g { color: var(--primary); font-size: 1.45rem; font-weight: 800; padding-top: 6px; }
.pos-pay { margin: 12px 14px 14px; border: 0; border-radius: 12px; padding: 15px; font-size: 1.1rem; font-weight: 800; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #16314c, var(--primary)); box-shadow: inset 0 -3px 0 var(--gold); }
.pos-pay:disabled { opacity: .45; cursor: not-allowed; }
.pos-pay .kbd { color: var(--primary); }
.pos-pay-total { text-align: center; font-size: 2.2rem; font-weight: 800; color: var(--primary); margin: 4px 0 16px; font-variant-numeric: tabular-nums; }
.pos-meios { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.pos-meios button { border: 1px solid var(--border-2); background: var(--surface); border-radius: 10px; padding: 11px 8px; font-weight: 600; cursor: pointer; }
.pos-meios button.on { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: inset 0 -2px 0 var(--gold); }
.pos-sug { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pos-troco { margin-top: 12px; font-size: 1.1rem; text-align: right; }
@media (max-width: 900px) { .pos-wrap { grid-template-columns: 1fr; height: auto; } .pos-grid { max-height: 50vh; } .pos-cart { min-height: 420px; } }

/* mapa de stock por armazém */
.arm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.arm-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: .82rem;
  box-shadow: var(--shadow-xs); transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.arm-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.arm-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(185,154,88,.35), var(--shadow); background: linear-gradient(180deg, var(--gold-soft), var(--surface) 60%); }
.arm-card .h { display: flex; flex-direction: column; margin-bottom: 6px; }
.arm-card .h b { color: var(--primary); font-size: .95rem; }
.arm-card .h span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arm-card .r { display: flex; justify-content: space-between; padding: 1px 0; font-variant-numeric: tabular-nums; }
.arm-card .r span { color: var(--muted); }
.arm-card .r.f { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 5px; font-size: .9rem; }
.arm-card .r.f b { color: var(--primary); }
table.t.mapa td.pos, table.t.mapa td.neg { font-weight: 600; }

.page-head { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 900px) { .page-head .btn span { display: none; } }

/* restauração: eventos / caixa diária */
.ev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 1100px) { .ev-grid { grid-template-columns: 1fr; } }
.ev-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.ev-h { background: #11283F; color: #F7F5F0; font-weight: 700; padding: 9px 14px; font-size: .9rem; letter-spacing: .02em; box-shadow: inset 0 -2px 0 var(--gold); }
.ev-card > .field, .ev-card > .tpa-grid, .ev-card > div:not(.ev-h):not(.ev-res), .ev-card > button { margin-left: 14px; margin-right: 14px; }
.ev-card > .field { margin-top: 12px; }
.ev-card > button, .ev-card > div[style*="display:flex"] { margin-bottom: 12px; }
table.t.ev-t td { padding: 5px 10px; }
table.t.ev-t input.input { padding: 5px 8px; }
table.t.ev-t input.kzi, .tpa-grid input.kzi { text-align: right; font-variant-numeric: tabular-nums; }
table.t.ev-t tfoot td { font-size: .86rem; }
.tpa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tpa-tot > div { padding: 7px 9px; background: var(--gold-soft); border-radius: 6px; text-align: right; color: var(--primary); }
.ev-res { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 14px 14px; }
.ev-res > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.ev-res span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.ev-res b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ev-res .pos b { color: var(--green); } .ev-res .neg b { color: var(--red); }
@media (max-width: 760px) { .ev-res { grid-template-columns: 1fr 1fr; } }
.anx { display: flex; flex-wrap: wrap; gap: 6px; }

/* modo híbrido: indicador de sincronização */
.sync-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); margin-right: 6px; }
.sync-chip:hover { text-decoration: none; background: var(--surface); }
.sync-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-chip.ok i { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.sync-chip.pend i { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.sync-chip.err { color: var(--red); border-color: #f0b4b4; } .sync-chip.err i { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
@media (max-width: 700px) { .sync-chip span { display: none; } }
.seg button { flex: 1; }

.sync-chip[hidden] { display: none !important; }
/* topo nunca transborda: o nome da empresa encolhe */
.topbar { min-width: 0; }
.topbar .emp-chip { min-width: 0; flex: 0 1 auto; }
.topbar .emp-chip select { max-width: 320px; min-width: 0; text-overflow: ellipsis; }
@media (max-width: 700px) { .topbar .emp-chip > svg, .topbar .brand-sm .gold { display: none; } .topbar .emp-chip select { max-width: 42vw; } .topbar { gap: 6px; padding: 0 10px; } }
.topbar .emp-chip > svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
