:root {
  color-scheme: light;
  --gold: #c9a227;
  --gold-dark: #8a6b17;
  --gold-soft: #fbf1d6;
  --ink: #211c10;
  --muted: #756e5e;
  --line: #e5dec8;
  --surface: #ffffff;
  --canvas: #f7f4ea;
  --danger: #b93f34;
  --danger-soft: #fbeae8;
  --success: #2e7650;
  --success-soft: #e8f5ed;
  --warning: #946414;
  --warning-soft: #fff3da;
  --shadow: 0 12px 35px rgba(66, 52, 20, 0.08);
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }
a { color: inherit; }

.loading-screen { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--gold-dark); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--gold-soft); border-top-color: var(--gold-dark); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  min-height: 64px; padding: 10px clamp(14px, 3vw, 26px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  color: white; background: linear-gradient(135deg, #7a5d12, var(--gold-dark));
  box-shadow: 0 6px 22px rgba(54, 39, 5, .16);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; font-size: 21px; }
.brand-copy { min-width: 0; }
.brand-name { font-family: "Segoe UI", Arial, Helvetica, sans-serif; font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-subtitle { margin-top: 2px; font-size: 11px; opacity: .75; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.operator { text-align: right; line-height: 1.2; }
.operator strong { display: block; font-size: 13px; }
.operator span { font-size: 11px; opacity: .72; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #80dda5; box-shadow: 0 0 0 4px rgba(128,221,165,.16); }
.status-dot.offline { background: #ff9a8f; box-shadow: 0 0 0 4px rgba(255,154,143,.16); }

.workspace { width: 100%; max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { padding: 20px 12px 28px; border-right: 1px solid var(--line); background: rgba(255,255,255,.48); min-height: calc(100vh - 64px); }
.nav-list { display: grid; gap: 5px; position: sticky; top: 84px; }
.nav-item {
  border: 0; background: transparent; color: var(--muted); min-height: 44px; padding: 10px 13px;
  display: flex; align-items: center; gap: 10px; border-radius: 11px; cursor: pointer; font-weight: 700; text-align: left;
}
.nav-item:hover { background: var(--gold-soft); color: var(--gold-dark); }
.nav-item.active { color: white; background: var(--gold-dark); box-shadow: 0 8px 18px rgba(138,107,23,.18); }
.nav-icon { width: 23px; text-align: center; font-size: 18px; }
.main { min-width: 0; padding: clamp(14px, 2.4vw, 28px) clamp(12px, 2.8vw, 32px) 100px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-title { margin: 0; font: 700 clamp(24px, 3vw, 32px)/1.1 "Segoe UI", Arial, Helvetica, sans-serif; letter-spacing: -.02em; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-subtitle { color: var(--muted); font-size: 12px; }
.stat { min-height: 120px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -18px; bottom: -28px; width: 90px; height: 90px; border-radius: 50%; background: var(--gold-soft); }
.stat-label { position: relative; z-index: 1; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 700; color: var(--muted); }
.stat-value { position: relative; z-index: 1; margin-top: 10px; font: 700 clamp(22px, 2.4vw, 29px)/1.1 "Segoe UI", Arial, Helvetica, sans-serif; color: var(--gold-dark); }
.stat-detail { position: relative; z-index: 1; margin-top: 8px; font-size: 12px; color: var(--muted); }

.btn {
  min-height: 42px; padding: 9px 15px; border-radius: 11px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-weight: 700; font-size: 13px;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:hover { filter: brightness(.96); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { color: white; background: var(--gold-dark); }
.btn-secondary { color: var(--gold-dark); background: var(--gold-soft); border-color: #ead69d; }
.btn-ghost { color: var(--muted); background: white; border-color: var(--line); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: #f0c2bd; }
.btn-success { color: var(--success); background: var(--success-soft); border-color: #bce1ca; }
.btn-sm { min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 12px; }
.btn-icon { width: 40px; padding: 0; }
.btn-block { width: 100%; }

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 12px; }
.label { color: var(--muted); font-size: 12px; font-weight: 700; }
.input, .select, .textarea {
  width: 100%; min-height: 43px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  color: var(--ink); background: white; outline: none;
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(138,107,23,.11); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 42px; font-size: 13px; color: var(--muted); }

.searchbar { position: relative; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:8px; }
.searchbar .input { padding-left: 12px; min-width:0; }
.search-icon { position: static; transform:none; display:inline-flex; align-items:center; justify-content:center; width:18px; color: var(--muted); pointer-events: none; }
.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .searchbar { flex: 1 1 260px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 999px; min-height: 36px; padding: 7px 12px; background: white; color: var(--muted); cursor: pointer; font-weight: 700; font-size: 12px; }
.chip.active { border-color: var(--gold-dark); background: var(--gold-dark); color: white; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: #fbfaf5; }
tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mobile-list { display: none; gap: 10px; }
.list-card { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.list-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.list-card-title { font-weight: 700; font-size: 14px; }
.list-card-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.list-card-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Histórico de perdas deve permanecer visível também no iPad em paisagem e no desktop. */
.loss-history-list { display: grid; gap: 10px; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 9px; white-space: nowrap; font-size: 11px; font-weight: 700; }
.badge-ok { color: var(--success); background: var(--success-soft); }
.badge-low { color: var(--danger); background: var(--danger-soft); }
.badge-warn { color: var(--warning); background: var(--warning-soft); }
.badge-neutral { color: var(--muted); background: #f1eee5; }
.money, .number { font-family: "Segoe UI", Arial, Helvetica, sans-serif; font-variant-numeric: tabular-nums; }
.money { font-weight: 700; }
.muted { color: var(--muted); }
.danger { color: var(--danger); }
.success { color: var(--success); }

.empty { padding: 42px 20px; display: grid; place-items: center; gap: 8px; text-align: center; color: var(--muted); }
.empty-icon { font-size: 30px; opacity: .62; }
.alert { border: 1px solid; border-radius: 12px; padding: 11px 13px; display: flex; align-items: flex-start; gap: 9px; font-size: 13px; }
.alert-warning { color: #7c5515; border-color: #eed496; background: var(--warning-soft); }
.alert-danger { color: #8d332b; border-color: #efc1bc; background: var(--danger-soft); }
.alert-success { color: #266543; border-color: #bfe0cb; background: var(--success-soft); }

.pdv-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(360px,.85fr); gap: 16px; align-items: start; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 10px; }
.product-tile { border: 1px solid var(--line); border-radius: 13px; padding: 13px; background: white; display: grid; gap: 10px; min-height: 132px; }
.product-tile:hover { border-color: var(--gold); box-shadow: 0 8px 20px rgba(82,65,24,.08); }
.product-name { font-weight: 700; font-size: 14px; }
.product-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.product-price { color: var(--gold-dark); font: 700 16px "Segoe UI", Arial, Helvetica, sans-serif; }
.product-actions { display: flex; gap: 7px; align-items: center; justify-content: space-between; margin-top: auto; }
.receipt { position: sticky; top: 82px; background: white; border: 1px solid var(--line); border-top: 2px dashed #d6cda9; border-bottom: 2px dashed #d6cda9; border-radius: 13px; padding: 16px; box-shadow: var(--shadow); }
.receipt-title { text-align: center; text-transform: uppercase; letter-spacing: .12em; font: 700 12px ui-monospace, monospace; color: var(--muted); margin-bottom: 10px; }
.cart-list { display: grid; gap: 2px; max-height: 330px; overflow: auto; overscroll-behavior: contain; }
.cart-item { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cart-item-name { font-size: 13px; font-weight: 700; }
.cart-item-meta { margin-top: 3px; color: var(--muted); font-size: 11px; }
.qty-control { display: inline-flex; align-items: center; gap: 5px; }
.qty-btn { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #faf8f2; cursor: pointer; font-weight: 700; }
.cart-total { margin-top: 10px; padding-top: 12px; border-top: 2px solid var(--ink); display: flex; align-items: center; justify-content: space-between; font-size: 18px; font-weight: 700; }
.payment-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.list-row { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.list-row:last-child { border-bottom: 0; }
.list-row-main { min-width: 0; }
.list-row-title { font-weight: 700; font-size: 13px; }
.list-row-sub { margin-top: 3px; color: var(--muted); font-size: 11px; }

.bar-list { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(130px, 2fr) auto; align-items: center; gap: 10px; }
.bar-label { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; border-radius: 999px; background: #eee9d9; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-dark)); }
.bar-value { font: 700 11px "Segoe UI", Arial, Helvetica, sans-serif; color: var(--muted); }

.modal-overlay { position: fixed; inset: 0; z-index: 100; padding: 18px; display: grid; place-items: center; background: rgba(31,27,16,.58); backdrop-filter: blur(4px); }
.modal { width: min(640px, 100%); max-height: min(90vh, 900px); overflow: auto; background: white; border-radius: 18px; box-shadow: 0 25px 80px rgba(0,0,0,.28); }
.modal.wide { width: min(860px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; padding: 16px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { font: 700 19px "Segoe UI", Arial, Helvetica, sans-serif; }
.modal-body { padding: 18px; }
.modal-actions { margin-top: 17px; display: flex; gap: 9px; justify-content: flex-end; }
.purchase-row { display: grid; grid-template-columns: minmax(0,1.5fr) .7fr .8fr auto; gap: 8px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }

.toast { position: fixed; z-index: 150; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); max-width: min(92vw, 540px); padding: 12px 16px; border-radius: 11px; color: white; background: #29251a; box-shadow: 0 12px 35px rgba(0,0,0,.25); display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
.offline-banner { position: sticky; top: 64px; z-index: 29; padding: 7px 12px; text-align: center; background: var(--danger); color: white; font-size: 12px; font-weight: 700; }

.bottom-nav { display: none; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 6px 5px calc(6px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.bottom-nav-inner { display: flex; justify-content: space-around; max-width: 620px; margin: 0 auto; }
.bottom-item { min-width: 58px; min-height: 51px; padding: 5px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 10px; font-weight: 700; }
.bottom-item span:first-child { font-size: 19px; line-height: 1; }
.bottom-item.active { color: var(--gold-dark); background: var(--gold-soft); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pdv-grid { grid-template-columns: minmax(0,1fr) 360px; }
}

@media (max-width: 860px) {
  .workspace { display: block; }
  .sidebar { display: none; }
  .bottom-nav { display: block; }
  .main { padding-bottom: calc(88px + var(--safe-bottom)); }
  .pdv-grid { grid-template-columns: 1fr; }
  .receipt { position: static; }
  .operator span { display: none; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px) {
  .topbar { min-height: 58px; padding: 8px 12px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: 16px; max-width: 48vw; }
  .brand-subtitle { display: none; }
  .operator { display: none; }
  .main { padding: 14px 11px calc(84px + var(--safe-bottom)); }
  .page-head { align-items: stretch; flex-direction: column; margin-bottom: 14px; }
  .page-title { font-size: 25px; }
  .page-actions { justify-content: stretch; }
  .page-actions .btn { flex: 1; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-mobile-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats-mobile-2 .stat { min-height: 105px; padding: 14px; }
  .stats-mobile-2 .stat-value { font-size: 19px; }
  .card { padding: 14px; border-radius: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .table-wrap { display: none; }
  .mobile-list { display: grid; }
  .product-grid { grid-template-columns: 1fr; }
  .product-tile { min-height: 0; }
  .cart-list { max-height: none; }
  .modal-overlay { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 94vh; border-radius: 19px 19px 0 0; }
  .modal-actions { position: sticky; bottom: -18px; margin-left: -18px; margin-right: -18px; padding: 12px 18px calc(12px + var(--safe-bottom)); background: white; border-top: 1px solid var(--line); }
  .modal-actions .btn { flex: 1; }
  .purchase-row { grid-template-columns: 1fr 1fr; }
  .purchase-row .purchase-product { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: 95px 1fr auto; gap: 7px; }
  .toast { bottom: calc(76px + var(--safe-bottom)); }
}

@media print {
  .topbar, .sidebar, .bottom-nav, .page-actions, .btn, .toolbar { display: none !important; }
  .workspace { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ===== Versão 0.2: login, teclado, compras e relatórios ===== */
.kbd { display:inline-flex; align-items:center; justify-content:center; min-width:25px; height:21px; padding:0 6px; border:1px solid currentColor; border-radius:6px; font:700 10px ui-monospace,monospace; opacity:.8; white-space:nowrap; }
.nav-item .kbd { margin-left:auto; }
.nav-item.keyboard-focus:not(.active) { outline:2px solid var(--gold); outline-offset:1px; background:var(--gold-soft); color:var(--gold-dark); }
.nav-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar-logout { width:34px; height:34px; border:1px solid rgba(255,255,255,.2); border-radius:10px; color:#fff; background:rgba(255,255,255,.12); cursor:pointer; font-size:18px; }
.login-page { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(135deg,#75570d,#a9851a); }
.login-card { width:min(390px,100%); background:#fff; padding:28px; border-radius:22px; box-shadow:0 28px 80px rgba(0,0,0,.28); }
.login-card h1 { margin:12px 0 5px; font:700 26px "Segoe UI",Arial,Helvetica,sans-serif; }
.login-card p { margin:0 0 20px; color:var(--muted); }
.login-logo { color:#fff; background:var(--gold-dark); }
.demo-credentials { margin-top:16px; padding:12px; border-radius:12px; background:var(--gold-soft); display:grid; gap:3px; font-size:12px; color:var(--gold-dark); }
.pos-main-input { min-height:52px; font-size:17px; font-weight:700; }
.pdv-idle { min-height:150px; display:grid; place-items:center; text-align:center; color:var(--muted); border:1px dashed var(--line); border-radius:14px; background:rgba(255,255,255,.45); padding:24px; }
.search-results { display:grid; gap:8px; }
.search-result { width:100%; border:1px solid var(--line); background:#fff; border-radius:12px; padding:12px; display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:12px; text-align:left; cursor:pointer; color:var(--ink); }
.search-result strong { display:block; font-size:14px; }
.search-result span { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.search-result.selected { border-color:var(--gold-dark); box-shadow:0 0 0 3px rgba(138,107,23,.12); background:#fffdf5; }
.result-box { margin:0 !important; padding:6px 9px; border-radius:8px; border:1px solid var(--line); color:var(--gold-dark)!important; font-weight:700; }
.multiplier-banner { margin-bottom:12px; padding:12px 14px; display:flex; align-items:center; gap:10px; border:1px solid #e0c77c; border-radius:12px; background:var(--gold-soft); color:var(--gold-dark); }
.multiplier-banner strong { font:700 20px "Segoe UI",Arial,Helvetica,sans-serif; }
.multiplier-banner span { margin-left:auto; font-size:12px; }
.shortcut-strip { margin-top:12px; padding:9px 11px; border-radius:10px; background:#efeade; color:var(--muted); font-size:11px; display:flex; gap:7px; flex-wrap:wrap; align-items:center; }
.shortcut-strip.centered { justify-content:center; }
.payment-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:7px; }
.payment-grid .chip { border-radius:10px; justify-content:flex-start; display:flex; gap:7px; align-items:center; }
.selected-customer,.selected-token { margin-top:7px; padding:9px 10px; border:1px solid #bfe0cb; background:var(--success-soft); border-radius:10px; display:flex; align-items:center; gap:8px; }
.selected-customer { justify-content:space-between; }
.selected-customer strong,.selected-customer span { display:block; }
.selected-customer span { color:var(--muted); font-size:11px; }
.selected-customer button,.selected-token button { margin-left:auto; border:0; background:transparent; cursor:pointer; font-size:18px; }
.mini-results { position:relative; z-index:5; margin-top:5px; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#fff; box-shadow:var(--shadow); display:grid; }
.mini-results button { border:0; border-bottom:1px solid var(--line); background:#fff; padding:10px 12px; text-align:left; cursor:pointer; color:var(--ink); }
.mini-results button:last-child { border-bottom:0; }
.mini-results button:hover { background:var(--gold-soft); }
.mini-results strong,.mini-results span { display:block; }
.mini-results span { color:var(--muted); font-size:11px; margin-top:3px; }
.cart-item.selected-line { background:var(--gold-soft); border-radius:9px; padding-left:6px; padding-right:6px; }
.line-number { width:29px; height:29px; border-radius:8px; background:#eee9d9; display:grid; place-items:center; font:700 11px "Segoe UI",Arial,Helvetica,sans-serif; color:var(--gold-dark); }
.receipt .cart-item { grid-template-columns:auto minmax(0,1fr) auto; cursor:pointer; }
.inline-search { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:7px; }
.inline-search .btn:nth-last-child(1):not(:first-child) { }
.purchase-layout { display:grid; gap:15px; }
.modal.xwide { width:min(1120px,100%); }
.purchase-head-grid { display:grid; grid-template-columns:1.4fr 1fr; gap:12px; align-items:start; }
.compact-field { max-width:430px; }
.payable-box,.purchase-entry,.purchase-items,.purchase-summary { border:1px solid var(--line); border-radius:14px; padding:14px; background:#fff; }
.payable-box { background:var(--warning-soft); }
.payable-box h3,.purchase-entry h3,.purchase-items h3 { margin:0 0 12px; font-size:14px; }
.purchase-item-grid { display:grid; grid-template-columns:1.6fr .6fr .55fr .7fr .65fr .75fr; gap:9px; align-items:end; }
.purchase-product { min-width:0; }
.purchase-preview { margin:12px 0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; }
.purchase-preview button { border:1px solid var(--line); border-radius:10px; background:#faf8f2; padding:9px; text-align:left; color:var(--ink); }
.purchase-preview span,.purchase-preview b { display:block; }
.purchase-preview span { color:var(--muted); font-size:10px; }
.purchase-preview b { margin-top:3px; font-size:12px; }
.price-review { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:9px; align-items:end; margin-bottom:12px; }
.margin-chip { min-height:43px; display:flex; align-items:center; padding:9px 11px; border-radius:10px; background:var(--success-soft); color:var(--success); font-weight:700; font-size:12px; }
.danger-bg { background:var(--danger-soft); color:var(--danger); }
.compact-table { display:grid; gap:4px; max-height:290px; overflow:auto; }
.compact-row { display:grid; grid-template-columns:34px minmax(0,1fr) auto 32px 32px; gap:8px; align-items:center; padding:8px; border:1px solid var(--line); border-radius:9px; }
.compact-row > span { font:700 11px "Segoe UI",Arial,Helvetica,sans-serif; color:var(--gold-dark); }
.compact-row strong,.compact-row small { display:block; }
.compact-row small { margin-top:2px; color:var(--muted); }
.compact-row button { border:0; width:30px; height:30px; border-radius:7px; background:#f3efe3; cursor:pointer; }
.summary-totals { margin-top:12px; display:flex; gap:18px; flex-wrap:wrap; justify-content:flex-end; font-family:"Segoe UI",Arial,Helvetica,sans-serif; }
.margin-preview { margin:12px 0; padding:10px; border-radius:10px; background:var(--gold-soft); color:var(--gold-dark); font-weight:700; font-size:12px; }
.scale-box { border:1px solid var(--line); border-radius:12px; padding:12px; margin-bottom:12px; }
.photo-preview { display:block; max-width:180px; max-height:140px; object-fit:cover; border-radius:10px; margin-top:8px; border:1px solid var(--line); }
.compact-input { width:auto; min-width:155px; }
.dre { display:grid; }
.dre > div { display:flex; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px solid var(--line); }
.dre .sub { color:var(--muted); padding-left:12px; }
.dre .strong { font-weight:700; }
.dre .total { margin-top:5px; padding:12px; border-radius:10px; background:var(--gold-soft); color:var(--gold-dark); font-size:15px; font-weight:700; }
.month-chart { height:250px; display:flex; align-items:end; gap:7px; padding-top:15px; }
.month-col { height:100%; flex:1; min-width:18px; display:grid; grid-template-rows:1fr auto; gap:6px; text-align:center; }
.month-bar { min-height:0; display:flex; align-items:end; justify-content:center; background:#f3efe3; border-radius:7px 7px 3px 3px; overflow:hidden; }
.month-bar i { width:100%; display:block; background:linear-gradient(180deg,var(--gold),var(--gold-dark)); border-radius:6px 6px 0 0; }
.month-col span { font-size:9px; color:var(--muted); text-transform:uppercase; }
.report-total { margin-top:12px; padding:12px; border-top:2px solid var(--ink); text-align:right; font-size:17px; font-weight:700; }
.exchange-balance { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:12px 0; }
.exchange-balance > * { padding:10px; border:1px solid var(--line); border-radius:10px; background:#faf8f2; }
.receipt-document { max-width:430px; margin:auto; font-family:Consolas,"Courier New",monospace; }
.receipt-store { text-align:center; font:700 19px "Segoe UI",Arial,Helvetica,sans-serif; margin-bottom:5px; }
.receipt-row,.receipt-grand { display:flex; justify-content:space-between; gap:10px; padding:6px 0; border-bottom:1px dashed var(--line); }
.receipt-grand { margin-top:8px; padding-top:10px; border-top:2px solid var(--ink); font-size:17px; }
.signature-line { margin:46px auto 0; padding-top:6px; width:80%; border-top:1px solid var(--ink); text-align:center; font-size:11px; }

@media (max-width: 900px) {
  .purchase-head-grid { grid-template-columns:1fr; }
  .purchase-item-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .purchase-product { grid-column:1/-1; }
  .purchase-preview { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .price-review { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .payment-grid { grid-template-columns:1fr 1fr; }
  .search-result { grid-template-columns:minmax(0,1fr) auto; }
  .search-result .result-box { grid-column:1/-1; }
  .inline-search { grid-template-columns:minmax(0,1fr) auto auto; }
  .purchase-item-grid,.price-review { grid-template-columns:1fr; }
  .purchase-preview { grid-template-columns:1fr 1fr; }
  .compact-row { grid-template-columns:28px minmax(0,1fr) auto 28px 28px; gap:5px; padding:7px 5px; }
  .exchange-balance { grid-template-columns:1fr; }
  .month-chart { height:190px; gap:3px; }
  .month-col span { font-size:8px; writing-mode:vertical-rl; transform:rotate(180deg); }
}
@media print {
  body * { visibility:hidden; }
  .print-area,.print-area * { visibility:visible; }
  .print-area { position:absolute; left:0; top:0; width:100%; }
  .modal-overlay { position:static; padding:0; background:#fff; }
  .modal { box-shadow:none; max-height:none; overflow:visible; }
  .modal-head,.modal-actions,.shortcut-strip { display:none!important; }
}

/* ===== Versão 0.3: mobile acionável, caixas vinculadas e modo offline ===== */
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.offline-banner.syncing { background: #7b651f; }
.mobile-pdv-actions { display: none; gap: 8px; margin-top: 12px; position: sticky; bottom: calc(72px + var(--safe-bottom)); z-index: 10; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.mobile-pdv-actions button { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-weight: 700; }
.mobile-pdv-actions button.primary { background: var(--gold-dark); color: white; border-color: var(--gold-dark); }
.mobile-pdv-actions button:disabled { opacity: .45; }
.action-menu { position: relative; }
.action-menu summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-weight: 700; color: var(--gold-dark); background: var(--gold-soft); }
.action-menu summary::-webkit-details-marker { display:none; }
.action-menu[open] > div { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); display: grid; }
.action-menu button { border: 0; background: white; padding: 10px; text-align: left; border-radius: 7px; font-weight: 700; color: var(--ink); }
.action-menu button:hover { background: var(--gold-soft); }
.action-menu button.danger { color: var(--danger); }
.box-link-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: #fffdf7; }
.toggle-row { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; margin-bottom: 12px; }
.toggle-row input { width: 20px; height: 20px; }
.toggle-pill { display: inline-grid; place-items: center; min-width: 42px; height: 30px; padding: 0 9px; border-radius: 999px; background: var(--gold-dark); color: white; font: 700 12px "Segoe UI",Arial,Helvetica,sans-serif; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.voice-choice { margin: 10px 0; padding: 12px; display: grid; gap: 7px; border: 1px solid #9fcdb1; border-radius: 12px; background: var(--success-soft); }
.voice-choice > button { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: white; text-align: left; padding: 9px 11px; color: var(--ink); font-weight: 700; }
.inline-validation { margin: 8px 0; color: var(--danger); font-size: 12px; font-weight: 700; }
.multiplier-banner > span { margin-left: 0; flex: 1; }
.multiplier-banner .btn { margin-left: auto; }

@media (max-width: 760px) {
  .desktop-shortcuts, .desktop-finalize { display: none !important; }
  .mobile-pdv-actions { display: flex; }
  .kbd { display: none; }
  .payment-grid .chip { justify-content: center; min-height: 46px; font-size: 14px; }
  .multiplier-banner { align-items: center; flex-wrap: wrap; }
  .multiplier-banner .btn { min-height: 42px; }
  .photo-actions .btn { flex: 1 1 140px; }
  .signature-line { margin-top: 34px; }
}

@media print {
  .signature-line { margin-top: 30px; width: 88%; }
}
.receipt-document.paper-58 { max-width: 219px; font-size: 10px; }
.receipt-document.paper-80 { max-width: 302px; font-size: 11px; }
.receipt-document.paper-58 .receipt-store { font-size: 15px; }
.receipt-document.paper-58 .receipt-grand { font-size: 14px; }
@media print {
  .receipt-document.paper-58 { width: 58mm; max-width: 58mm; }
  .receipt-document.paper-80 { width: 80mm; max-width: 80mm; }
  @page { margin: 2mm; }
}

/* ===== Versão 0.4: pagamentos combinados, teclado total e proteção financeira ===== */
.field-metric { display:block; margin-top:5px; min-height:16px; color:var(--muted); font-size:10px; line-height:1.35; font-weight:700; }
.field-metric.invalid,.danger { color:var(--danger)!important; }
.input-invalid { border-color:var(--danger)!important; background:var(--danger-soft)!important; box-shadow:0 0 0 2px rgba(190,48,36,.10)!important; }
.payment-entry { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; align-items:end; margin-top:11px; }
.payment-lines { display:grid; gap:6px; margin-top:10px; }
.payment-line { display:grid; grid-template-columns:minmax(0,1fr) auto 30px; gap:8px; align-items:center; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:#fffdf8; }
.payment-line button { width:28px; height:28px; border:0; border-radius:7px; background:var(--danger-soft); color:var(--danger); font-size:18px; cursor:pointer; }
.payment-summary { display:flex; flex-wrap:wrap; gap:8px 16px; justify-content:space-between; margin-top:10px; padding:9px 10px; border-radius:10px; background:#f5f1e6; font-size:12px; }
.selected-token { margin-top:8px; padding:10px 12px; border:1px solid #a9d4b9; border-radius:10px; background:var(--success-soft); }
.selected-token button { float:right; border:0; background:transparent; font-size:18px; cursor:pointer; }
.general-toggle { display:flex; align-items:center; gap:8px; padding:0 10px; min-height:44px; border:1px solid var(--line); border-radius:10px; background:#fff; font-weight:700; }
.general-toggle input { width:19px; height:19px; }
.receivable-table { min-width:940px; }
.receivable-table tr:focus-within,.receivable-table tr.keyboard-selected { outline:2px solid var(--gold); outline-offset:-2px; }
.receivable-selected-list { max-height:220px; overflow:auto; margin:10px 0; border:1px solid var(--line); border-radius:10px; padding:4px 10px; }
.desktop-only { display:inline; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible { outline:3px solid var(--gold)!important; outline-offset:2px; }
.search-result.selected,.selected-line { box-shadow:inset 0 0 0 2px var(--gold); }
.uppercase-input { text-transform:uppercase; }
.modal form[data-dirty-form] { position:relative; }

@media (max-width:760px){
  .desktop-only { display:none!important; }
  .payment-entry { grid-template-columns:1fr; }
  .payment-entry .btn { width:100%; min-height:46px; }
  .payment-summary { display:grid; grid-template-columns:1fr 1fr; }
  .field-metric { font-size:11px; }
}

/* ===== Versão 0.5: menu compacto, foco real e promoções ===== */
@media (min-width: 761px) {
  .sidebar { height: calc(100vh - 64px); min-height: 0; overflow: hidden; padding: 8px 8px 10px; }
  .nav-list { position: static; top: auto; height: 100%; align-content: start; gap: 2px; overflow-y: auto; scrollbar-width: thin; }
  .nav-item { min-height: 37px; padding: 7px 9px; border-radius: 10px; font-size: 13.5px; line-height: 1.05; }
  .nav-icon { width: 19px; font-size: 15px; }
  .nav-item:focus-visible, .key-row:focus-visible, .mini-results button:focus-visible, .default-action:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
}
.settings-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ===== Versão 0.6: navegação completa por teclado ===== */
.key-row { cursor: pointer; }
.key-row:focus, .key-row:focus-visible { outline: 3px solid var(--gold) !important; outline-offset: -2px; background: var(--gold-soft); }
.row-button { width: 100%; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.row-button:hover { background: #fffaf0; }
[hidden] { display: none !important; }
.modal[tabindex="-1"] { outline: none; }
@media (min-width: 761px) {
  .main { min-height: calc(100vh - 64px); }
  #inventory-results .key-row:focus td, .receivable-table .key-row:focus td { background: var(--gold-soft); }
}

/* v0.7 — promoções, múltiplos códigos e custos de compra */
.promotion-result{border-color:#d89b00;background:linear-gradient(135deg,#fff8d9,#fffdf5)}
.promotion-result.selected{box-shadow:0 0 0 3px rgba(216,155,0,.2)}
.result-title-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.promotion-badge{display:inline-flex;align-items:center;border-radius:999px;background:#b3261e;color:#fff;font-size:.68rem;font-weight:700;letter-spacing:.04em;padding:3px 7px;white-space:nowrap}
.result-prices{display:flex;flex-direction:column;align-items:flex-end;gap:2px;min-width:96px}
.result-prices s{color:var(--muted);font-size:.82rem}
.promotion-saving,.promotion-cart-meta{display:block;color:#8a4b00;font-size:.78rem;font-weight:700;margin-top:3px}
.promotion-box{background:#fff0b5;border-color:#d89b00}
.promotion-cart-item{background:#fff8dc;border:1px solid #dfae29}
.promotion-price{color:#a22b20;font-size:1.05rem}
.promotion-table-row{background:#fffdf4}
.promotion-reference{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}
.promotion-reference>div,.purchase-history-preview>div,.cost-method-note{border:1px solid var(--line);border-radius:14px;padding:12px;background:#fffaf0;display:flex;flex-direction:column;gap:4px}
.promotion-reference span,.purchase-history-preview span,.cost-method-note span{color:var(--muted);font-size:.78rem}
.promotion-reference strong{font-size:1rem}
.barcode-list{min-height:76px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.unknown-barcode{border:1px solid #e3b341;background:#fff6d8;border-radius:14px;padding:12px;margin-top:8px;display:grid;gap:10px}
.unknown-barcode>div{display:flex;flex-wrap:wrap;gap:8px}
.cost-method-note{align-self:end;min-height:54px;justify-content:center}
.purchase-history-preview{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin:12px 0}
.purchase-history-preview strong{font-size:1.12rem}
.purchase-history-preview small{color:var(--muted)}
.supplier-cost-comparison small{display:flex;justify-content:space-between;gap:12px;border-top:1px dashed var(--line);padding-top:5px}
.summary-totals .warn{color:#8a5a00}
@media(max-width:760px){.promotion-reference,.purchase-history-preview{grid-template-columns:1fr}.result-prices{align-items:flex-start}.promotion-result{grid-template-columns:1fr}}
.selected-token-actions { margin-left:auto; display:flex; align-items:center; gap:6px; }
.selected-token .selected-token-actions button { margin-left:0; float:none; }
@media (max-width:720px) {
  .selected-token { align-items:flex-start; flex-direction:column; }
  .selected-token-actions { width:100%; margin-left:0; justify-content:space-between; }
}


/* v0.6.2 — compactação, foco global e PDV estável */
.pin-mask { -webkit-text-security: disc; text-security: disc; }
.promotion-badge { background:#c6281f !important; color:#fff !important; text-shadow:0 1px 0 rgba(0,0,0,.28); font-size:.72rem; }
.keyboard-selected,.mini-results button:focus,.search-result:focus,.key-row:focus { outline:3px solid #d49b00 !important; outline-offset:-2px; background:#fff3c7 !important; }
@media (min-width:761px){
  .modal { max-height:94vh; }
  .modal.wide { width:min(1040px,96vw); }
  .modal.xwide { width:min(1380px,98vw); }
  .modal-head { padding:10px 14px; }
  .modal-title { font-size:17px; }
  .modal-body { padding:12px 14px; font-size:13px; }
  .field { gap:3px; }
  .label { font-size:11px; }
  .input,.select,.textarea { min-height:38px; padding:8px 10px; font-size:14px; }
  .textarea { min-height:68px; }
  .form-grid,.compact-form-grid { display:grid; grid-template-columns:repeat(3,minmax(150px,1fr)); gap:8px; align-items:end; }
  .compact-form-row { display:grid; grid-template-columns:190px minmax(320px,1fr) 130px; gap:8px; align-items:start; }
  .compact-form-row .grow,.compact-form-grid .grow { min-width:0; }
  .qty-field { max-width:140px; }
  .modal-actions { position:sticky; bottom:-12px; z-index:3; margin:12px -14px -12px; padding:10px 14px; background:#fff; border-top:1px solid var(--line); }
  .shortcut-strip.desktop-shortcuts { flex-wrap:nowrap; white-space:nowrap; overflow-x:auto; gap:5px; }
  .shortcut-strip.desktop-shortcuts kbd { flex:0 0 auto; }
  .pos-layout { height:calc(100vh - 190px); min-height:570px; align-items:stretch; }
  .pos-products { min-height:0; overflow:hidden; display:flex; flex-direction:column; }
  .pos-products .search-results { min-height:0; overflow:auto; }
  .receipt { height:100%; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
  .receipt .cart-list { flex:1 1 auto; min-height:110px; max-height:none !important; overflow-y:auto; }
  .receipt .cart-total,.receipt .payment-area,.receipt > .payment-grid,.receipt .desktop-finalize { flex:0 0 auto; }
}

/* v0.6.3 — operação compacta, foco preservado e áreas críticas fixas */
:where(button,input,select,textarea,[tabindex="0"]):focus-visible {
  outline: 3px solid #c58c00 !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff7cf, 0 0 0 5px rgba(197,140,0,.28) !important;
}
.input-selected { border-color:#17824b !important; box-shadow:inset 4px 0 0 #17824b; }
.selection-ok { display:block; margin-top:3px; color:#176b40; font-size:10px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.compact-selection { max-width:100%; }
.shortcut-strip.desktop-shortcuts { display:flex; flex-wrap:nowrap !important; align-items:center; gap:8px; overflow-x:auto; white-space:nowrap; }
.shortcut-item { display:inline-flex; align-items:center; gap:5px; flex:0 0 auto; }

@media (min-width:761px) {
  .pdv-grid { height:calc(100dvh - 225px); min-height:520px; align-items:stretch; overflow:hidden; }
  .pdv-grid > .pos-products { min-height:0; overflow:hidden; display:flex; flex-direction:column; }
  .pos-products .search-results,.pos-products .pdv-idle { min-height:0; flex:1 1 auto; overflow-y:auto; }
  .pos-products .shortcut-strip { flex:0 0 auto; }
  .receipt { height:100%; min-height:0; display:flex; flex-direction:column; overflow:hidden; padding-bottom:10px; }
  .receipt-title { flex:0 0 auto; }
  .receipt .cart-list { min-height:90px; flex:1 1 auto; max-height:none !important; overflow-y:auto; overscroll-behavior:contain; }
  .receipt-fixed { flex:0 0 auto; max-height:58%; overflow-y:auto; overscroll-behavior:contain; background:#fff; padding-top:2px; }
  .receipt-fixed .cart-total { position:sticky; top:0; z-index:2; background:#fff; }

  .purchase-compact { gap:8px; }
  .purchase-head-compact { display:grid; grid-template-columns:minmax(300px,1.55fr) minmax(150px,.72fr) minmax(170px,.72fr) auto auto; gap:8px; align-items:end; }
  .purchase-head-compact .field { margin:0; }
  .purchase-head-compact .short-date { width:155px; }
  .purchase-head-compact .tiny-number { width:82px; }
  .purchase-entry,.purchase-items,.purchase-summary { padding:10px 12px; border-radius:11px; }
  .purchase-entry h3,.purchase-items h3 { margin:0 0 7px; font-size:13px; }
  .purchase-item-line { display:grid; grid-template-columns:minmax(330px,1.8fr) 110px 90px 130px 125px 145px auto; gap:7px; align-items:end; }
  .purchase-item-line .field { min-width:0; }
  .purchase-item-line .add-item-button { min-height:38px; white-space:nowrap; }
  .purchase-decision-line { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; margin-top:7px; padding:6px 8px; border:1px solid var(--line); border-radius:9px; background:#fbfaf6; font-size:11px; }
  .purchase-decision-line .update-cost { margin-right:auto; font-weight:700; }
  .purchase-decision-line .last-cost { color:var(--muted); }
  .compact-price-review { display:grid; grid-template-columns:repeat(3,minmax(150px,1fr)) auto; gap:8px; align-items:end; margin-top:7px; }
  .compact-price-review small { display:block; margin-top:2px; font-size:9px; line-height:1.25; color:var(--muted); }
  .compact-price-review .apply-prices { padding-bottom:9px; white-space:nowrap; }
  .purchase-items { max-height:190px; overflow-y:auto; }
  .purchase-items .compact-row { min-height:44px; padding:6px 8px; }
  .purchase-summary-line { display:grid; grid-template-columns:200px 160px minmax(360px,1fr); gap:8px; align-items:end; }
  .purchase-summary .help { margin:5px 0 0; font-size:10px; }
  .purchase-summary .summary-totals { align-self:center; justify-content:flex-end; font-size:12px; }

  .branch-entry-line { display:grid; grid-template-columns:180px minmax(360px,1fr) 120px auto; gap:8px; align-items:end; }
  .branch-draft-items { max-height:260px; overflow-y:auto; margin:8px 0; }
  .branch-add-button { min-height:38px; white-space:nowrap; }
}
.branch-report-table .qty-col { width:90px; text-align:right; font-variant-numeric:tabular-nums; }
.branch-report-table .unit-col { width:60px; }
.branch-report-table td,.branch-report-table th { padding:8px 10px; }
.operational-total { font-size:13px; color:var(--muted); }

@media (max-width:760px) {
  .receipt-fixed { overflow:visible; }
  .purchase-head-compact,.purchase-item-line,.compact-price-review,.purchase-summary-line,.branch-entry-line { display:grid; grid-template-columns:1fr; }
  .purchase-head-compact .short-date,.purchase-head-compact .tiny-number { width:auto; }
}

/* v0.6.3 revisão final — pagamento sempre visível e compras sem poluição */
@media (min-width:761px) {
  .pdv-grid { height:calc(100dvh - 275px); min-height:470px; }
  .receipt .cart-list { min-height:52px; }
  .receipt-fixed { flex:0 0 auto; max-height:none !important; overflow:visible !important; }
  .receipt-fixed .cart-total { position:static; }
  .purchase-head-compact { grid-template-columns:minmax(280px,1.6fr) minmax(135px,.65fr) minmax(150px,.7fr) 145px 72px; }
  .purchase-item-line { grid-template-columns:minmax(280px,1.6fr) 100px 78px 120px 112px 136px auto; }
  .purchase-entry,.purchase-items,.purchase-summary { padding:8px 10px; }
  .purchase-head-compact .field,.purchase-item-line .field { gap:2px; }
  .purchase-head-compact .input,.purchase-head-compact .select,
  .purchase-item-line .input,.purchase-item-line .select { min-height:34px; padding:6px 8px; font-size:13px; }
  .purchase-decision-line { padding:5px 7px; margin-top:5px; }
  .compact-price-review { margin-top:5px; }
  .purchase-items { max-height:150px; }
}

/* v0.6.4 — históricos compactos, conferência de custos e contas a pagar */
.purchase-history-card,.payables-card{margin-top:14px}.history-toolbar{display:grid;grid-template-columns:160px repeat(2,minmax(130px,170px)) minmax(190px,1fr) minmax(220px,1.4fr);gap:9px;align-items:end;margin-bottom:12px}.history-toolbar .field{margin:0}.history-search{grid-column:auto}.compact-history{display:flex;flex-direction:column;gap:2px}.purchase-history-row{width:100%;display:grid;grid-template-columns:145px minmax(180px,1.5fr) minmax(100px,.8fr) 90px 90px 110px 58px;gap:10px;align-items:center;min-height:38px;padding:7px 10px;border:1px solid transparent;border-bottom-color:var(--border);background:transparent;text-align:left;border-radius:8px;color:inherit}.purchase-history-row:hover,.purchase-history-row:focus-visible{background:var(--surface-2);border-color:var(--accent);outline:3px solid color-mix(in srgb,var(--accent) 28%,transparent)}.history-open{font-weight:700;text-align:right}.payable-alert{margin-top:14px;padding:12px 14px;border:1px solid #e7b54b;background:#fff7df;border-radius:14px;display:grid;gap:9px}.payable-alert>div:first-child{display:flex;justify-content:space-between;gap:16px}.payable-alert-list{display:flex;flex-direction:column;gap:4px}.payable-alert-list button{display:grid;grid-template-columns:120px 1fr 110px 58px;gap:10px;align-items:center;border:0;border-top:1px solid rgba(122,87,12,.16);background:transparent;padding:7px;text-align:left}.payable-alert-list button:focus-visible{outline:3px solid #bb7b00;border-radius:7px}.payable-alert-list em{font-style:normal;font-weight:700}.payables-filters{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:12px}.compact-select{width:auto;min-width:150px}.compact-date{width:155px}.payable-row{min-height:46px}.payable-status{display:flex;align-items:center;justify-content:flex-end;gap:10px}.payable-row.overdue{border-left:4px solid #b3261e}.payable-row.due-today{border-left:4px solid #d84315}.payable-row.due-soon{border-left:4px solid #ef9d10}.payable-row.due-upcoming{border-left:4px solid #d6b03f}.calculated-field{background:var(--surface-2);font-weight:700}.purchase-cost-confirm{display:grid;gap:10px}.cost-confirm-head,.cost-confirm-row{display:grid;grid-template-columns:minmax(220px,1.6fr) 130px 130px 100px;gap:10px;align-items:center}.cost-confirm-head{padding:0 10px 6px;font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700}.cost-confirm-row{padding:9px 10px;border-top:1px solid var(--border);min-height:42px}.cost-confirm-row.high-variation{background:#fff4ef;border-left:4px solid #d84315}.cost-confirm-summary{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:18px;padding:11px;background:var(--surface-2);border-radius:10px}.purchase-price-review-list{display:flex;flex-direction:column;gap:7px}.purchase-price-review-row{display:grid;grid-template-columns:minmax(180px,1.4fr) repeat(4,minmax(135px,1fr)) auto;gap:8px;align-items:end;padding:9px;border:1px solid var(--border);border-radius:10px}.purchase-price-review-row .field{margin:0}.purchase-detail-meta{display:flex;flex-wrap:wrap;gap:16px;margin-bottom:14px}.purchase-detail-head{grid-template-columns:45px minmax(220px,1.6fr) 120px 120px 90px}.purchase-detail-row{display:grid;grid-template-columns:45px minmax(220px,1.6fr) 120px 120px 90px;gap:10px;align-items:center;padding:8px 10px;border-top:1px solid var(--border)}.purchase-detail-row small{display:block;color:var(--muted);margin-top:2px}.payable-payment-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:14px}.payable-payment-summary>div{padding:10px;background:var(--surface-2);border-radius:10px;display:grid;gap:4px}.payable-calculation{display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:flex-end;padding:10px;background:var(--surface-2);border-radius:10px}.purchase-decision-line{min-height:42px}.purchase-decision-line span{white-space:nowrap}.compact-price-review{grid-template-columns:repeat(4,minmax(150px,1fr)) auto}
@media(max-width:1000px){.history-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-history-row{grid-template-columns:120px 1fr 90px 90px}.purchase-history-row span:nth-of-type(2),.purchase-history-row span:nth-of-type(4),.history-open{display:none}.purchase-price-review-row{grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-price-review-row>strong{grid-column:1/-1}.compact-price-review{grid-template-columns:repeat(2,minmax(0,1fr))}.payable-alert-list button{grid-template-columns:100px 1fr 100px}}
@media(max-width:760px){.history-toolbar{grid-template-columns:1fr}.purchase-history-row{grid-template-columns:1fr auto;gap:4px}.purchase-history-row>*{display:block!important}.purchase-history-row strong{grid-column:1}.purchase-history-row b{grid-column:2;grid-row:1}.history-open{display:none!important}.payable-alert>div:first-child{display:grid}.payable-alert-list button{grid-template-columns:1fr auto}.payable-alert-list button span,.payable-alert-list button strong{grid-column:1}.payable-alert-list button b,.payable-alert-list button em{grid-column:2}.cost-confirm-head{display:none}.cost-confirm-row{grid-template-columns:1fr auto}.cost-confirm-row strong{grid-column:1/-1}.purchase-price-review-row{grid-template-columns:1fr}.purchase-price-review-row>strong{grid-column:auto}.purchase-detail-head{display:none}.purchase-detail-row{grid-template-columns:35px 1fr}.purchase-detail-row span:nth-of-type(n+2),.purchase-detail-row>b{grid-column:2}.payable-payment-summary{grid-template-columns:1fr}}

/* v0.6.5 — saldos, painel compacto, curva ABC, locações e impacto do rateio */
.stock-badge{display:inline-flex;align-items:center;margin-top:5px;padding:4px 8px;border:1px solid #b28a24;border-radius:999px;background:#fff5cc;color:#614800;font-size:11px;font-weight:700;letter-spacing:.02em;white-space:nowrap}
.stock-badge.stock-low{border-color:#d64b3d;background:#fff0ed;color:#a51f16}
.result-box{font-weight:700}.cash-closed-strip{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 7px;margin:-1px 0 5px;border:1px solid #e4b34c;border-radius:9px;background:#fff6dc;color:#795400;font-size:11px;font-weight:700}.cash-closed-strip .btn{min-height:29px;padding:4px 10px}
.cost-change{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums}.cost-change.cost-up{color:#bd251d;font-weight:700}.cost-change.cost-down{color:#167642;font-weight:700}.cost-change.cost-same{color:inherit}
.cost-confirm-row.cost-up{background:#fff2ef;border-left:4px solid #cf2f25}.cost-confirm-row.cost-down{background:#eefaf3;border-left:4px solid #198754}.cost-confirm-row .rateio-value{font-weight:700}.cost-confirm-row.cost-up .rateio-value{color:#bd251d}.cost-confirm-row.cost-down .rateio-value{color:#167642}
.dashboard-compact-card{padding:12px 14px}.dashboard-compact-card .card-title{font-size:15px;margin-bottom:7px}.compact-dashboard-list{display:flex;flex-direction:column;gap:1px;max-height:230px;overflow:auto}.compact-dashboard-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;min-height:38px;padding:5px 2px;border-bottom:1px solid var(--line);font-size:12px}.compact-dashboard-row:last-child{border-bottom:0}.compact-dashboard-row strong{font-size:12px}.compact-dashboard-row small{display:block;margin-top:1px;color:var(--muted);font-size:10px;line-height:1.2}.compact-dashboard-row.urgent{border-left:3px solid #c92b21;padding-left:7px;background:#fff5f2}.compact-dashboard-row.warning{border-left:3px solid #df9b13;padding-left:7px}.count-pill{display:inline-flex;min-width:46px;justify-content:center;padding:3px 7px;border-radius:999px;background:#fff0df;color:#a52d1d;font-size:10px;font-weight:700}.compact-line{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid var(--line);font-size:12px}.compact-line span{min-width:0}.compact-line small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}.abc-card{margin-top:14px}.abc-table th,.abc-table td{padding:7px 8px;font-size:12px}.abc-badge{display:inline-flex;align-items:center;justify-content:center;width:27px;height:27px;border-radius:8px;font-weight:700}.abc-a{background:#daf3e4;color:#126c3b}.abc-b{background:#fff0c7;color:#825e00}.abc-c{background:#f1e6df;color:#794331}.sales-history-row{display:grid;grid-template-columns:145px minmax(170px,1fr) 100px 105px 105px 56px;gap:9px;align-items:center;min-height:38px;padding:6px 8px;border-bottom:1px solid var(--line);font-size:12px}.sales-history-row:hover,.sales-history-row:focus-visible{background:#fff6d9}
.rental-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}.rental-list{display:flex;flex-direction:column;gap:4px}.rental-row{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(130px,.8fr) 120px auto;gap:10px;align-items:center;min-height:48px;padding:7px 9px;border:1px solid var(--line);border-radius:9px;background:#fff}.rental-row.overdue{border-left:4px solid #c92b21;background:#fff6f4}.rental-main strong{display:block;font-size:13px}.rental-main small{display:block;color:var(--muted);font-size:10px;margin-top:2px}.rental-actions{display:flex;justify-content:flex-end;gap:5px;flex-wrap:wrap}.rental-customer-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end}.rental-asset-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:240px;overflow:auto;padding:4px}.rental-asset-option{display:flex;gap:9px;align-items:center;padding:8px;border:1px solid var(--line);border-radius:9px;background:#fff;cursor:pointer}.rental-asset-option:has(input:checked){border-color:#a77b0a;background:#fff6d8}.rental-asset-option span{display:grid}.rental-asset-option small{color:var(--muted);font-size:10px}.rental-term-preview{padding:8px 10px;border-radius:9px;background:var(--surface-2);font-size:11px;color:var(--muted)}.rental-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-bottom:12px}.rental-detail-grid span{padding:7px;background:var(--surface-2);border-radius:7px;font-size:12px}.rental-responsibility{margin:22px 0 28px;font-size:12px;line-height:1.45}.signature-line{border-top:1px solid #333;width:min(360px,100%);padding-top:5px;text-align:center;margin:0 auto;font-size:11px}
@media (min-width:761px){
  .pdv-grid{height:calc(100dvh - 205px);min-height:540px}
  .receipt{padding:9px 12px 9px}.receipt-title{margin:1px 0 4px;font-size:11px}.receipt .cart-list{min-height:172px;gap:0}.receipt .cart-item{min-height:50px;padding:5px 4px;gap:7px}.cart-item-name{font-size:12px}.cart-item-meta{margin-top:1px;font-size:10px}.line-number{font-size:10px}.receipt-fixed{font-size:12px}.receipt-fixed .cart-total{padding:8px 0;margin-top:3px}.payment-grid{gap:5px}.payment-grid .chip,.payment-grid button{min-height:36px;padding:6px 9px}.payment-entry{gap:6px}.payment-entry .input{min-height:37px}.desktop-finalize{min-height:42px}.shortcut-strip.desktop-shortcuts{font-size:10px;padding:5px 7px}
}
@media(max-width:900px){.sales-history-row{grid-template-columns:120px 1fr 90px 55px}.sales-history-row span:nth-of-type(2),.sales-history-row strong:nth-of-type(2){display:none}.rental-row{grid-template-columns:1fr auto}.rental-row>*:nth-child(2),.rental-row>*:nth-child(3){grid-column:1}.rental-actions{grid-column:2;grid-row:1/4}}
@media(max-width:760px){.stock-badge{font-size:10px}.compact-dashboard-list{max-height:none}.compact-dashboard-row{min-height:36px}.sales-history-row{grid-template-columns:1fr auto}.sales-history-row>*{display:none!important}.sales-history-row strong:first-of-type,.sales-history-row span:first-of-type,.sales-history-row button{display:block!important}.rental-customer-line,.rental-asset-picker,.rental-detail-grid{grid-template-columns:1fr}.rental-row{display:grid;grid-template-columns:1fr}.rental-row>*{grid-column:1}.rental-actions{grid-row:auto;justify-content:flex-start}.cost-confirm-row .rateio-value{grid-column:2}}
.rental-row{grid-template-columns:minmax(0,1fr) auto}.rental-main{grid-column:1;display:grid;grid-template-columns:minmax(220px,1.6fr) 110px 140px 175px;gap:9px;align-items:center;width:100%;padding:0;border:0;background:transparent;color:inherit;text-align:left}.rental-main>span:nth-child(2){font-size:11px;color:var(--muted)}.rental-main em{font-size:11px;font-style:normal;text-align:right}.rental-actions{grid-column:2}.rental-finance-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0}.rental-finance-summary>div{display:grid;gap:3px;padding:9px 10px;border-radius:9px;background:var(--surface-2)}.rental-finance-summary small{font-size:10px;color:var(--muted);text-transform:uppercase}.rental-finance-summary strong{font-size:16px}.rental-finance-table th,.rental-finance-table td{padding:7px 8px;font-size:11px}.compact-dashboard-row.urgency-overdue{border-left:3px solid #c92b21;padding-left:7px;background:#fff5f2}.compact-dashboard-row.urgency-soon{border-left:3px solid #df9b13;padding-left:7px;background:#fffaf0}
@media(max-width:1000px){.rental-main{grid-template-columns:minmax(180px,1fr) 100px 130px}.rental-main em{grid-column:1/-1;text-align:left}.rental-finance-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.rental-main{grid-template-columns:1fr}.rental-main>*{grid-column:1}.rental-actions{grid-column:1}.rental-finance-summary{grid-template-columns:1fr 1fr}.rental-finance-table th:nth-child(3),.rental-finance-table td:nth-child(3),.rental-finance-table th:nth-child(4),.rental-finance-table td:nth-child(4){display:none}}


/* v0.6.6 — revisão visual profissional, PDV compacto e locações por teclado */
:root{
  --gold:#b58a24;--gold-dark:#72581b;--gold-soft:#f4ead0;
  --ink:#20231f;--muted:#667067;--line:#d9ddd5;--surface:#fbfcfa;--surface-2:#f1f3ef;--canvas:#edf0eb;
  --danger:#b42318;--danger-soft:#fceceb;--success:#1d6f43;--success-soft:#e8f4ed;--warning:#8a5d0a;--warning-soft:#fff3d6;
  --shadow:0 8px 24px rgba(35,42,35,.07);--radius:12px;
}
body{font-family:"Segoe UI",Arial,Helvetica,sans-serif;font-size:14px;line-height:1.35;background:var(--canvas)}
.brand-name,.page-title{font-family:"Segoe UI",Arial,Helvetica,sans-serif}.brand-name{letter-spacing:.01em}.page-title{color:#171b17}
.topbar{background:linear-gradient(135deg,#66521d,#80651b);box-shadow:0 4px 16px rgba(35,30,14,.16)}
.sidebar{background:#f7f8f5}.nav-item{font-weight:600;color:#596259}.nav-item.active{background:#765c18}.nav-item.keyboard-focus:not(.active){outline:3px solid #8b6d22;background:#f7edcf;color:#4e3a0e}
.main{padding-bottom:68px}.card{background:var(--surface);box-shadow:var(--shadow)}
.btn{font-weight:700}.label{font-weight:700;color:#596259}.input,.select,.textarea{background:#fff;border-color:#cfd5cc}.input:focus,.select:focus,.textarea:focus,button:focus-visible,[tabindex]:focus-visible{outline:3px solid rgba(72,100,74,.34)!important;outline-offset:1px;border-color:#456a4a!important;box-shadow:0 0 0 1px #456a4a!important}
.stat{min-height:108px}.stat-label{font-size:10px}.stat-value{font-family:"Segoe UI",Arial,Helvetica,sans-serif;font-variant-numeric:tabular-nums;font-size:25px}
.compact-dashboard-row strong,.compact-dashboard-row small{letter-spacing:0;word-spacing:.04em}.compact-dashboard-row{column-gap:12px}

/* PDV: resultados menores, seleção inequívoca e rodapé sempre visível */
.search-results{gap:5px}.search-result{min-height:64px;padding:7px 10px;border-radius:9px;gap:8px;grid-template-columns:minmax(0,1fr) auto}.search-result strong{font-size:13px;line-height:1.2}.search-result span{font-size:10px;line-height:1.2;margin-top:2px}.search-result .result-box{grid-column:1;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.search-result>div:last-child,.search-result>strong:last-child{grid-column:2;grid-row:1/3;align-self:center}.search-result.selected{border:3px solid #355f3e!important;background:#e9f4eb!important;box-shadow:inset 5px 0 0 #355f3e,0 0 0 2px rgba(53,95,62,.16)!important}.search-result.selected strong{color:#173e24}.stock-badge{margin-top:2px;padding:3px 7px}
@media (min-width:761px){
  .pdv-grid{height:calc(100dvh - 188px)!important;min-height:460px!important;gap:12px}.pos-products .search-results{padding-right:2px}.receipt{top:70px;padding:7px 10px!important}.receipt .cart-list{min-height:150px!important}.receipt-fixed{max-height:54%!important;overflow:visible!important}.payment-grid .chip,.payment-grid button{min-height:32px!important;padding:4px 8px!important}.payment-entry .input{min-height:34px!important}.desktop-finalize{min-height:38px!important}.shortcut-strip.desktop-shortcuts{margin-top:5px!important;padding:4px 6px!important}.cart-total{padding:6px 0!important}
}

.cart-remove-help{padding:8px 10px;border-radius:8px;background:var(--surface-2);color:var(--muted);font-size:12px}.cart-remove-list{display:grid;gap:4px;max-height:430px;overflow:auto}.cart-remove-row{width:100%;display:grid;grid-template-columns:34px minmax(0,1fr) minmax(130px,.7fr) 100px;gap:9px;align-items:center;min-height:42px;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:#fff;text-align:left;color:var(--ink)}.cart-remove-row>span{font-weight:700;color:var(--gold-dark)}.cart-remove-row small{color:var(--muted)}.cart-remove-row b{text-align:right}.cart-remove-row.selected{border:3px solid var(--danger);background:var(--danger-soft);box-shadow:inset 4px 0 0 var(--danger)}

/* Mesas e coolers */
.rental-admin-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,.7fr);gap:12px;margin-top:12px}.rental-assets-card,.rental-customers-card,.rental-financial-report{margin-top:0}.rental-asset-table-head,.rental-asset-row{display:grid;grid-template-columns:90px 90px minmax(180px,1fr) 150px 120px;gap:10px;align-items:center}.rental-asset-table-head{padding:7px 9px;color:var(--muted);font-size:10px;font-weight:700;text-transform:uppercase;border-bottom:1px solid var(--line)}.rental-asset-table{display:grid;max-height:330px;overflow:auto}.rental-asset-row{min-height:40px;padding:6px 9px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);text-align:left}.rental-asset-row:hover,.rental-asset-row:focus-visible{background:#eef4ed}.rental-asset-row b{font-variant-numeric:tabular-nums}.rental-empty-row{padding:16px}.rental-toolbar-main{margin-top:12px}.rental-list-card{padding:10px}.rental-term-preview strong{color:var(--ink)}.field-help{display:block;margin-top:4px;color:var(--muted);font-size:10px;line-height:1.3}
@media(max-width:1050px){.rental-admin-grid{grid-template-columns:1fr}.rental-asset-table-head,.rental-asset-row{grid-template-columns:75px 75px minmax(150px,1fr) 125px 105px}}
@media(max-width:760px){.rental-asset-table-head{display:none}.rental-asset-row{grid-template-columns:65px 65px 1fr}.rental-asset-row b,.rental-asset-row .badge{grid-column:3}.cart-remove-row{grid-template-columns:30px 1fr auto}.cart-remove-row small{grid-column:2}.cart-remove-row b{grid-column:3;grid-row:1/3}}
:root{--border:var(--line);--accent:var(--gold-dark)}

/* v0.6.7 — correções visuais verificáveis, foco forte e PDV preso à janela */
:root {
  --focus-ring: #0874a8;
  --focus-ring-soft: rgba(8, 116, 168, .22);
  --nav-active: #28434b;
  --nav-focus: #0874a8;
}

/* Estado da página aberta e foco do teclado são deliberadamente diferentes. */
.nav-item.active {
  color: #fff;
  background: var(--nav-active);
  box-shadow: inset 5px 0 0 #e1b84b, 0 8px 18px rgba(31, 58, 66, .18);
}
.nav-item.keyboard-focus,
.nav-item:focus-visible,
.nav-item.keyboard-focus.active {
  color: #fff !important;
  background: var(--nav-focus) !important;
  outline: 3px solid #fff !important;
  outline-offset: -5px !important;
  box-shadow: 0 0 0 4px var(--nav-focus), inset 6px 0 0 #fff !important;
}
:where(button,input,select,textarea,[tabindex="0"]):focus-visible {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 2px !important;
  border-color: var(--focus-ring) !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 6px var(--focus-ring-soft) !important;
}

/* Início: linhas estruturadas em colunas, sem palavras encostadas. */
.dashboard-compact-card { min-width: 0; }
.dashboard-empty-row { padding: 10px 4px; font-size: 12px; }
.dashboard-table-row {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 6px 7px;
  text-align: left;
  cursor: pointer;
}
.dashboard-table-row:last-child { border-bottom: 0; }
.dashboard-table-row:hover { background: #edf3f2; }
.dashboard-row-description,
.dashboard-row-detail,
.dashboard-row-value,
.pending-kind {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-row-description { font-size: 11.5px; font-weight: 700; }
.dashboard-row-detail { color: var(--muted); font-size: 10px; }
.dashboard-row-value { text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.stock-alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 62px;
  gap: 10px;
  align-items: center;
}
.pending-alert-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 58px 76px;
  gap: 6px;
  align-items: center;
}
.pending-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e9efed;
  color: #2f4b50;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .025em;
}
.pending-alert-row.urgency-overdue { border-left: 4px solid var(--danger); background: #fff5f3; }
.pending-alert-row.urgency-soon { border-left: 4px solid #d28a00; background: #fffaf0; }

/* PDV desktop: a página não rola; somente resultados, carrinho e detalhes de pagamento. */
@media (min-width: 761px) {
  .app-shell:has(.view-pdv) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .view-pdv-workspace {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
  .view-pdv-workspace .sidebar {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
  }
  .main.view-pdv {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding-top: 16px;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
  }
  .view-pdv .page-head {
    flex: 0 0 auto;
    margin-bottom: 9px;
  }
  .view-pdv .page-title { font-size: 29px; }
  .view-pdv .page-subtitle { margin-top: 3px; }
  .view-pdv > .pdv-grid {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden;
    align-items: stretch;
  }
  .view-pdv .pos-products {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .view-pdv .toolbar { flex: 0 0 auto; margin-bottom: 8px; }
  .view-pdv .pos-products .search-results,
  .view-pdv .pos-products .pdv-idle {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  .view-pdv .shortcut-strip.desktop-shortcuts {
    flex: 0 0 auto;
    margin-top: 5px !important;
  }
  .view-pdv .receipt {
    position: relative;
    top: auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .view-pdv .receipt-title,
  .view-pdv .cash-closed-strip { flex: 0 0 auto; }
  .view-pdv .receipt .cart-list {
    flex: 1 1 auto;
    min-height: 105px !important;
    max-height: none !important;
    overflow-y: auto;
  }
  .view-pdv .receipt-fixed {
    flex: 0 0 auto;
    min-height: 0;
    max-height: 58%;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    background: #fff;
  }
  .view-pdv .receipt-fixed .cart-total {
    position: static;
    flex: 0 0 auto;
    margin-top: 3px;
    padding: 7px 0 !important;
  }
  .receipt-payment-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 3px;
  }
  .view-pdv .payment-panel { margin-top: 6px; padding-top: 7px; }
  .view-pdv .payment-grid { gap: 4px; }
  .view-pdv .payment-grid .chip,
  .view-pdv .payment-grid button { min-height: 31px !important; padding: 4px 8px !important; }
  .view-pdv .payment-entry { margin-top: 7px; }
  .view-pdv .payment-entry .input { min-height: 34px !important; }
  .view-pdv .payment-summary { margin-top: 6px; padding: 7px 8px; }
  .view-pdv .desktop-finalize {
    flex: 0 0 auto;
    min-height: 40px !important;
    margin-top: 7px !important;
  }
}

/* Mercado Rio Paraná 1.4.0 — fornecedores, ciclo de produtos e filtros operacionais */
.supplier-list-card {
  padding:0;
  overflow:hidden;
}
.supplier-list-head,
.supplier-list-row {
  display:grid;
  grid-template-columns:minmax(260px,2fr) minmax(80px,.55fr) minmax(110px,.75fr) minmax(145px,.9fr) auto;
  align-items:center;
  gap:14px;
}
.supplier-list-head {
  padding:12px 16px;
  background:#f5f8f6;
  border-bottom:1px solid var(--border);
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.supplier-list-row {
  min-height:68px;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
}
.supplier-list-row:last-child { border-bottom:0; }
.supplier-list-row:hover { background:#fbfdfc; }
.supplier-list-name,
.supplier-list-stat {
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.supplier-list-name strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.supplier-list-name span,
.supplier-list-stat span { color:var(--muted);font-size:12px; }
.supplier-list-empty { padding:24px;text-align:center;color:var(--muted); }
.expiry-range-filters {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:0 0 14px;
}
button.expiry-legend-item {
  appearance:none;
  cursor:pointer;
  font:inherit;
  transition:border-color .15s,box-shadow .15s,transform .15s;
}
button.expiry-legend-item:hover { transform:translateY(-1px); }
button.expiry-legend-item.active { box-shadow:0 0 0 3px rgba(11,143,91,.14);border-color:#0b8f5b; }
.inventory-special-results { margin-top:14px; }
.login-error { margin:0 0 12px; }
.purchase-archived-result { background:#fff8e6 !important;border-color:#dfb44b !important; }
.purchase-archived-result span b { color:#8b5e00; }

@media (max-width:900px) {
  .supplier-list-head { display:none; }
  .supplier-list-row { grid-template-columns:1fr 1fr; }
  .supplier-list-name { grid-column:1/-1; }
  .supplier-list-status { align-self:center; }
  .supplier-list-row .row-actions { justify-content:flex-end; }
}
@media (max-width:560px) {
  .supplier-list-row { grid-template-columns:1fr;gap:9px; }
  .supplier-list-row .row-actions { justify-content:flex-start; }
}

/* O carrinho normal não possui seleção visual. A seleção existe apenas na janela F8. */
.receipt .cart-item,
.receipt .cart-item.selected-line {
  outline: 0;
  box-shadow: none;
}
.receipt .cart-item:not(.promotion-cart-item),
.receipt .cart-item.selected-line:not(.promotion-cart-item) {
  background: transparent !important;
}
.receipt .cart-item { cursor: default; }
.promotion-cart-item {
  background: #fff7d9 !important;
  border-color: #d9a72a !important;
}

@media (max-width: 1050px) and (min-width: 761px) {
  .pending-alert-row { grid-template-columns: 64px minmax(0,1fr) 58px 76px; gap: 6px; }
  .stock-alert-row { grid-template-columns: minmax(0,1fr) 78px 56px; gap: 6px; }
}
@media (max-width: 760px) {
  .dashboard-table-row { min-height: 44px; }
  .stock-alert-row { grid-template-columns: minmax(0,1fr) auto; }
  .stock-alert-row .dashboard-row-detail { grid-column: 1; }
  .stock-alert-row .dashboard-row-value { grid-column: 2; grid-row: 1 / 3; }
  .pending-alert-row { grid-template-columns: 72px minmax(0,1fr) auto; }
  .pending-alert-row .dashboard-row-detail { grid-column: 2; }
  .pending-alert-row .dashboard-row-value { grid-column: 3; grid-row: 1 / 3; }
}

/* Ajustes finais da v0.6.7 após validação em 1365×768. */
@media (min-width: 761px) {
  .view-pdv .receipt .cart-list {
    align-content: start;
    grid-auto-rows: min-content;
  }
  .view-pdv .shortcut-strip.desktop-shortcuts {
    gap: 3px !important;
    padding: 3px 5px !important;
    overflow: hidden;
    font-size: 9px;
  }
  .view-pdv .shortcut-item { gap: 3px; }
  .view-pdv .shortcut-strip .kbd {
    min-width: 22px;
    height: 18px;
    padding: 0 4px;
    font-size: 9px;
  }
}

/* ========================================================================== 
   v0.6.8 — Proposta 2 / Moderna Clean
   Camada estritamente visual aplicada sobre a base funcional v0.6.7.
   ========================================================================== */
:root {
  --gold: #18a56b;
  --gold-dark: #0b8f5b;
  --gold-soft: #e7f6ef;
  --ink: #17211d;
  --muted: #64716b;
  --line: #e1e8e4;
  --border: var(--line);
  --surface: #ffffff;
  --surface-2: #f3f7f5;
  --canvas: #f4f7f6;
  --danger: #d72c2c;
  --danger-soft: #fff0f0;
  --success: #0b8f5b;
  --success-soft: #e7f6ef;
  --warning: #a66a05;
  --warning-soft: #fff7e4;
  --accent: #0b8f5b;
  --focus-ring: #1677c8;
  --focus-ring-soft: rgba(22, 119, 200, .20);
  --nav-active: #e4f4ec;
  --nav-focus: #1677c8;
  --shadow: 0 6px 20px rgba(23, 51, 39, .055);
  --radius: 12px;
}

html, body { background: var(--canvas); }
body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 13.5px;
  color: var(--ink);
}

.loading-screen { color: var(--gold-dark); background: var(--canvas); }
.spinner { border-color: #cfeade; border-top-color: var(--gold-dark); }

.topbar {
  min-height: 60px;
  padding: 9px clamp(14px, 2.4vw, 28px);
  color: var(--ink);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(24, 47, 37, .045);
  backdrop-filter: blur(10px);
}
.brand-mark {
  color: #fff;
  background: linear-gradient(145deg, #0b8f5b, #16a36a);
  border-color: rgba(11,143,91,.16);
  box-shadow: 0 5px 14px rgba(11,143,91,.18);
}
.brand-name,
.page-title,
.login-card h1 {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: -.025em;
}
.brand-name { color: #113c2c; font-size: 16px; font-weight: 700; }
.brand-subtitle { color: var(--muted); opacity: 1; }
.operator strong { color: var(--ink); }
.operator span { color: var(--muted); opacity: 1; }
.status-dot { background: #20bc78; box-shadow: 0 0 0 4px rgba(32,188,120,.13); }
.topbar-logout {
  color: #435149;
  background: #f4f7f5;
  border-color: var(--line);
}
.topbar-logout:hover { color: var(--gold-dark); background: var(--gold-soft); }

.workspace { max-width: none; grid-template-columns: 205px minmax(0, 1fr); }
.sidebar {
  padding: 15px 10px 24px;
  background: #ffffff;
  border-right-color: var(--line);
}
.nav-list { gap: 3px; top: 76px; }
.nav-item {
  min-height: 39px;
  padding: 8px 11px;
  color: #47574f;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
}
.nav-icon { width: 22px; font-size: 16px; }
.nav-item:hover { color: #08784c; background: #eef8f3; }
.nav-item.active {
  color: #08784c !important;
  background: var(--nav-active) !important;
  box-shadow: inset 3px 0 0 #0b8f5b !important;
}
.nav-item.keyboard-focus,
.nav-item:focus-visible,
.nav-item.keyboard-focus.active {
  color: #fff !important;
  background: var(--nav-focus) !important;
  outline: 3px solid #fff !important;
  outline-offset: -5px !important;
  box-shadow: 0 0 0 3px var(--nav-focus), inset 5px 0 0 #fff !important;
}

.main {
  padding: clamp(14px, 2vw, 24px) clamp(13px, 2.2vw, 28px) 76px;
  background: var(--canvas);
}
.page-head { margin-bottom: 14px; }
.page-title { color: #17211d; font-size: clamp(23px, 2.6vw, 29px); font-weight: 700; }
.page-subtitle { margin-top: 4px; color: var(--muted); font-size: 12.5px; }

.grid { gap: 11px; }
.card {
  padding: 15px;
  background: #fff;
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-title { margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.card-subtitle { color: var(--muted); }
.stat { min-height: 101px; }
.stat::after { width: 78px; height: 78px; right: -17px; bottom: -24px; background: #eaf7f1; }
.stat-label { color: #68766f; font-size: 9.5px; letter-spacing: .045em; }
.stat-value {
  margin-top: 8px;
  color: #17211d;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: clamp(20px, 2.1vw, 26px);
  font-weight: 700;
}
.stat-detail { margin-top: 6px; color: var(--muted); font-size: 11px; }

.btn { min-height: 39px; border-radius: 9px; font-size: 12px; font-weight: 700; }
.btn-primary { color: #fff; background: #0b8f5b; box-shadow: 0 4px 12px rgba(11,143,91,.14); }
.btn-primary:hover { background: #08784c; }
.btn-secondary { color: #08784c; background: #e7f6ef; border-color: #c9eadb; }
.btn-ghost { color: #526159; background: #fff; border-color: var(--line); }
.btn-success { color: #08784c; background: #e7f6ef; border-color: #c5e7d7; }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: #f3caca; }
.btn-sm { min-height: 32px; border-radius: 8px; }

.label { color: #596861; font-size: 11.5px; font-weight: 700; }
.input, .select, .textarea {
  min-height: 40px;
  color: var(--ink);
  background: #fff;
  border-color: #d6dfda;
  border-radius: 8px;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(11,143,91,.12);
}
.chip { min-height: 33px; color: #596861; border-color: var(--line); font-size: 11.5px; }
.chip.active { color: #fff; border-color: var(--gold-dark); background: var(--gold-dark); }

.table-wrap { border-color: var(--line); border-radius: 10px; }
th, td { padding: 10px 11px; border-bottom-color: var(--line); font-size: 12px; }
th { color: #68766f; font-size: 10px; background: #f7faf8; }
tr:hover td { background: #fbfdfc; }
.list-card { border-color: var(--line); border-radius: 10px; }
.badge-neutral { color: #56645d; background: #eef2f0; }

.dashboard-table-row:hover { background: #eef8f3; }
.pending-kind { color: #08784c; background: #e7f6ef; }
.count-pill { color: #08784c; background: #e7f6ef; }
.compact-alert { border-radius: 9px; }

.login-page {
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.20), transparent 30%),
    linear-gradient(145deg, #075f42, #0b8f5b 58%, #40bd86);
}
.login-card { border: 1px solid rgba(255,255,255,.55); border-radius: 18px; box-shadow: 0 25px 75px rgba(3,45,29,.30); }
.login-card h1 { color: #173327; font-weight: 700; }
.login-logo { background: linear-gradient(145deg, #0b8f5b, #16a36a); }
.demo-credentials { color: #08784c; background: #e7f6ef; }

.search-result.selected {
  border-color: #0b8f5b !important;
  background: #e9f7f0 !important;
  box-shadow: inset 5px 0 0 #0b8f5b, 0 0 0 2px rgba(11,143,91,.14) !important;
}
.search-result.selected strong { color: #095f3e; }
.result-box { color: #08784c !important; }
.line-number { color: #08784c; background: #e7f6ef; }
.multiplier-banner, .margin-preview { color: #08784c; background: #e7f6ef; border-color: #c6e8d8; }
.shortcut-strip { color: #607068; background: #edf2ef; }
.mini-results button:hover { background: #eef8f3; }

.bottom-nav { background: rgba(255,255,255,.97); border-top-color: var(--line); box-shadow: 0 -3px 16px rgba(23,51,39,.06); }
.bottom-item { color: #65736c; }
.bottom-item.active { color: #08784c; }
.toast { border-radius: 10px; }

@media (max-width: 980px) and (min-width: 761px) {
  .workspace { grid-template-columns: 180px minmax(0,1fr); }
  .nav-item { padding-inline: 9px; }
}
@media (max-width: 760px) {
  .topbar { min-height: 58px; }
  .main { background: var(--canvas); }
  .card { padding: 13px; }
  .stats-mobile-2 .stat { min-height: 96px; }
  .page-title { font-size: 23px; }
}

@media print {
  body, .main { background: #fff !important; }
}

/* ========================================================================== 
   v0.6.9 — Tipografia corrigida e acabamento real da proposta Moderna Clean
   Sem dependência de fontes externas: usa a família nativa do Windows.
   ========================================================================== */
:root {
  --font-ui: "Segoe UI", Arial, Helvetica, sans-serif;
  --font-mono: Consolas, "Courier New", monospace;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.42;
  letter-spacing: 0;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font-family: var(--font-ui);
  font-weight: 400;
  letter-spacing: 0;
}

strong,
b { font-weight: 600; }

.brand-name,
.page-title,
.modal-title,
.login-card h1,
.receipt-store {
  font-family: var(--font-ui) !important;
  font-style: normal;
  letter-spacing: -.015em;
}

.brand-name {
  font-size: 17px;
  font-weight: 700 !important;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.25;
}

.operator strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.operator span {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
}

.page-title {
  font-size: clamp(26px, 2.3vw, 31px);
  font-weight: 700 !important;
  line-height: 1.16;
}

.page-subtitle {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.nav-item {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600 !important;
  line-height: 1.25;
  letter-spacing: 0;
}

.nav-label {
  line-height: 1.25;
  letter-spacing: 0;
}

.nav-icon {
  width: 23px;
  min-width: 23px;
  display: inline-grid;
  place-items: center;
  font-family: "Segoe UI Symbol", "Segoe UI Emoji", sans-serif;
  font-size: 17px;
  line-height: 1;
}

.nav-icon svg,
.brand-mark svg,
.topbar-logout svg,
.bottom-item svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark {
  font-size: 22px;
}

.topbar-logout {
  display: grid;
  place-items: center;
  font-size: 18px;
}

.card-title,
.dashboard-compact-card .card-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700 !important;
  line-height: 1.3;
  letter-spacing: 0;
}

.card-subtitle,
.list-card-meta,
.product-meta,
.cart-item-meta,
.list-row-sub,
.dashboard-row-detail,
.field-help,
small {
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}

.stat-label {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600 !important;
  line-height: 1.2;
  letter-spacing: .025em;
}

.stat-value,
.money,
.number,
.product-price,
.bar-value,
.summary-totals,
.report-total,
.dre .total,
.rental-finance-summary strong,
.purchase-history-preview strong,
.line-number,
.compact-row > span {
  font-family: var(--font-ui) !important;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: 0;
}

.stat-value {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 700 !important;
  line-height: 1.12;
}

.stat-detail {
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
}

.money,
.number,
.product-price,
.bar-value,
.summary-totals,
.report-total,
.line-number,
.compact-row > span {
  font-weight: 600 !important;
}

.btn,
.chip,
.badge,
.count-pill,
.pending-kind,
.stock-badge,
.promotion-badge,
.abc-badge,
.label,
.product-name,
.cart-item-name,
.list-card-title,
.list-row-title,
.dashboard-row-description,
.compact-dashboard-row strong,
.rental-main strong,
.history-open {
  font-family: var(--font-ui);
  font-weight: 600 !important;
  letter-spacing: 0;
}

.btn {
  font-size: 12.5px;
  line-height: 1.2;
}

.btn-sm { font-size: 11.5px; }

.label {
  font-size: 11.5px;
  line-height: 1.25;
}

.input,
.select,
.textarea {
  font-size: 13.5px;
  line-height: 1.35;
}

.chip {
  font-size: 12px;
  line-height: 1.2;
}

.badge,
.count-pill,
.pending-kind,
.stock-badge,
.promotion-badge {
  font-size: 10.5px;
  line-height: 1.15;
}

th,
td {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}

th,
.rental-asset-table-head,
.cost-confirm-head {
  font-size: 10.5px;
  font-weight: 600 !important;
  letter-spacing: .025em;
}

.product-name,
.cart-item-name,
.list-card-title,
.list-row-title,
.dashboard-row-description,
.compact-dashboard-row strong {
  font-size: 12.5px;
  line-height: 1.3;
}

.dashboard-row-value,
.compact-dashboard-row,
.compact-line,
.sales-history-row,
.purchase-history-row,
.rental-row,
.rental-main,
.dre,
.alert,
.toast,
.offline-banner {
  font-family: var(--font-ui);
  letter-spacing: 0;
  word-spacing: 0;
}

.dashboard-row-value { font-weight: 600; }

.modal-title {
  font-size: 19px;
  font-weight: 700 !important;
  line-height: 1.25;
}

.login-card h1 {
  font-size: 26px;
  font-weight: 700 !important;
  line-height: 1.18;
}

.receipt-title,
.receipt-document,
.kbd {
  font-family: var(--font-mono) !important;
}

.kbd {
  font-weight: 600;
  letter-spacing: 0;
}

/* Reduz o excesso de negrito herdado das versões anteriores. */
.qty-btn,
.cart-total,
.dre .strong,
.dre .total,
.report-total,
.toast,
.offline-banner,
.rental-asset-table-head,
.cost-confirm-head,
.abc-badge {
  font-weight: 700 !important;
}

/* Ajustes de espaçamento para a leitura não parecer comprimida. */
.card { line-height: 1.4; }
.dashboard-table-row { line-height: 1.3; }
.dashboard-row-description { font-size: 11.5px; }
.dashboard-row-detail { font-size: 10.5px; }
.dashboard-row-value { font-size: 11.5px; }
.compact-dashboard-row small { font-size: 10.5px; }

@media (max-width: 760px) {
  body { font-size: 13.5px; }
  .page-title { font-size: 24px; }
  .brand-name { font-size: 16px; }
  .nav-item { font-size: 12.5px; }
  .stat-value { font-size: 21px; }
}

/* v0.7.0 — revisão operacional, foco azul e telas compactas */
:root {
  --focus-blue: #0874a8;
  --focus-blue-strong: #075f8a;
  --focus-blue-soft: rgba(8,116,168,.22);
}

/* O foco deve ser inequívoco, inclusive em monitores com pouco contraste. */
:where(input,select,textarea):focus-visible,
:where(input,select,textarea):focus {
  color: var(--ink) !important;
  background: #fff !important;
  border-color: var(--focus-blue) !important;
  outline: 3px solid var(--focus-blue) !important;
  outline-offset: 1px !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 6px var(--focus-blue-soft) !important;
}
:where(button,[role="button"],[tabindex="0"],.key-row,.chip,.nav-item):focus-visible,
:where(.keyboard-selected,.keyboard-focus) {
  color: #fff !important;
  background: var(--focus-blue) !important;
  border-color: var(--focus-blue-strong) !important;
  outline: 3px solid #fff !important;
  outline-offset: -5px !important;
  box-shadow: 0 0 0 4px var(--focus-blue), inset 0 0 0 1px rgba(255,255,255,.45) !important;
}
:where(button,[role="button"],[tabindex="0"],.key-row,.chip,.nav-item):focus-visible :where(svg,path,circle,rect),
:where(.keyboard-selected,.keyboard-focus) :where(svg,path,circle,rect) {
  stroke: currentColor !important;
}
.receivable-table tr:focus-within,
.receivable-table tr.keyboard-selected,
tr.key-row:focus-visible,
.rental-asset-row:focus-visible,
.sales-history-row:focus-visible,
.purchase-history-row:focus-visible {
  background: #d9f0fb !important;
  color: #082f43 !important;
  outline: 3px solid var(--focus-blue) !important;
  outline-offset: -3px !important;
  box-shadow: inset 5px 0 0 var(--focus-blue) !important;
}

/* Barra lateral compacta: todos os itens do gerente visíveis na tela do caixa. */
@media (min-width: 761px) {
  .workspace { grid-template-columns: 205px minmax(0,1fr); }
  .sidebar {
    height: calc(100vh - 64px);
    min-height: 0;
    padding: 6px 9px 8px;
    overflow: hidden;
  }
  .nav-list {
    position: static;
    display: grid;
    gap: 1px;
    align-content: start;
  }
  .nav-item {
    min-height: 31px;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.1;
  }
  .nav-icon {
    width: 20px;
    min-width: 20px;
    height: 20px;
    font-size: 14px;
  }
  .nav-icon svg { width: 16px; height: 16px; }
  .nav-item .kbd { font-size: 9px; padding: 2px 4px; }
}
@media (min-width: 761px) and (max-height: 760px) {
  .nav-item { min-height: 28px; padding-block: 3px; font-size: 11.5px; }
  .nav-list { gap: 0; }
}

/* Histórico de vendas: nenhuma coluna pode escapar do card. */
.sales-history-row {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(118px,145px) minmax(150px,1.5fr) minmax(90px,.8fr) minmax(88px,.7fr) minmax(92px,.75fr);
  overflow: hidden;
}
.sales-history-row > * {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-history { min-width: 0; overflow: hidden; }

/* Relatórios por produto. */
.product-sales-search { margin-top: 14px; }
.product-report-search { width: min(420px,100%); }
.product-report-search .input { width: 100%; }
.product-analysis-stats { margin-top: 12px; }
.product-sales-lines { margin-top: 12px; }

/* Contas a receber e demais tabelas não extrapolam o card. */
.receivable-toolbar { align-items: center; }
.receivable-toolbar .searchbar { min-width: 240px; flex: 1 1 320px; }
.receivable-table-wrap,
.table-wrap { max-width: 100%; overflow: auto; border-radius: 10px; }
.receivable-table { width: 100%; min-width: 900px; table-layout: fixed; }
.receivable-table th,
.receivable-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-reminder-list { display: grid; gap: 5px; max-height: 45vh; overflow: auto; }
.pending-reminder-list .list-row { grid-template-columns: minmax(0,1fr) auto auto; }

/* Painéis internos devem rolar até o foco sem esconder campos ou o F10. */
.modal-body,
.payment-scroll,
.pos-payment-scroll,
.form-scroll,
.purchase-form-scroll {
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.modal :where(input,select,textarea,button,[tabindex="0"]) { scroll-margin: 90px 16px; }

/* Campos somente leitura continuam legíveis e não parecem inválidos. */
.input[readonly], .select[disabled], .input:disabled, .select:disabled {
  color: #435149;
  background: #f2f6f3;
  opacity: 1;
}

@media (max-width: 900px) {
  .sales-history-row { grid-template-columns: minmax(100px,125px) minmax(130px,1fr) 82px 90px; }
  .sales-history-row > :nth-child(5) { display: none; }
  .product-analysis-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* v0.7.1 — menu lateral fixo durante a rolagem do conteúdo */
@media (min-width: 761px) {
  .workspace {
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: 60px;
    align-self: start;
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
    overflow: hidden;
    z-index: 20;
  }

  .sidebar .nav-list {
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* O PDV já possui área de trabalho travada e não deve ganhar deslocamento extra. */
  .app-shell:has(.view-pdv) .sidebar {
    position: static;
    top: auto;
    height: 100%;
    max-height: none;
  }
}


/* v0.7.2 — seletor flutuante de cliente no PDV */
.customer-picker-trigger {
  width:100%; min-height:58px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px;
  padding:10px 12px; border:1px solid var(--line); border-radius:11px; background:#fff; color:var(--ink); text-align:left; cursor:pointer;
}
.customer-picker-trigger strong,.customer-picker-trigger small { display:block; }
.customer-picker-trigger small { margin-top:3px; color:var(--muted); font-size:11px; }
.customer-picker-trigger:hover { background:#eef8f3; border-color:#9fcbb1; }
.selected-customer-actions { display:flex; align-items:center; gap:4px; flex:0 0 auto; }
.customer-picker-search { position:sticky; top:0; z-index:2; background:#fff; }
.customer-picker-meta { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:10px 0 8px; color:var(--muted); font-size:12px; }
.customer-picker-list { max-height:min(54vh,460px); overflow-y:auto; overscroll-behavior:contain; border-radius:12px; }
.customer-picker-list .customer-picker-row { padding:13px 14px; min-height:62px; }
.customer-picker-name { display:flex !important; align-items:center; justify-content:space-between; gap:10px; }
.customer-picker-name .badge { display:inline-flex; margin:0; }
.customer-picker-list button:focus-visible,.customer-picker-list button:focus {
  color:#fff !important; background:var(--focus-blue) !important; outline:3px solid #fff !important; outline-offset:-5px !important;
  box-shadow:0 0 0 4px var(--focus-blue),inset 0 0 0 1px rgba(255,255,255,.45) !important;
}
.customer-picker-list button:focus span,.customer-picker-list button:focus-visible span { color:#fff !important; }
@media (max-width:760px){
  .customer-picker-meta{align-items:flex-start;flex-direction:column;}
  .customer-picker-list{max-height:58vh;}
}


/* v0.7.3 — PDV com perfil automático, carrinho unificado e F9 acessível */
.price-profile-indicator{display:grid;gap:1px;min-width:132px;padding:7px 11px;border:1px solid #a9d2ba;border-radius:11px;background:#eef8f3;color:var(--ink);text-align:left;cursor:pointer}
.price-profile-indicator span{font-weight:800;color:var(--green);font-size:12px;text-transform:uppercase}.price-profile-indicator small{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:10px}
.price-profile-indicator:focus-visible{outline:4px solid var(--focus-blue);outline-offset:2px;background:#e8f5fb;border-color:var(--focus-blue)}
.cart-item.cart-updated{border-radius:9px;background:#dff5ff!important;box-shadow:inset 5px 0 0 var(--focus-blue);animation:cart-update-pulse .9s ease-out}
@keyframes cart-update-pulse{0%{transform:scale(.985);filter:brightness(1.08)}55%{transform:scale(1.006)}100%{transform:scale(1)}}
.cart-remove-row.cart-quantity-row.selected{border:3px solid var(--focus-blue);background:#dff5ff;box-shadow:inset 4px 0 0 var(--focus-blue)}
.cart-remove-row.cart-quantity-row:focus-visible{outline:4px solid var(--focus-blue);outline-offset:1px;background:#dff5ff}
@media(max-width:760px){.price-profile-indicator{min-width:0;max-width:42vw}}

/* v0.7.5 — confirmação forte de perfil de revenda */
.resale-discount-alert{display:grid;justify-items:center;text-align:center;gap:12px;padding:12px 18px 18px}
.resale-discount-icon{display:grid;place-items:center;width:72px;height:72px;border-radius:50%;background:#0b8f5b;color:#fff;font-size:40px;font-weight:900;box-shadow:0 0 0 8px #dff4e9}
.resale-discount-alert h2{margin:0;font-size:28px;color:#075f3d}
.resale-discount-alert p{margin:0;font-size:17px;font-weight:700;color:var(--ink)}
.resale-discount-total{display:flex;align-items:center;justify-content:space-between;gap:28px;width:min(100%,560px);padding:16px 20px;border:3px solid var(--focus-blue);border-radius:14px;background:#eaf7fd}
.resale-discount-total span{font-weight:700}.resale-discount-total strong{font-size:28px;color:#075f3d}
.price-profile-indicator .kbd{margin-right:4px;background:#fff;border-color:#7bb6d1;color:#075f3d}

/* v0.7.5 — refinamentos finais de foco, PDV e compra */
.selected-customer-strip{display:flex;align-items:center;gap:10px;width:max-content;max-width:100%;margin:8px 0 0;padding:7px 11px;border:1px solid #a9d2ba;border-radius:10px;background:#eef8f3;color:var(--ink);cursor:pointer}
.selected-customer-strip span{font-size:11px;color:var(--green);font-weight:800}.selected-customer-strip strong{font-size:13px}.selected-customer-strip small{font-size:11px;color:var(--muted)}
.selected-customer-strip:focus-visible,.pending-shortcut:focus-visible{outline:4px solid var(--focus-blue);outline-offset:2px}
.purchase-final-item-action{display:flex;justify-content:flex-end;margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
.purchase-final-item-action .add-item-button{min-width:170px}
.isolated-option{margin-left:auto;align-self:end;opacity:.95}
.modal-actions.primary-first{justify-content:flex-end}
.box-search-result{border-color:#d9b85f;background:#fffaf0}

/* v0.7.6 — PDV sem vazamento de estado e modal de compra estável */
@media (min-width: 761px) {
  .modal.xwide {
    height: min(92vh, 900px);
    max-height: min(92vh, 900px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .modal.xwide > .modal-head { flex: 0 0 auto; }
  .modal.xwide > .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }
  .purchase-compact .supplier-field,
  .purchase-compact .purchase-product { position: relative; }
  .purchase-compact .supplier-field .mini-results,
  .purchase-compact .purchase-product .mini-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 3px);
    z-index: 20;
    max-height: 210px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .purchase-entry { min-height: 248px; }
  .purchase-decision-line { min-height: 42px; }
  .compact-price-review { min-height: 72px; }
  .purchase-inline-validation { min-height: 18px; margin-bottom: 0; }
  .purchase-inline-validation.is-empty { visibility: hidden; }
  .purchase-voice-status { min-height: 0; }
}

.date-mask { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.view-pdv .toolbar .searchbar { flex: 1 1 auto; width: 100%; }
.view-pdv .payment-key-hint { display: inline; margin-left: 5px; font-size: 9px; opacity: .72; font-weight: 500; }
.view-pdv .customer-shortcut { min-width: 185px; }
@media (max-width: 760px) { .view-pdv .customer-shortcut { min-width: 0; max-width: 46vw; } }

/* v0.7.7 — fluxo Prazo, busca de embalagens e operação sem mouse */
.view-pdv .pos-search-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px}
.view-pdv .pos-search-toolbar .searchbar{width:100%;min-width:0}
.pos-cancel-sale{min-height:44px;white-space:nowrap;display:inline-flex;align-items:center;gap:8px;border-color:#c8d6cf;background:#fff}
.pos-cancel-sale:not(:disabled):hover{border-color:#a53a32;color:#8e241d;background:#fff3f1}
.pos-cancel-sale:focus-visible{outline:4px solid var(--focus-blue)!important;outline-offset:2px}
.sale-mode-label{display:inline-flex!important;align-items:center;width:max-content;margin:0!important;padding:3px 7px;border-radius:999px;font-size:9px!important;font-weight:900;letter-spacing:.045em;line-height:1!important}
.unit-mode-label{background:#e8f5ee;color:#09633f!important;border:1px solid #9acdb1}
.package-mode-label{background:#fff2c8;color:#744f00!important;border:1px solid #deb44a}
.package-search-result .result-box.package-intent-highlight{position:relative;border:3px solid var(--focus-blue)!important;background:#e8f6fd!important;color:#064f72!important;box-shadow:0 0 0 5px rgba(8,116,168,.14);animation:package-intent-pulse .9s ease-out 1}
.package-search-result .result-box.package-intent-highlight span{color:#064f72!important;font-size:12px;font-weight:900}
.package-mode-callout{display:inline-flex;align-items:center;margin:0 4px 0 0;padding:4px 7px;border-radius:7px;background:var(--focus-blue);color:#fff;font-size:10px;font-style:normal;font-weight:900;letter-spacing:.04em;white-space:nowrap}
@keyframes package-intent-pulse{0%{transform:scale(.985);box-shadow:0 0 0 0 rgba(8,116,168,.5)}55%{transform:scale(1.01);box-shadow:0 0 0 10px rgba(8,116,168,.12)}100%{transform:scale(1);box-shadow:0 0 0 5px rgba(8,116,168,.14)}}
.prazo-customer-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px;padding:9px 11px;border:2px solid #83bda0;border-radius:10px;background:#eef8f3}
.prazo-customer-summary span{display:grid;gap:2px;min-width:0}.prazo-customer-summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.prazo-customer-summary small{color:var(--muted)}
.prazo-customer-summary>b{padding:4px 8px;border-radius:999px;background:#0b8f5b;color:#fff;font-size:10px;text-transform:uppercase}
.resale-discount-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:min(100%,560px)}
.resale-discount-comparison>div{display:grid;gap:5px;padding:12px 16px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}
.resale-discount-comparison span{color:var(--muted);font-size:12px;font-weight:700}.resale-discount-comparison strong{font-size:22px}
@media(max-width:760px){.view-pdv .pos-search-toolbar{grid-template-columns:1fr}.pos-cancel-sale{width:100%;justify-content:center}.resale-discount-comparison{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.package-search-result .result-box.package-intent-highlight{animation:none}}

/* v0.7.9 — validade por lote e custo de embalagens */
.input-danger{border-color:var(--danger)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--danger) 18%,transparent)!important}
.input-warning{border-color:#d89b16!important;box-shadow:0 0 0 3px rgba(216,155,22,.16)!important}
.purchase-expiry-alert{margin:0 12px 10px}
.cost-value small{display:block;margin-top:4px;line-height:1.25;color:var(--muted);white-space:nowrap}
.expiry-legend{display:flex;gap:10px;align-items:center;margin:10px 0 12px;flex-wrap:wrap}
.expiry-legend-item{border-radius:999px;padding:6px 10px;font-size:.78rem;font-weight:800;border:1px solid var(--border)}
.expiry-legend-item.expired,.expiry-expired{background:#fff1f1;border-color:#e47474}
.expiry-legend-item.critical,.expiry-critical{background:#fff6df;border-color:#d9a62b}
.expiry-legend-item.warning,.expiry-warning{background:#fffdf2;border-color:#d7c37a}
.expiry-row td{vertical-align:middle}
.expiry-row.expiry-expired td:first-child{border-left:5px solid var(--danger)}
.expiry-row.expiry-critical td:first-child{border-left:5px solid #d89b16}
.expiry-row.expiry-warning td:first-child{border-left:5px solid #c3a43c}
.expiry-dashboard{border-color:#d9a62b}
.expiry-dashboard .compact-line{border-radius:10px;padding:9px 10px;margin-top:6px}
@media (max-width:760px){.cost-value small{white-space:normal}.expiry-legend{gap:6px}}

/* v0.8.0 — clientes verticais e estabilidade visual da compra */
.customer-list{display:flex;flex-direction:column;gap:7px}
.customer-list-row{display:grid;grid-template-columns:minmax(260px,1.7fr) minmax(110px,.65fr) minmax(150px,.8fr) minmax(120px,.65fr) minmax(140px,.75fr) auto;gap:14px;align-items:center;width:100%;min-height:74px;padding:12px 14px;text-align:left;cursor:pointer}
.customer-list-row:hover,.customer-list-row:focus-visible{border-color:var(--accent);background:var(--accent-soft)}
.customer-list-main{min-width:0}.customer-list-main strong{display:block;font-size:15px}.customer-list-main small{display:block;margin-top:4px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.customer-list-cell{display:grid;gap:4px}.customer-list-cell>span{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700}.customer-list-cell>b{font-size:13px}.customer-list-cell.money-cell b{font-variant-numeric:tabular-nums}
.customer-list-actions{display:flex;justify-content:flex-end;gap:6px}
.purchase-item-line{align-items:start!important}
.purchase-item-line>.field{display:grid;grid-template-rows:auto minmax(34px,auto) minmax(16px,auto);align-content:start}
.purchase-item-line .purchase-product{grid-template-rows:auto auto auto}
.purchase-item-line .cost-value small{display:block;min-height:16px;line-height:1.2;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.purchase-item-line .expiry-field{grid-template-rows:auto minmax(34px,auto) minmax(16px,auto)}
.purchase-finalize-hint{margin-top:6px;min-height:18px}
.purchase-large-adjustment{display:grid;gap:10px}.purchase-large-adjustment .check-row{padding:10px;border:1px solid currentColor;border-radius:9px;background:#fff;font-weight:700}
#purchase-adjustment-total.normal{color:#176b40}#purchase-adjustment-total.warning{color:#9a6200}#purchase-adjustment-total.critical{color:#b42318}#purchase-adjustment-total.invalid{color:#b42318}#purchase-adjustment-total.success{color:#176b40}
@media(max-width:1050px){.customer-list-row{grid-template-columns:minmax(220px,1.5fr) repeat(2,minmax(120px,1fr))}.customer-list-cell:nth-of-type(3),.customer-list-cell:nth-of-type(4){display:none}.customer-list-actions{grid-column:auto}}
@media(max-width:760px){.customer-list-row{grid-template-columns:1fr auto;gap:8px}.customer-list-main{grid-column:1}.customer-list-cell{grid-column:1}.customer-list-cell:nth-of-type(n){display:grid}.customer-list-actions{grid-column:1/-1;justify-content:flex-start}.purchase-item-line>.field{grid-template-rows:auto auto auto}}

/* v0.8.2 · separação visual de homologação/migração */
.environment-banner{
  position:relative;z-index:1200;width:100%;padding:8px 16px;text-align:center;
  font-weight:900;letter-spacing:.08em;font-size:12px;color:#fff;background:#b42318;
  border-bottom:2px solid rgba(255,255,255,.7);box-shadow:0 2px 8px rgba(0,0,0,.18)
}
.login-page>.environment-banner{position:fixed;top:0;left:0}
.replenishment-dashboard{box-shadow:0 0 0 2px rgba(180,35,24,.08)}


/* 1.1.0 — contraste, vendas realizadas, contas agrupadas e DRE */
.selected-customer-strip {
  background:#155f4d !important;
  border-color:#155f4d !important;
  color:#fff !important;
  box-shadow:0 2px 8px rgba(21,95,77,.22);
}
.selected-customer-strip span,
.selected-customer-strip strong,
.selected-customer-strip small { color:#fff !important; opacity:1 !important; }
.selected-customer-strip small { color:#e7f6ef !important; }
.selected-customer-strip:hover { background:#0f4d3f !important; border-color:#0f4d3f !important; }

.sales-lookup-card{margin-top:14px}.sales-lookup-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.sales-lookup-toolbar .searchbar{min-width:min(520px,100%);flex:1}.sales-lookup-table th,.sales-lookup-table td{vertical-align:middle}.sales-lookup-table tbody tr:hover{background:#eef8f3}.sales-lookup-table td:last-child{text-align:right;white-space:nowrap}
.receivable-group-table td:first-child strong{display:block}.receivable-group-table td:first-child small{display:block;color:var(--muted);margin-top:2px}.receivable-customer-titles{display:grid;gap:6px;margin-top:14px}.receivable-customer-title{display:grid;grid-template-columns:minmax(190px,1.5fr) 110px 110px auto auto;gap:10px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff}.receivable-customer-title small{display:block;color:var(--muted);margin-top:3px}.receivable-customer-title.overdue{border-left:5px solid #b3261e;background:#fff8f6}
.dre-main-card{border-top:4px solid var(--green)}.dre-expanded{max-width:900px}.dre-breakdown{margin-top:14px;border-top:1px solid var(--line);padding-top:12px}.dre-breakdown summary{cursor:pointer;font-weight:800;color:var(--green)}.dre-breakdown .grid{margin-top:12px}.exchange-credit-rule{margin-bottom:12px}.exchange-balance-credit{border:2px solid #155f4d;background:#eef8f3}.exchange-balance-credit strong{color:#155f4d}
@media (max-width:900px){.receivable-customer-title{grid-template-columns:1fr 100px}.receivable-customer-title>*:nth-child(n+3){grid-column:auto}.sales-lookup-table{min-width:780px}}

/* HOTFIX — contraste da linha selecionada em Clientes */
.customer-list-row.keyboard-selected,
.customer-list-row.keyboard-focus,
.customer-list-row:focus,
.customer-list-row:focus-visible {
  background:#155f4d !important;
  border-color:#0f4a3b !important;
  color:#ffffff !important;
  outline:3px solid #ffffff !important;
  outline-offset:-5px !important;
  box-shadow:0 0 0 4px #155f4d,inset 5px 0 0 rgba(255,255,255,.35) !important;
}
.customer-list-row.keyboard-selected .customer-list-main strong,
.customer-list-row.keyboard-selected .customer-list-main small,
.customer-list-row.keyboard-selected .customer-list-cell > span,
.customer-list-row.keyboard-selected .customer-list-cell > b,
.customer-list-row.keyboard-focus .customer-list-main strong,
.customer-list-row.keyboard-focus .customer-list-main small,
.customer-list-row.keyboard-focus .customer-list-cell > span,
.customer-list-row.keyboard-focus .customer-list-cell > b,
.customer-list-row:focus .customer-list-main strong,
.customer-list-row:focus .customer-list-main small,
.customer-list-row:focus .customer-list-cell > span,
.customer-list-row:focus .customer-list-cell > b { color:#ffffff !important; }

/* 1.2.0 — fluxo operacional, clique confiável, compras e PDV */
.mini-results button:focus,
.mini-results button:focus-visible,
.mini-results button.keyboard-selected,
.mini-results button.selected {
  background:#155f4d !important;
  color:#fff !important;
  border-color:#0f4a3b !important;
  outline:3px solid #0f4a3b !important;
  outline-offset:-2px !important;
}
.mini-results button:focus strong,.mini-results button:focus span,
.mini-results button:focus-visible strong,.mini-results button:focus-visible span,
.mini-results button.keyboard-selected strong,.mini-results button.keyboard-selected span,
.mini-results button.selected strong,.mini-results button.selected span { color:#fff !important; opacity:1 !important; }
.compact-one-line-results button{display:flex;align-items:center;gap:10px;min-width:0;padding:9px 11px}
.compact-one-line-results button strong{display:block;min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.compact-one-line-results button span{display:block;flex:0 0 auto;margin:0;white-space:nowrap;font-size:11px}
.purchase-item-line-v120{grid-template-columns:minmax(310px,1.7fr) 115px 85px 135px 135px 145px!important}
.purchase-item-row{grid-template-columns:34px minmax(0,1fr) auto 62px 36px!important}
.purchase-item-row.expanded{min-height:58px;padding:10px}
.purchase-expanded-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:12px}
.purchase-expanded-list{display:grid;gap:7px;max-height:65vh;overflow:auto;padding-right:4px}
.payment-summary-sticky{position:relative;z-index:5;background:#f5f1e6!important}
.payment-summary-sticky .change-highlight{font-size:15px;font-weight:900;padding:5px 9px;border-radius:8px;background:#fff3c7;color:#5a4200}
.pdv-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.view-pdv .receipt-fixed{padding-bottom:8px!important}
.view-pdv .desktop-finalize{margin-top:6px!important}
.branch-entry-v120{grid-template-columns:180px 95px 90px minmax(300px,1fr) auto!important}
.branch-mode-field{min-width:80px}
button,[role="button"],[data-action]{touch-action:manipulation}
.btn,.chip,.mini-results button,.compact-row button{min-height:36px}
.btn-sm{min-height:32px}
[data-action]:active{transform:translateY(1px)}
@media(max-width:1100px){.purchase-item-line-v120,.branch-entry-v120{grid-template-columns:1fr 1fr!important}.purchase-product,.branch-product-field{grid-column:1/-1}}
@media(max-width:760px){.purchase-item-line-v120,.branch-entry-v120{grid-template-columns:1fr!important}.purchase-product,.branch-product-field{grid-column:auto}.compact-one-line-results button span{max-width:42%;overflow:hidden;text-overflow:ellipsis}.purchase-expanded-head{align-items:stretch;flex-direction:column}.purchase-item-row{grid-template-columns:28px minmax(0,1fr) 36px!important}.purchase-item-row>b{grid-column:2}.purchase-item-row .btn{grid-row:auto}}

/* ===== Mercado Rio Paraná 1.3.0 — revisão operacional consolidada ===== */
.payment-summary-sticky{
  position:sticky;
  bottom:0;
  z-index:5;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  align-items:stretch;
  padding:9px 0 7px;
  background:#fff;
  border-top:1px solid var(--line);
  overflow:visible!important;
}
.payment-summary-sticky>span{min-width:0;padding:8px 6px;border-radius:9px;background:var(--canvas);text-align:center;white-space:normal;overflow-wrap:anywhere}
.payment-summary-sticky .change-highlight{font-size:1.08em;font-weight:800}
.payment-summary-sticky .change-highlight b{display:block;font-size:1.3em;line-height:1.05}
.receipt-payment-scroll{overflow-x:hidden!important;padding-bottom:4px}
.receipt-fixed{overflow-x:hidden!important}
.pos-discount-trigger{margin-top:8px;font-weight:700}
.discount-final-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-bottom:14px}
.discount-final-summary>div{padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--canvas);display:flex;flex-direction:column;gap:4px}
.discount-final-remaining b{font-size:1.2em}
.active-filter-summary{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0 10px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:.85rem}
.sale-row-cancelled{opacity:.8;background:rgba(180,45,45,.055)}
.sale-row-cancelled td{text-decoration:none}
.cash-session-period{display:flex;gap:18px;flex-wrap:wrap;margin:12px 0;padding:10px 12px;border-radius:10px;background:var(--canvas)}
.cash-ledger-title{margin:14px 0 8px}
.cash-ledger{border:1px solid var(--line);border-radius:10px;overflow:hidden}
.cash-ledger-head,.cash-ledger-row{display:grid;grid-template-columns:72px minmax(220px,1.7fr) minmax(90px,.8fr) 110px 110px;gap:8px;align-items:center;padding:8px 10px}
.cash-ledger-head{font-size:.75rem;font-weight:800;text-transform:uppercase;background:var(--canvas);border-bottom:1px solid var(--line)}
.cash-ledger-row{border-bottom:1px solid var(--line);font-size:.86rem}
.cash-ledger-row:last-child{border-bottom:0}
.cash-ledger-row span:nth-child(2){display:flex;flex-direction:column;min-width:0}
.cash-ledger-row small{color:var(--muted);overflow-wrap:anywhere}
.cash-ledger-row.cash-in{box-shadow:inset 3px 0 0 rgba(25,120,70,.55)}
.cash-ledger-row.cash-out{box-shadow:inset 3px 0 0 rgba(180,45,45,.55)}
.branch-entry-pdv{display:grid;grid-template-columns:minmax(160px,.65fr) 100px minmax(300px,1.7fr) auto;gap:10px;align-items:end}
.branch-entry-pdv .branch-product-field{min-width:0}
.branch-flow-help{margin:8px 0 10px;padding:8px 10px;border-radius:9px;background:var(--canvas);font-size:.84rem;color:var(--muted)}
.purchase-stock-balance{font-weight:900!important}
.purchase-decision-line .cost-change strong{font-weight:900}
.thermal-discount{font-weight:800}
.discount-audit-card table td,.discount-audit-card table th{white-space:nowrap}

@media(max-width:900px){
  .branch-entry-pdv{grid-template-columns:1fr 88px}.branch-entry-pdv .branch-product-field{grid-column:1/-1}.branch-entry-pdv .branch-add-button{grid-column:1/-1;width:100%}
  .cash-ledger{overflow-x:auto}.cash-ledger-head,.cash-ledger-row{min-width:690px}
  .payment-summary-sticky{grid-template-columns:repeat(3,minmax(0,1fr));font-size:.82rem}
}
@media(max-width:520px){
  .discount-final-summary{grid-template-columns:1fr}
  .payment-summary-sticky{gap:4px}.payment-summary-sticky>span{padding:7px 3px;font-size:.78rem}.payment-summary-sticky .change-highlight b{font-size:1.15em}
}

/* ===== Mercado Rio Paraná 1.3.1 — carrinho alto e pagamento visível ===== */
@media (min-width:761px) {
  .view-pdv .pdv-local-head {
    width:100%;
    min-width:0;
    margin-bottom:8px;
    align-items:center;
    justify-content:flex-start;
    gap:14px;
  }
  .view-pdv .pdv-title-copy {
    flex:0 1 auto;
    min-width:0;
  }
  .view-pdv .pdv-title-copy .page-title,
  .view-pdv .pdv-title-copy .page-subtitle {
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .view-pdv .pdv-local-head .page-actions {
    flex:0 0 auto;
    justify-content:flex-start;
  }
  .view-pdv .pdv-local-head .pdv-head-actions {
    flex-wrap:nowrap;
  }
  .view-pdv .pdv-local-head .btn {
    min-height:34px;
    padding:6px 9px;
    white-space:nowrap;
  }
  .view-pdv .receipt {
    align-self:stretch;
  }
  .view-pdv .receipt-payment-scroll {
    scrollbar-gutter:stable;
    scroll-padding-block:8px 82px;
  }
  .view-pdv #pos-payment-amount {
    scroll-margin-block:8px 82px;
  }
}

@media (min-width:761px) and (max-width:1180px) {
  .view-pdv .pdv-local-head {
    flex-wrap:wrap;
    gap:6px 10px;
  }
  .view-pdv .pdv-local-head .page-actions {
    width:100%;
  }
}

@media (max-width:760px) {
  .view-pdv .pdv-local-head .page-actions,
  .view-pdv .pdv-local-head .pdv-head-actions {
    width:100%;
  }
  .view-pdv .pdv-local-head .pdv-head-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .view-pdv .pdv-local-head .btn {
    width:100%;
    justify-content:center;
  }
}

/* ===== Mercado Rio Paraná 1.3.3 — escolha simples de produtos ===== */
.view-pdv .pos-result-context {
  position:static;
  z-index:4;
  display:flex;
  align-items:center;
  gap:9px;
  min-height:34px;
  padding:6px 9px;
  border:1px solid #9fcbb1;
  border-radius:9px;
  background:#eef8f3;
  box-shadow:0 3px 10px rgba(20,74,47,.08);
  color:#174b32;
}

/* ===== Mercado Rio Paraná 1.3.4 — primeira opção sempre visível ===== */
.view-pdv .search-result {
  scroll-margin-block:6px;
}
.view-pdv .pos-result-context strong {
  flex:0 0 auto;
  padding:3px 7px;
  border-radius:999px;
  background:#0b8f5b;
  color:#fff;
  font-size:10px;
  letter-spacing:.045em;
}
.view-pdv .pos-result-context span {
  min-width:0;
  margin:0;
  color:#456357;
  font-size:11px;
  font-weight:700;
}
.view-pdv .search-result {
  grid-template-columns:minmax(0,1fr) minmax(92px,auto);
  min-height:70px;
  gap:12px;
  padding:9px 11px;
}
.view-pdv .search-result .result-main {
  min-width:0;
  display:grid;
  gap:5px;
}
.view-pdv .search-result .result-title-row {
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  flex-wrap:wrap;
}
.view-pdv .search-result .result-title-row strong {
  min-width:0;
  font-size:13px;
  line-height:1.25;
}
.view-pdv .search-result .sale-mode-label {
  flex:0 0 auto;
  padding:3px 7px;
}
.view-pdv .search-result .result-meta {
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  flex-wrap:wrap;
}
.view-pdv .search-result .result-presentation-detail {
  display:inline-flex;
  align-items:center;
  margin:0;
  color:#334c40;
  font-size:11px;
  font-weight:800;
}
.view-pdv .search-result .stock-badge {
  display:inline-flex;
  width:max-content;
  margin:0;
  padding:3px 7px;
  font-size:10px;
}
.view-pdv .search-result .result-prices {
  grid-column:2;
  grid-row:1;
  align-self:center;
  align-items:flex-end;
  min-width:92px;
  gap:0;
  text-align:right;
}
.view-pdv .search-result .result-prices b {
  color:#13251b;
  font-size:16px;
  line-height:1.15;
  white-space:nowrap;
}
.view-pdv .search-result .result-prices small {
  display:block;
  margin-top:2px;
  color:#64736b;
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}
.view-pdv .package-search-result {
  border-color:#b9cfc2;
  background:#fff;
}
.view-pdv .package-search-result.selected {
  border-color:#0b8f5b !important;
  background:#e9f7f0 !important;
}
@media (max-width:760px) {
  .view-pdv .pos-result-context {
    position:static;
    align-items:flex-start;
    flex-direction:column;
    gap:4px;
  }
  .view-pdv .search-result {
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
  }
  .view-pdv .search-result .result-prices {
    grid-column:2;
    align-items:flex-end;
  }
}

/* ===== Mercado Rio Paraná 1.4.1 — ordenação, lançamentos e promoções legíveis ===== */
.inventory-sortable {
  padding:0 !important;
  vertical-align:middle;
}
.inventory-sort-button {
  display:flex;
  width:100%;
  min-height:38px;
  align-items:center;
  justify-content:flex-start;
  gap:5px;
  padding:8px 10px;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  font-weight:800;
  text-align:left;
  cursor:pointer;
  white-space:nowrap;
}
.inventory-sort-button span {
  color:#738078;
  font-size:12px;
}
.inventory-sort-button:hover,
.inventory-sort-button.active {
  background:#eaf6ef;
  color:#087a4e;
}
.inventory-sort-button.active span { color:#087a4e; }

.branch-report-heading {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}
.branch-report-heading h2,
.branch-report-heading p { margin:0; }
.branch-report-heading p { color:var(--muted); font-weight:700; }
.branch-report-launches { display:grid; gap:9px; }
.branch-report-empty {
  padding:22px;
  border:1px dashed var(--line);
  border-radius:11px;
  color:var(--muted);
  text-align:center;
}
.branch-launch-card {
  overflow:hidden;
  border:1px solid #cfd9d2;
  border-radius:11px;
  background:#fff;
}
.branch-launch-card > summary {
  display:grid;
  grid-template-columns:minmax(150px,.8fr) minmax(240px,1.4fr) auto auto;
  gap:12px;
  align-items:center;
  min-height:68px;
  padding:10px 12px;
  list-style:none;
  cursor:pointer;
}
.branch-launch-card > summary::-webkit-details-marker { display:none; }
.branch-launch-card > summary::marker { content:""; }
.branch-launch-card > summary:hover { background:#f3f8f5; }
.branch-launch-card[open] > summary {
  border-bottom:1px solid #d9e2dc;
  background:#edf7f1;
}
.branch-launch-title,
.branch-launch-meta,
.branch-launch-totals { display:grid; gap:3px; }
.branch-launch-title strong { color:#0c6e48; font-size:14px; }
.branch-launch-title small,
.branch-launch-meta span { color:var(--muted); font-size:11px; }
.branch-launch-meta b { color:var(--ink); }
.branch-launch-totals { justify-items:end; white-space:nowrap; }
.branch-launch-totals strong { color:#0b704a; font-size:15px; }
.branch-launch-summary-action {
  min-width:82px;
  color:#087a4e;
  font-size:11px;
  font-weight:800;
  text-align:right;
}
.branch-launch-summary-action .when-open { display:none; }
.branch-launch-card[open] .branch-launch-summary-action .when-closed { display:none; }
.branch-launch-card[open] .branch-launch-summary-action .when-open { display:inline; }
.branch-launch-details { padding:10px 12px 12px; }
.branch-launch-details .table-wrap { margin:0; }
.branch-launch-footer {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:8px 18px;
  padding-top:9px;
  color:var(--muted);
  font-size:11px;
}
.branch-launch-footer b { color:var(--ink); }
.branch-report-actions { flex-wrap:wrap; }

.view-pdv .search-result {
  height:auto !important;
  min-height:78px !important;
  grid-template-columns:minmax(0,1fr) minmax(102px,auto) !important;
  align-items:center !important;
  gap:12px !important;
  overflow:visible !important;
  padding:10px 12px !important;
}
.view-pdv .search-result.promotion-result { min-height:96px !important; }
.view-pdv .search-result .result-main {
  align-self:stretch;
  align-content:center;
  gap:6px;
  overflow:visible;
}
.view-pdv .search-result .result-title-row {
  min-height:22px;
  gap:6px 8px;
}
.view-pdv .search-result .result-title-row strong {
  overflow-wrap:anywhere;
  line-height:1.3;
}
.view-pdv .search-result .promotion-badge,
.view-pdv .search-result .sale-mode-label { margin:0; }
.view-pdv .search-result .result-meta {
  min-height:22px;
  gap:5px 8px;
}
.view-pdv .search-result .result-presentation-detail,
.view-pdv .search-result .stock-badge {
  line-height:1.25;
  white-space:normal;
}
.view-pdv .search-result .promotion-saving {
  display:block;
  min-height:18px;
  margin:0;
  padding-top:4px;
  border-top:1px dashed rgba(158,96,0,.35);
  color:#824700;
  font-size:11px;
  font-weight:800;
  line-height:1.3;
}
.view-pdv .search-result .result-prices {
  grid-column:2 !important;
  grid-row:1 !important;
  align-self:center !important;
  gap:2px;
  min-width:102px;
}
.view-pdv .search-result .result-prices .result-normal-price {
  display:block;
  margin:0;
  color:#6f7772;
  font-size:12px;
  line-height:1.2;
}
.view-pdv .search-result .result-prices b { font-size:18px; }
.view-pdv .promotion-result {
  border-color:#d89b00;
  background:linear-gradient(135deg,#fff8d9,#fffdf5);
}
.view-pdv .promotion-result.selected {
  border-color:#0b8f5b !important;
  background:linear-gradient(135deg,#fff4bd,#f1faef) !important;
  box-shadow:inset 5px 0 0 #0b8f5b,0 0 0 2px rgba(11,143,91,.18) !important;
}
@media (max-width:760px) {
  .branch-launch-card > summary {
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
  }
  .branch-launch-meta { grid-column:1/-1; }
  .branch-launch-totals { grid-column:2; grid-row:1; }
  .branch-launch-summary-action { grid-column:2; grid-row:2; }
  .view-pdv .search-result { gap:8px !important; }
}
@media (max-width:520px) {
  .view-pdv .search-result { grid-template-columns:minmax(0,1fr) !important; }
  .view-pdv .search-result .result-prices {
    grid-column:1 !important;
    grid-row:2 !important;
    align-items:baseline !important;
    flex-direction:row;
    justify-content:flex-start;
    gap:8px;
    text-align:left;
  }
}

/* ===== Mercado Rio Paraná 1.4.2 — promoções protegidas e organizadas ===== */
.promotion-status-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.promotion-status-toolbar .searchbar { flex:1 1 420px; }
.promotion-status-tabs { flex:0 1 auto; justify-content:flex-end; }
.promotion-status-tabs .chip {
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.promotion-status-tabs .chip b {
  display:inline-grid;
  min-width:21px;
  height:21px;
  place-items:center;
  padding:0 5px;
  border-radius:999px;
  background:#eef2f0;
  color:#526159;
  font-size:10px;
}
.promotion-status-tabs .chip.active b {
  background:rgba(255,255,255,.22);
  color:#fff;
}
.promotion-row-active { background:#fffdf4; }
.promotion-row-scheduled { background:#fff9e7; }
.promotion-row-expired { background:#fbf2f1; color:#6f625f; }
.promotion-row-expired td { border-color:#ead8d5; }
.promotion-row-expired .promotion-price { color:#8f4f48; }
.promotion-row-expired s { color:#8c817e; }

.promotion-product-field { grid-column:1/-1; }
.promotion-product-results {
  max-height:min(410px,46vh);
  overflow:auto;
  overscroll-behavior:contain;
}
.promotion-product-results .promotion-product-option {
  display:grid;
  gap:5px;
  min-height:78px;
  padding:10px 12px;
}
.promotion-product-results .promotion-option-head,
.promotion-product-results .promotion-option-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.promotion-product-results .promotion-option-head strong {
  min-width:0;
  line-height:1.28;
  overflow-wrap:anywhere;
}
.promotion-product-results .promotion-current-badge {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  border-radius:999px;
  padding:4px 8px;
  background:#c6281f;
  color:#fff;
  font-size:10px;
  font-weight:800;
  letter-spacing:.03em;
}
.promotion-product-results .promotion-option-code {
  color:var(--muted);
  font-size:11px;
}
.promotion-product-results .promotion-option-stock {
  color:#163d2d;
  font-size:12px;
  font-weight:900;
}
.promotion-product-results .promotion-option-footer em {
  color:#9b2d25;
  font-size:11px;
  font-style:normal;
  font-weight:800;
  text-align:right;
}
.promotion-product-results .promotion-option-blocked,
.promotion-product-results .promotion-option-blocked:hover {
  border-left:5px solid #c6281f;
  background:#fff0ee;
  cursor:not-allowed;
}
.promotion-selected-stock {
  display:block;
  margin-top:3px;
  color:#12603f;
  font-size:12px;
  font-weight:900;
}
.promotion-selected-conflict {
  border-color:#e6aaa4;
  background:#fff0ee;
}
.promotion-conflict-alert {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:14px 0;
  padding:12px 14px;
  border:2px solid #d45449;
  border-radius:12px;
  background:#fff0ee;
  color:#8c2821;
}
.promotion-conflict-alert > div { display:grid; gap:3px; }
.promotion-conflict-alert strong { font-size:12px; letter-spacing:.025em; }
.promotion-conflict-alert span { font-size:12px; font-weight:700; }

@media (max-width:820px) {
  .promotion-status-toolbar { align-items:stretch; flex-direction:column; }
  .promotion-status-toolbar .searchbar { flex-basis:auto; }
  .promotion-status-tabs { justify-content:flex-start; }
}
@media (max-width:620px) {
  .promotion-product-results .promotion-option-head,
  .promotion-product-results .promotion-option-footer,
  .promotion-conflict-alert { align-items:flex-start; flex-direction:column; }
  .promotion-product-results .promotion-option-footer em { text-align:left; }
  .promotion-conflict-alert .btn { width:100%; }
}


/* Mercado Rio Paraná 1.5.0 — PDV offline-first */
.offline-banner { letter-spacing: .01em; }
.offline-banner strong { font-weight: 900; }
.offline-banner.syncing { background: #7b651f; }
.status-dot.offline { animation: offlinePulse 1.6s ease-in-out infinite; }
@keyframes offlinePulse { 0%,100% { opacity:1; } 50% { opacity:.45; } }

/* Mercado Rio Paraná 1.5.1 — tabela pública de revenda */
.resale-table-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.resale-table-summary{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 20px;margin-bottom:12px}
.resale-table-summary>div:first-child{display:grid;gap:5px;min-width:0}
.resale-table-summary strong{font-size:15px;overflow-wrap:anywhere}
.resale-table-summary small{color:var(--muted,#66756d);line-height:1.45}
.resale-table-kicker{font-size:10px;font-weight:800;letter-spacing:.08em;color:var(--primary,#0b8f5b)}
.resale-table-count{min-width:120px;text-align:center;background:rgba(11,143,91,.08);border:1px solid rgba(11,143,91,.15);border-radius:14px;padding:12px}
.resale-table-count b{display:block;font-size:26px;color:var(--primary,#0b8f5b)}
.resale-table-count span{display:block;font-size:11px;color:var(--muted,#66756d);font-weight:700}
.resale-table-help{margin-bottom:12px;padding:16px 18px}
.resale-table-help p{margin:6px 0 0;color:var(--muted,#66756d);line-height:1.5}
.resale-table-list{display:grid}
.resale-table-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 2px;border-bottom:1px solid var(--border,#e3e9e6)}
.resale-table-row:last-child{border-bottom:0}
.resale-table-row span{display:grid;gap:3px;min-width:0}
.resale-table-row strong{font-size:14px}
.resale-table-row small{font-size:11px;color:var(--muted,#66756d);font-weight:700}
.resale-table-row>b{font-size:16px;color:var(--primary,#0b8f5b);white-space:nowrap}
.resale-manager-search{margin:12px 0}
.resale-table-head,.resale-manager-row{display:grid;grid-template-columns:minmax(260px,1fr) 110px 110px 110px;gap:12px;align-items:center}
.resale-table-head{padding:8px 2px;border-bottom:1px solid var(--line);font-size:10px;font-weight:900;text-transform:uppercase;color:var(--muted)}
.resale-manager-row{width:100%;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--line);padding:12px 2px;color:inherit;cursor:pointer}
.resale-manager-row:hover,.resale-manager-row:focus{background:#eef8f3;outline:2px solid transparent}
.resale-manager-row>span:nth-child(2),.resale-manager-row>b,.resale-manager-row>em{text-align:right;font-style:normal}
.operation-busy{cursor:progress}
@media(max-width:700px){.resale-table-head{display:none}.resale-manager-row{grid-template-columns:minmax(0,1fr) auto auto}.resale-manager-row>span:nth-child(2){display:none}.resale-manager-row>em{grid-column:2 / 4;font-size:11px}.reseller-report-stats{grid-template-columns:1fr 1fr!important}}
.resale-table-more{text-align:center;padding:14px 0 2px}
@media(max-width:760px){.resale-table-actions{width:100%;justify-content:stretch}.resale-table-actions .btn{flex:1 1 100%}.resale-table-summary{align-items:flex-start;flex-direction:column}.resale-table-count{width:100%;display:flex;align-items:center;justify-content:center;gap:7px}.resale-table-count b,.resale-table-count span{display:inline}}


/* Mercado Rio Paraná 1.5.2 — proteção contra estado vazio/stale no offline-first */

/* Mercado Rio Paraná 1.5.3 — ajustes operacionais consolidados */
/* O banner offline ocupa somente a altura do texto e nunca recebe a linha flexível do PDV. */
.app-shell:has(> .offline-banner) { grid-template-rows: auto auto minmax(0, 1fr); }
.app-shell:has(> .environment-banner):has(> .offline-banner) { grid-template-rows: auto auto auto minmax(0, 1fr); }
.offline-banner {
  min-height: 0 !important;
  padding: 3px 10px !important;
  line-height: 1.2 !important;
  font-size: 10.5px !important;
}
@media (min-width: 761px) {
  .app-shell:has(.view-pdv):has(> .offline-banner) { grid-template-rows: auto auto minmax(0, 1fr); }
  .app-shell:has(.view-pdv):has(> .environment-banner):has(> .offline-banner) { grid-template-rows: auto auto auto minmax(0, 1fr); }
}

.purchase-installment-schedule {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfc;
}
.purchase-installment-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.purchase-installment-title small { color: var(--muted); font-size: 10.5px; }
.purchase-installment-row {
  display: grid;
  grid-template-columns: 34px minmax(150px, .8fr) minmax(140px, .7fr);
  gap: 9px;
  align-items: end;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}
.purchase-installment-row > b { align-self: center; text-align: center; color: var(--gold-dark); }
.purchase-installment-row .field { margin: 0; }
@media (max-width: 760px) {
  .purchase-installment-title { align-items: flex-start; flex-direction: column; gap: 3px; }
  .purchase-installment-row { grid-template-columns: 28px minmax(0, 1fr); }
  .purchase-installment-row > .field:last-child { grid-column: 2; }
}

/* ===== 1.5.4: edição financeira, estorno seguro e filtros gerenciais ===== */
.payable-actions{display:flex;gap:7px;justify-content:flex-end;flex-wrap:wrap}.payable-supplier-select{min-width:220px}.cash-report-controls{display:flex;gap:10px;align-items:center;justify-content:flex-end;flex-wrap:wrap}.cash-operator-filter{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;font-weight:700}.cash-operator-filter .select{min-width:210px}.purchase-installment-edit-list{display:grid;gap:10px;margin:14px 0}.purchase-installment-edit-row{display:grid;grid-template-columns:70px 1fr 1fr;gap:10px;align-items:end;border:1px solid var(--line);border-radius:12px;padding:10px;background:#fbfaf6}.purchase-installment-edit-row>strong{align-self:center}.purchase-installment-edit-row label{display:grid;gap:5px}.purchase-installment-edit-row label>span{font-size:11px;color:var(--muted);font-weight:800}.purchase-cancelled-row{opacity:.7;background:#f6f6f4}.cash-close-actions{display:flex;gap:10px;flex-wrap:wrap}.cash-close-actions .btn-primary{margin-left:auto}@media(max-width:760px){.purchase-installment-edit-row{grid-template-columns:1fr}.cash-report-controls{align-items:stretch}.cash-operator-filter{width:100%;display:grid;gap:5px}.cash-operator-filter .select,.payable-supplier-select{width:100%;min-width:0}.cash-close-actions .btn{flex:1 1 100%}.cash-close-actions .btn-primary{margin-left:0}}


/* ===== 1.5.5: Ajuda de compras + último fornecedor no estoque ===== */
.inventory-last-supplier{min-width:150px}.inventory-last-supplier .muted{font-size:10px;margin-top:2px}
.purchase-help-search-card,.purchase-help-summary,.purchase-help-offer{margin-bottom:12px}.purchase-help-search-card{padding:16px}.purchase-help-search-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:10px}.purchase-help-search-head>div{display:grid;gap:3px}.purchase-help-search-head strong{font-size:16px}.purchase-help-search-head small{color:var(--muted);font-size:11px}.purchase-help-kicker{font-size:9px;font-weight:900;letter-spacing:.1em;color:var(--primary)}.purchase-help-searchbar{max-width:none}.purchase-help-results{display:grid;gap:6px;margin-top:9px}.purchase-help-results>button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;text-align:left;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer}.purchase-help-results>button:hover,.purchase-help-results>button:focus{border-color:var(--primary);background:#f2fbf6;outline:0}.purchase-help-results>button span{display:grid;gap:2px;min-width:0}.purchase-help-results>button small{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.purchase-help-results>button>b{color:var(--primary);font-size:15px}.purchase-help-no-match{margin-top:0}.purchase-help-product-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.purchase-help-product-head>div{display:grid;gap:3px}.purchase-help-product-head h2{margin:0;font-size:19px}.purchase-help-product-head small{color:var(--muted)}.purchase-help-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:12px}.purchase-help-facts>div{display:grid;gap:3px;padding:10px 12px;background:#f7faf8;border:1px solid var(--line);border-radius:10px}.purchase-help-facts span{font-size:9px;font-weight:900;text-transform:uppercase;color:var(--muted)}.purchase-help-facts strong{font-size:14px}.purchase-help-facts small{font-size:10px;color:var(--muted)}.purchase-help-presentation{display:flex;align-items:center;gap:10px;margin-top:10px;font-size:11px;font-weight:800;color:var(--muted)}.purchase-help-presentation .select{max-width:330px}.purchase-help-reference{margin-top:10px;padding:8px 10px;border-radius:9px;background:#eef8f2;font-size:12px}.purchase-help-offer-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.purchase-help-verdict,.purchase-help-empty-verdict{margin-top:10px;padding:12px 14px;border-radius:11px}.purchase-help-verdict>div{display:grid;gap:4px}.purchase-help-verdict span{font-size:10px;font-weight:950;letter-spacing:.08em}.purchase-help-verdict strong{font-size:15px}.purchase-help-verdict small{font-size:11px}.purchase-help-verdict.success{background:#e8f7ef;border:1px solid #b7e1c8;color:#145c38}.purchase-help-verdict.danger{background:#fff0ee;border:1px solid #efc0bb;color:#922d25}.purchase-help-verdict.neutral{background:#f5f4ef;border:1px solid #dedbd0;color:#5f5a4a}.purchase-help-empty-verdict{background:#f7f8f7;color:var(--muted);border:1px dashed var(--line);font-size:12px}.purchase-help-voice-status:empty{display:none}.purchase-help-voice-status{margin-top:8px;padding:7px 9px;border-radius:8px;background:#eef8f2;color:#225b42;font-size:11px;font-weight:800}
@media(max-width:760px){.purchase-help-facts{grid-template-columns:1fr}.purchase-help-offer-grid{grid-template-columns:1fr}.purchase-help-product-head{align-items:stretch;flex-direction:column}.purchase-help-product-head .btn{width:100%}.purchase-help-presentation{display:grid}.purchase-help-presentation .select{max-width:none;width:100%}}

/* ===== 1.5.6: Assistente mestre, busca flexível e operação guiada ===== */
.assistant-layout{display:grid;gap:12px}.assistant-chat{padding:16px}.assistant-messages{display:grid;gap:8px;max-height:42vh;overflow:auto;padding:2px 2px 8px;scroll-behavior:auto;overscroll-behavior:contain;overflow-anchor:none;touch-action:pan-y;-webkit-overflow-scrolling:touch}.assistant-message{max-width:min(82%,720px);padding:9px 11px;border-radius:12px;border:1px solid var(--line);background:#f7faf8;display:grid;gap:3px}.assistant-message>span{font-size:9px;font-weight:950;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}.assistant-message>p{margin:0;white-space:pre-wrap;line-height:1.4}.assistant-message-user{justify-self:end;background:#eaf7f0;border-color:#b8dccb}.assistant-message-assistant{justify-self:start}.assistant-candidates{display:grid;gap:6px;margin:7px 0 3px}.assistant-candidates button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;text-align:left;padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer}.assistant-candidates button:hover,.assistant-candidates button:focus{outline:0;border-color:var(--primary);background:#f2fbf6}.assistant-candidates button span{display:grid;gap:2px;min-width:0}.assistant-candidates button small{color:var(--muted);font-size:10px}.assistant-command-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;margin-top:8px}.assistant-commandbar{max-width:none}.assistant-quick-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}.assistant-workflow{padding:14px}.assistant-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0}.assistant-summary-grid>div{display:grid;gap:3px;padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:#f8faf9}.assistant-summary-grid span{font-size:9px;font-weight:900;text-transform:uppercase;color:var(--muted)}.assistant-summary-grid strong{font-size:13px}.assistant-installments,.assistant-inventory-list{display:grid;gap:7px;margin:10px 0}.assistant-installments>div,.assistant-inventory-list>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:#fbfcfb}.assistant-inventory-list>div span{display:grid;gap:2px}.assistant-inventory-list>div small{color:var(--muted)}.assistant-voice-status:empty{display:none}.assistant-voice-status{margin-top:7px;padding:7px 9px;border-radius:8px;background:#eef8f2;color:#225b42;font-size:11px;font-weight:800}.assistant-voice-status[data-status-type="listening"]{background:#fff6d9;color:#6b5412}.assistant-voice-status[data-status-type="error"]{background:#fff0ee;color:#8c2821}.assistant-voice-status[data-status-type="heard"]{background:#eef3ff;color:#2f4f83}
@media(max-width:760px){.assistant-chat,.assistant-workflow{padding:11px}.assistant-messages{max-height:38vh}.assistant-message{max-width:92%;padding:8px 9px}.assistant-command-row{grid-template-columns:1fr}.assistant-command-row>.btn{width:100%}.assistant-summary-grid{grid-template-columns:1fr 1fr}.assistant-quick-actions{display:grid;grid-template-columns:1fr}.assistant-installments>div,.assistant-inventory-list>div{padding:7px 8px}}

/* ===== 1.5.8: Assistente mestre ampliado e manutenção guiada ===== */
.assistant-capabilities{display:flex;flex-wrap:wrap;gap:7px;margin:8px 0;padding:9px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft,#f7faf8)}.assistant-capabilities>strong{width:100%;font-size:11px;color:var(--muted)}.assistant-capabilities button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 9px;font-size:11px;font-weight:700;cursor:pointer}.assistant-change-summary{display:grid;gap:5px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff}.assistant-change-summary strong{font-size:14px}.assistant-change-summary span{color:var(--muted);font-size:12px}

/* 1.5.8 Assistente mestre ampliado */
.assistant-price-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;margin:10px 0}.assistant-product-change .help{margin:8px 0}

/* Mercado Rio Paraná 1.5.16 — Assistente Mestre neural */
.assistant-neural-strip{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;padding:.55rem .7rem;border:1px solid var(--border,#d9dee8);border-radius:.75rem;background:rgba(30,111,255,.05);font-size:.82rem}.assistant-neural-strip b{white-space:nowrap}.assistant-neural-strip span{color:var(--muted,#64748b)}.assistant-neural-strip span[data-status-type="connected"],.assistant-neural-strip span[data-status-type="ready"]{color:#087443}.assistant-neural-strip span[data-status-type="error"]{color:#b42318}.assistant-neural-strip span[data-status-type="listening"]{color:#b54708}.assistant-neural-strip span[data-status-type="thinking"],.assistant-neural-strip span[data-status-type="connecting"]{color:#175cd3}

/* 1.5.16 — busca inteligente, alertas acionáveis e atualização entre dispositivos */
.replenishment-action-row{width:100%;border:0;background:transparent;text-align:left;color:inherit;cursor:pointer;font:inherit}
.replenishment-action-row:hover{background:color-mix(in srgb,var(--primary) 7%,transparent)}


/* O botão de oferta pertence ao card, não a um modal.
   Deve rolar normalmente junto com a oferta. */
.opportunities-offer-actions{
  position:static!important;
  inset:auto!important;
  z-index:auto!important;
  margin-top:14px;
  padding:0;
  background:transparent;
  border:0;
}

.opportunities-offer-actions .btn{
  width:100%;
}


/* === INVENTARIO FISICO MOBILE-FIRST === */

/* Produto atual: informação grande para leitura caminhando pelo mercado. */
.stocktake-product-card {
  margin-top: 14px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.stocktake-product-card h2 {
  margin: 0 0 9px;
  font-size: 24px;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.stocktake-product-card .muted {
  font-size: 14px;
  line-height: 1.45;
}

/* Quantidade é o principal campo operacional. */
#stocktake-count {
  width: 100%;
  min-height: 66px;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  text-align: center;
  touch-action: manipulation;
}

#stocktake-product-section {
  width: 100%;
  min-height: 56px;
  font-size: 16px;
}

/* Setores devem funcionar como grandes alvos de toque. */
button.dashboard-table-row[data-action="stocktake-select-section"] {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

button.dashboard-table-row[data-action="stocktake-select-section"] strong {
  font-size: 14px;
}

button.dashboard-table-row[data-action="stocktake-select-section"] small {
  margin-top: 3px;
  font-size: 11px;
}

/* Todos os controles principais do inventário ganham área de toque maior. */
button[data-action="stocktake-start"],
button[data-action="stocktake-pause"],
button[data-action="stocktake-resume"],
button[data-action="stocktake-select-section"],
button[data-action="stocktake-not-found"],
button[data-action="stocktake-confirm-count"] {
  min-height: 52px;
  touch-action: manipulation;
}

/*
 * Durante a contagem, as ações ficam acessíveis na parte inferior
 * sem exigir voltar ao começo da página.
 */
.stocktake-count-actions {
  position: sticky;
  z-index: 20;
  bottom: 0;
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px -2px 0;
  padding: 10px 2px calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.97);
}

.stocktake-count-actions .btn {
  min-height: 54px;
}

.stocktake-count-actions .stocktake-confirm {
  flex: 1 1 220px;
  font-size: 15px;
  font-weight: 800;
}

/* iPad portrait / landscape e tablets equivalentes. */
@media (min-width: 761px) and (max-width: 1180px) {
  .stocktake-product-card {
    padding: 20px;
  }

  .stocktake-product-card h2 {
    font-size: 27px;
  }

  .stocktake-product-card + .form-grid {
    grid-template-columns: minmax(220px,.8fr) minmax(300px,1.2fr);
    gap: 16px;
    align-items: end;
  }

  #stocktake-count {
    min-height: 70px;
    font-size: 34px;
  }

  #stocktake-product-section {
    min-height: 58px;
  }

  button.dashboard-table-row[data-action="stocktake-select-section"] {
    min-height: 60px;
    padding: 12px 14px;
  }

  .stocktake-count-actions .btn {
    min-height: 58px;
  }
}

/* Celular: operação em uma mão e nenhuma dependência de tabela. */
@media (max-width: 760px) {
  .stocktake-product-card {
    margin-top: 10px;
    padding: 14px;
    border-radius: 13px;
  }

  .stocktake-product-card h2 {
    font-size: 21px;
    line-height: 1.18;
  }

  .stocktake-product-card .muted {
    font-size: 13px;
  }

  .stocktake-product-card + .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  #stocktake-count {
    min-height: 68px;
    font-size: 32px;
  }

  #stocktake-product-section {
    min-height: 56px;
  }

  button.dashboard-table-row[data-action="stocktake-select-section"] {
    min-height: 58px;
    padding: 11px 10px;
  }

  /*
   * Duas ações secundárias em cima e CONFIRMAR ocupando
   * toda a largura embaixo.
   */
  .stocktake-count-actions {
    position: sticky !important;
    bottom: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 8px;
    margin: 14px 0 0 !important;
    padding: 9px 0 calc(9px + var(--safe-bottom)) !important;
  }

  .stocktake-count-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    margin: 0;
    white-space: normal;
    line-height: 1.15;
  }

  .stocktake-count-actions .stocktake-confirm {
    grid-column: 1 / -1;
    min-height: 60px;
    font-size: 16px;
  }
}

/* Telefones mais estreitos. */
@media (max-width: 420px) {
  .stocktake-product-card h2 {
    font-size: 20px;
  }

  #stocktake-count {
    min-height: 66px;
    font-size: 30px;
  }

  .stocktake-count-actions {
    gap: 7px;
  }

  .stocktake-count-actions .btn {
    font-size: 12px;
  }

  .stocktake-count-actions .stocktake-confirm {
    font-size: 15px;
  }
}


/* CUSTOS_OPERACIONAIS_CATEGORIAS_V2 */
.expense-category-control{display:grid;grid-template-columns:minmax(0,1fr) 46px;gap:8px;align-items:start}
.expense-category-native{text-transform:uppercase;font-size:.84rem;letter-spacing:.01em;width:100%;min-width:0}
.expense-category-add{min-width:46px;height:44px;padding:0;font-size:1.35rem;line-height:1}
.expense-category-rename-hint{margin-top:6px;padding:7px 9px;border:1px solid color-mix(in srgb,var(--primary) 35%,var(--line));border-radius:9px;background:color-mix(in srgb,var(--primary) 7%,var(--surface));font-size:.68rem;font-weight:800;letter-spacing:.02em;color:var(--muted);text-transform:uppercase;touch-action:manipulation;-webkit-user-select:none;user-select:none}
.expense-category-rename-hint.is-holding{background:color-mix(in srgb,var(--primary) 16%,var(--surface));box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--primary) 55%,transparent);color:var(--text)}
.operational-cost-card{margin-top:14px}
.operational-cost-stats{grid-template-columns:repeat(5,minmax(0,1fr))}
.operational-period-toolbar{display:grid;grid-template-columns:minmax(150px,220px) minmax(260px,1fr);gap:8px;align-items:center;margin-bottom:8px}
.operational-period-toolbar>.compact-select{text-transform:uppercase;font-size:.82rem}
.operational-month-nav{display:grid;grid-template-columns:42px minmax(160px,260px) 42px;gap:6px;align-items:center}
.operational-month-nav .btn{min-width:42px;height:42px;padding:0;font-size:1.25rem}
.operational-month-input{height:42px;text-transform:uppercase;font-size:.84rem}
.operational-custom-period{display:grid;grid-template-columns:minmax(130px,190px) auto minmax(130px,190px);gap:7px;align-items:center}
.operational-custom-period span{font-size:.76rem;color:var(--muted);text-transform:uppercase}
.operational-cost-filters{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:8px;align-items:center;margin-bottom:12px}
.operational-cost-filters .compact-select{width:100%;min-width:0;text-transform:uppercase;font-size:.82rem}
.operational-cost-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px;margin:0 0 12px}
.operational-cost-summary>div{display:grid;gap:2px;padding:9px 11px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2)}
.operational-cost-summary span{font-size:10px;font-weight:800;color:var(--muted)}
.operational-cost-summary b{font-size:14px}
.operational-cost-summary small{font-size:10px;color:var(--muted)}
.operational-cost-row{display:grid;grid-template-columns:minmax(0,1fr) 135px 145px;gap:12px;align-items:center;padding:10px 4px;border-top:1px solid var(--line)}
.operational-cost-row:first-child{border-top:0}
.operational-cost-main{display:grid;gap:3px;min-width:0}
.operational-cost-main strong{font-size:14px}
.operational-cost-main span{font-size:11px;color:var(--muted);text-transform:uppercase}
.operational-cost-status{display:grid;justify-items:start;gap:3px}
.operational-cost-status small{font-size:10px;color:var(--muted)}
.operational-cost-money{display:grid;justify-items:end;gap:2px}
.operational-cost-money strong{font-size:15px}
.operational-cost-money span{font-size:10px;color:var(--muted)}
@media(max-width:900px){
  .operational-cost-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .operational-cost-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .operational-cost-row{grid-template-columns:minmax(0,1fr) auto}
  .operational-cost-status{grid-column:1}
  .operational-cost-money{grid-column:2;grid-row:1/3}
}
@media(max-width:560px){
  .expense-category-control{grid-template-columns:minmax(0,1fr) 44px}
  .expense-category-select{font-size:.8rem}
  .operational-cost-filters{grid-template-columns:1fr}
  .operational-cost-stats{grid-template-columns:1fr 1fr}
}

@media (max-width:760px){
  .operational-period-toolbar{grid-template-columns:1fr}
  .operational-month-nav{grid-template-columns:40px minmax(0,1fr) 40px}
  .operational-custom-period{grid-template-columns:1fr}
  .operational-custom-period span{display:none}
}

/* Contas a pagar — edição financeira auditável */
.payable-edit-pencil{min-width:38px;font-size:1.05rem;line-height:1}
.payable-edit-safety{display:flex;flex-direction:column;gap:4px;margin-top:14px;padding:11px 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft,#f7f8f7)}
.payable-edit-safety strong{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em}
.payable-edit-safety span{font-size:.8rem;color:var(--muted)}
.payable-edit-actions{flex-wrap:wrap}
form[data-form="payable-edit"] .span-2,form[data-form="expense-edit"] .span-2{grid-column:1/-1}
@media (max-width:760px){.payable-edit-actions .btn{flex:1 1 46%}.payable-edit-pencil{min-width:42px;min-height:38px}}
.payable-recurrence-box{display:flex;flex-direction:column;gap:7px;margin-top:14px;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft,#f7f8f7)}
.payable-recurrence-box>strong{font-size:.82rem;text-transform:uppercase;letter-spacing:.035em}
.payable-recurrence-box>span{font-size:.82rem;color:var(--muted);line-height:1.35}
.payable-recurrence-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
@media (max-width:760px){.payable-recurrence-actions .btn{flex:1 1 100%}}
/* 1.5.31 — busca e filtros de Contas a pagar */
.payable-search-line{display:flex;align-items:center;gap:10px;margin-bottom:10px}.payable-searchbar{flex:1 1 420px;max-width:760px}.payable-searchbar .input{width:100%}.payables-filters #payable-category-filter{min-width:190px}.payables-filters #payable-type-filter{min-width:175px}
@media(max-width:760px){.payable-search-line,.payable-searchbar{width:100%;max-width:none}.payables-filters #payable-category-filter,.payables-filters #payable-type-filter{width:100%;min-width:0}.payables-filters .payable-supplier-select{width:100%}}
