:root { --ink: #16130e; --paper: #faf8f3; --card: #fff; --line: #e6dcc8; --muted: #7b7262; --gold: #c7a45a; --gold-deep: #89672f; --night: #0b0b0a; --ok: #2f6b45; --warn: #9a6a12; --bad: #a42c35; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 'DM Sans', 'Segoe UI Symbol', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.wrap { width: min(1240px, 92%); margin: 0 auto; padding: 28px 0 80px; }
.muted { color: var(--muted); }
h1 { font-size: 34px; letter-spacing: -1.2px; font-weight: 500; margin: 0; }
h1 em, h2 em { font-family: 'Italiana', Georgia, serif; font-style: normal; color: var(--gold-deep); }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 14px; }

.top { background: var(--night); color: #fff; border-bottom: 1px solid #c7a45a55; position: sticky; top: 0; z-index: 10; }
.top-inner { width: min(1240px, 92%); margin: 0 auto; display: flex; align-items: center; gap: 32px; height: 72px; }
.brand img { width: 190px; height: auto; display: block; }
.top-inner > nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top-inner > nav a { text-decoration: none; padding: 9px 14px; border-radius: 30px; color: #d9d2c4; font-size: 13px; }
.top-inner > nav a:hover { color: #fff; background: #ffffff12; }
.top-inner > nav a[aria-current=page] { color: #17130c; background: linear-gradient(135deg, #e7cd94, #c7a45a); font-weight: 600; }

.head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { margin: 6px 0 0; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 120px; }
.stat b { display: block; font-size: 22px; font-weight: 600; }
.stat span { font-size: 11px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; border-radius: 30px; padding: 10px 18px; cursor: pointer; font-weight: 500; text-decoration: none; min-height: 40px; }
.btn:hover { background: #3a3226; }
.btn.gold { background: linear-gradient(135deg, #ecd39f, #c7a45a); border-color: #b99550; color: #17130c; }
.btn.gold:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold-deep); }
.btn.danger { background: transparent; color: var(--bad); border-color: #e3b9bd; }
.btn.small { padding: 6px 12px; min-height: 32px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 18px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
label, .field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; align-content: start; }
input, select, textarea { border: 1px solid #d9cdb3; border-radius: 8px; background: #fff; padding: 10px 12px; min-height: 42px; font-weight: 400; }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6 8 10.5 12.5 6' fill='none' stroke='%239b7a3d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 14px no-repeat; cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; min-height: 42px; cursor: pointer; }
.check input { min-height: 0; width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--gold-deep); cursor: pointer; }
.order-code { color: var(--gold-deep); letter-spacing: 1px; }
.panel dl + h2 { margin-top: 22px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .span2 { grid-column: span 2; }
.hint { font-weight: 400; color: var(--muted); font-size: 11px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { border: 1px solid var(--line); background: #fff; border-radius: 30px; padding: 8px 14px; cursor: pointer; font-size: 12px; }
.pills button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #efe7d8; vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); background: #fbf8f1; font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fcf7ec; }
.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #f2ece0; display: block; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #0003; vertical-align: -2px; margin-right: 6px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #f1ebe0; color: #5f5440; white-space: nowrap; }
.badge.available, .badge.paid, .badge.fulfilled { background: #e3efe6; color: var(--ok); }
.badge.reserved, .badge.pending { background: #f7ecd6; color: var(--warn); }
.badge.sold { background: #e9e4f2; color: #4f3f7a; }
.badge.hidden, .badge.expired, .badge.cancelled { background: #eeeeee; color: #666; }
.badge.paid_conflict, .badge.refunded { background: #f6e1e3; color: var(--bad); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed #d8c8a4; border-radius: 14px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photo { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f6f1e7; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo .photo-actions { display: flex; justify-content: space-between; padding: 6px; gap: 4px; }
.photo:first-child { outline: 2px solid var(--gold); }
.drop { border: 1px dashed #c9b383; border-radius: 12px; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); cursor: pointer; aspect-ratio: 1; }
.drop:hover { background: #fdf8ee; }

.models { display: grid; gap: 16px; }
.model-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.color { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fffdf9; }
.color img { width: 42px; height: 42px; object-fit: contain; border-radius: 6px; background: #fff; }
.color .big-swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #0002; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-top: 14px; }
.inline-form input[type=color] { padding: 4px; width: 56px; }

.detail { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.timeline li { border-left: 2px solid var(--gold); padding-left: 10px; font-size: 13px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--night); color: #fff; padding: 12px 20px; border-radius: 30px; border: 1px solid #c7a45a77; box-shadow: 0 12px 30px #0005; z-index: 50; max-width: 90vw; }
.toast.error { background: #5b1820; }

@media (max-width: 860px) {
  .top-inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 12px; }
  .top-inner > nav { order: 3; flex-basis: 100%; }
  .form-grid, .detail { grid-template-columns: 1fr; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: 0; padding: 4px 14px; }
}
.storage { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; display: grid; gap: 8px; }
.storage > div:first-child { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.storage span { color: var(--muted); }
.storage p { margin: 0; font-size: 12px; color: var(--muted); }
.meter { height: 8px; border-radius: 8px; background: #efe7d8; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c7a45a, #89672f); }
.storage.warn { border-color: #e3b9bd; }
.storage.warn .meter span { background: linear-gradient(90deg, #d08a52, var(--bad)); }
.storage.warn p { color: var(--bad); }

/* Sessão: login, equipe e troca de senha */
.stack { display: grid; gap: 16px; max-width: 520px; }
.stack .actions { margin-top: 2px; }
tbody tr.static { cursor: default; }
tbody tr.static:hover { background: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.secret { border-color: var(--gold); background: linear-gradient(135deg, #fffaf0, #fff); }
.secret p { margin: 0 0 12px; color: var(--muted); }
.secret-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.secret code { font: 600 18px/1 ui-monospace, Consolas, monospace; letter-spacing: 1px; background: var(--night); color: #f0d9a4; padding: 12px 16px; border-radius: 10px; user-select: all; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 80% at 50% 0%, #2a2214 0%, var(--night) 60%); }
.login-card { width: min(420px, 100%); background: linear-gradient(180deg, #15120c, #0b0b0a); color: #f3ece0; border: 1px solid #c7a45a77; border-radius: 22px; padding: 34px 30px 26px; box-shadow: 0 30px 80px #000a, inset 0 0 0 6px #0b0b0a, inset 0 0 0 7px #c7a45a33; text-align: center; }
.login-brand { width: 230px; max-width: 80%; height: auto; display: block; margin: 0 auto 18px; }
.login-card h1 { font-size: 30px; }
.login-card h1 em { color: var(--gold); }
.login-card .muted { color: #b9ad97; }
.login-card > .muted { margin: 8px 0 22px; }
.login-card form { display: grid; gap: 14px; text-align: left; }
.login-card label { color: #e7dcc6; }
.login-card input { background: #fffdf8; color: var(--ink); }
.login-card input:focus { outline-color: var(--gold); }
.login-card .btn { justify-content: center; width: 100%; min-height: 46px; margin-top: 4px; }
.form-error { margin: 0; color: var(--bad); background: #f6e1e3; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.login-help { font-size: 12px; margin: 18px 0 0; }
@media (max-width: 860px) {
  .user-menu { order: 2; margin-left: auto; }
  .row-actions { justify-content: flex-start; }
}

/* Cadastro por toque: cores e capacidades de marcar; modelos recolhidos */
.color-pill { display: inline-flex; align-items: center; gap: 2px; }
.color-pill .swatch { width: 16px; height: 16px; }
.pills .hint a { color: var(--gold-deep); }
.checks { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.checks .check { min-height: 32px; }
.help ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--muted); }
.help li strong { color: var(--ink); }
details.model { padding: 0; margin-bottom: 10px; }
details.model > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 22px; }
details.model > summary::-webkit-details-marker { display: none; }
details.model > summary::before { content: "›"; color: var(--gold-deep); font-size: 20px; line-height: 1; transition: transform .2s; margin-right: -4px; }
details.model[open] > summary::before { transform: rotate(90deg); }
details.model > summary > span:first-of-type { flex: 1; }
details.model[open] > summary { border-bottom: 1px solid var(--line); }
details.model > :not(summary) { margin-left: 22px; margin-right: 22px; }
details.model > form:first-of-type { margin-top: 18px; }
details.model > :last-child { margin-bottom: 22px; }
details.model h3 { font-size: 14px; margin-top: 22px; margin-bottom: 0; }
details.new-model { border-style: dashed; border-color: #c9b383; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.models { gap: 0; }
@media (max-width: 860px) { .form-grid .span2 { grid-column: auto; } }

/* Preço editável na lista e tabela de preços */
.filters .grow { flex: 1; min-width: 220px; }
.price-cell { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.price-input { width: 104px; min-height: 34px; padding: 6px 8px; text-align: right; font-weight: 600; color: var(--ink); }
.price-input:not(:focus) { border-color: transparent; background: transparent; }
tr:hover .price-input:not(:focus) { border-color: #d9cdb3; background: #fff; }
.price-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.price-form .price-input { border-color: #d9cdb3; background: #fff; }
.price-table { border: 0; }
.price-table td, .price-table th { padding-left: 0; }

/* Cartão do modo do site (demonstração x loja real) */
.store-card { display: flex; justify-content: space-between; align-items: center; gap: 22px; flex-wrap: wrap; border-color: #e6cf9f; background: linear-gradient(135deg, #fffaf0, #fff 60%); }
.store-card.live { border-color: #b9d7c2; background: linear-gradient(135deg, #f1f8f3, #fff 60%); }
.store-card > div:first-child { flex: 1; min-width: 280px; }
.store-card h2 { margin: 10px 0 6px; }
.store-card p { margin: 0 0 4px; max-width: 760px; }
.store-card .small { font-size: 12px; }
.store-card .actions { margin-top: 0; }

/* Cadastro do aparelho: prévia com a foto da cor, bateria e referência de preço */
.unit-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 8px 28px; align-items: start; }
.unit-form > .actions { grid-column: 1 / -1; }
.unit-preview { position: sticky; top: 92px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; justify-items: center; text-align: center; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(ellipse at 50% 30%, #fffaf0, #fff 70%); }
.unit-preview > .hint { justify-self: start; }
.preview-photo { width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.preview-photo img { width: 100%; height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 14px 16px #0000002a); }
.preview-photo .big-swatch { width: 120px; height: 120px; border-radius: 50%; border: 1px solid #0002; }
.unit-preview strong { font-size: 17px; }
.unit-preview #preview-meta { font-size: 12px; }
.unit-preview b { font-size: 20px; color: var(--gold-deep); min-height: 26px; }
.battery-row { display: flex; gap: 12px; align-items: center; }
.battery-row input[type=number] { width: 110px; }
.battery-row .check { min-height: 42px; font-weight: 500; }
.battery-new { margin: 0; min-height: 42px; display: flex; align-items: center; gap: 10px; }
.battery-new b { font-size: 18px; }
.price-hint { border: 1px dashed #d8c39a; border-radius: 12px; padding: 12px 14px; background: #fffcf6; font-size: 13px; font-weight: 400; }
.price-hint:empty { display: none; }
.price-hint-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.price-hint-head .suggested { margin-left: auto; color: var(--muted); }
.price-hint-head .suggested b { color: var(--ink); font-size: 16px; }
.price-hint p { margin: 6px 0 0; }
.price-hint ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.price-hint .market a { color: var(--gold-deep); font-weight: 600; }
@media (max-width: 860px) {
  .unit-form { grid-template-columns: 1fr; }
  .unit-preview { position: static; order: -1; grid-template-columns: 96px 1fr; justify-items: start; text-align: left; }
  .unit-preview > .hint { grid-column: 1 / -1; }
  .preview-photo { grid-row: span 3; }
}

/* Pesquisa de mercado pela extensão do Chrome */
.price-hint .market-status { color: var(--gold-deep); font-weight: 600; }
.price-hint .market .btn { margin-right: 8px; }
.price-hint .install { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.price-hint .install p { margin: 0; }
.price-hint .install ol { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.price-hint .install a { color: var(--gold-deep); font-weight: 600; }
.price-hint .market { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.price-hint code { background: #f1ebe0; padding: 1px 5px; border-radius: 4px; }

/* Extensão de preço: aviso no Estoque, botão no cadastro e página de instalação */
.extension-tip { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; border-color: #e6cf9f; }
.extension-tip > div:first-child { flex: 1; min-width: 260px; }
.extension-tip p { margin: 4px 0 0; }
.extension-tip .actions { margin-top: 0; }
.extension-status p { margin: 10px 0 0; }
.extension-status.ok { border-color: #b9d7c2; background: #f4faf6; }
ol.steps { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.price-hint .download-extension { margin-left: auto; }
@media (max-width: 860px) { .extension-tip, .price-hint .download-extension { display: none; } }

/* Listas suspensas no design system (o mesmo combobox do site); o <select> real fica escondido por baixo */
.dd { position: relative; }
.dd .dd-native { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.dd-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid #d9cdb3; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 500; text-align: left; cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease; }
.dd-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-button:hover { border-color: #b99a60; }
.dd-button:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.dd.open .dd-button { border-color: #b08c48; box-shadow: 0 0 0 3px #c7a45a38; }
.dd-button:disabled { background: #f6f2ea; color: var(--muted); cursor: not-allowed; }
.dd-button svg { flex: none; width: 14px; height: 14px; fill: none; stroke: #9b7a3d; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s ease; }
.dd.open .dd-button svg { transform: rotate(180deg); }
.dd-list { position: fixed; z-index: 60; max-height: 320px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; border: 1px solid #dcc79c; border-radius: 10px; background: #fffdf9 linear-gradient(90deg, transparent, #c7a45a, transparent) no-repeat 18px 0 / calc(100% - 36px) 2px; box-shadow: 0 22px 44px #2a1f0a29, 0 2px 8px #2a1f0a14; animation: dd-in .18s ease; }
.dd-list[hidden] { display: none; }
.dd-list li { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 38px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: #3d3428; white-space: nowrap; cursor: pointer; }
.dd-list li.active { background: #f5eddc; color: #1e1912; }
.dd-list li[aria-selected=true] { color: #7a5a24; font-weight: 600; }
.dd-list li[aria-selected=true]::after { content: ''; flex: none; width: 10px; height: 5px; border-left: 2px solid #b08c48; border-bottom: 2px solid #b08c48; transform: rotate(-45deg) translate(1px, -2px); }
.dd-list li[aria-disabled=true] { opacity: .45; cursor: not-allowed; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.filters .dd-button { min-width: 170px; }
td .dd-button { min-width: 150px; min-height: 36px; }
@media (prefers-reduced-motion: reduce) { .dd-list { animation: none; } .dd-button svg { transition: none; } }

/* Pagamento online: situação da integração (Pedidos) */
.payments-card.ok { border-color: #b9d7c2; }
.payments-head h2 { margin: 10px 0 4px; }
.checklist { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.checklist li > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #d8cbb0; color: #a08a5c; font-size: 12px; }
.checklist li.ok > span { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist p { margin: 2px 0 0; }
.copy-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.copy-line code { background: #f6f1e6; border: 1px solid #e6dcc6; border-radius: 8px; padding: 8px 10px; font-size: 12px; word-break: break-all; flex: 1; min-width: 220px; }
.panel.warn { border-color: #e6b9be; background: #fbf1f2; color: var(--bad); }
.small { font-size: 12px; }

/* ---------- Sistema de vendas e financeiro ---------- */
[hidden] { display: none !important; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num { text-align: right; }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
.dim { opacity: .55; }
.grow { flex: 1; min-width: 0; }
.clip { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-gap { margin-top: 16px; }
fieldset { min-width: 0; }
.panel h3 { font-size: 14px; font-weight: 600; margin: 20px 0 8px; }
.panel h3 em { font-family: 'Italiana', Georgia, serif; font-style: normal; color: var(--gold-deep); }
.panel.note { border-color: #e6cf9f; background: #fffaf0; color: #5f4a22; }
.badge.concluida, .badge.paga { background: #e3efe6; color: var(--ok); }
.badge.aberta { background: #f7ecd6; color: var(--warn); }
.badge.vencida { background: #f6e1e3; color: var(--bad); }
.badge.cancelada { background: #eeeeee; color: #666; }

/* Cabeçalho: Vender em destaque e menu da pessoa */
.top-inner { gap: 24px; }
.top-inner > nav::-webkit-scrollbar { display: none; }
.top-inner > nav a { white-space: nowrap; }
.top-inner > nav a.nav-sell { color: #f0d9a4; box-shadow: inset 0 0 0 1px #c7a45a77; }
.top-inner > nav a.nav-sell:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--gold); }
.top-inner > nav a.nav-sell[aria-current=page] { color: #17130c; box-shadow: none; }
.user-menu { position: relative; flex: none; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 8px; max-width: 240px; padding: 8px 14px; border: 1px solid #ffffff2b; border-radius: 30px; color: #d9d2c4; font-size: 12px; cursor: pointer; white-space: nowrap; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary span { overflow: hidden; text-overflow: ellipsis; }
.user-menu > summary:hover, .user-menu[open] > summary { color: #fff; border-color: var(--gold); }
.user-menu > summary svg { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.user-menu[open] > summary svg { transform: rotate(180deg); }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; display: grid; min-width: 240px; padding: 6px; border: 1px solid #dcc79c; border-radius: 12px; background: #fffdf9 linear-gradient(90deg, transparent, #c7a45a, transparent) no-repeat 18px 0 / calc(100% - 36px) 2px; box-shadow: 0 22px 44px #0006; animation: dd-in .18s ease; }
.user-menu .menu a, .user-menu .menu button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: #3d3428; font-size: 13px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: #f5eddc; color: #1e1912; }
.user-menu .menu a[aria-current=page] { color: #7a5a24; font-weight: 600; }
.user-menu .menu button { margin-top: 4px; border-top: 1px solid #efe7d8; border-radius: 0 0 8px 8px; color: var(--bad); }
@media (max-width: 1180px) {
  .brand img { width: 150px; }
  .top-inner > nav a { padding: 8px 11px; }
}

/* Números do painel: cartões, mini-indicadores, saldos e alertas */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.kpi:first-child { border-color: #e6cf9f; background: linear-gradient(135deg, #fffaf0, #fff 70%); }
.kpi > span { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.kpi > b { font-size: 24px; font-weight: 600; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi > small { font-size: 12px; color: var(--muted); }
.delta { font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.panel-head a { color: var(--gold-deep); font-weight: 600; }
.panel-head .pills, .panel-head .inline { margin: 0; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; margin-bottom: 18px; }
.dash-grid > .panel { margin-bottom: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mini-stats > div { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #efe7d8; border-radius: 10px; background: #fbf8f1; }
.mini-stats span { font-size: 11px; color: var(--muted); }
.mini-stats b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.balances { list-style: none; margin: 0; padding: 0; }
.balances li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid #efe7d8; }
.balances li:last-child { border-bottom: 0; }
.balances b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.balances a { color: var(--gold-deep); }
.alerts { border-color: #e6cf9f; background: linear-gradient(135deg, #fffaf0, #fff 60%); }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid #efe7d8; border-radius: 10px; background: #fff; }
.alert-list .grow { min-width: 200px; }

/* Tabelas dentro de painéis, abas e período */
table.inner { border: 0; border-radius: 0; background: transparent; }
table.inner th { background: transparent; }
table.inner th, table.inner td { padding: 9px 10px; }
table.inner th:first-child, table.inner td:first-child { padding-left: 0; }
table.inner th:last-child, table.inner td:last-child { padding-right: 0; }
table.inner tbody tr:last-child td { border-bottom: 0; }
table.inner a { color: var(--gold-deep); }
.dre tr.sum td { border-top: 1px solid #d8cbb0; font-weight: 600; background: #fbf8f1; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 12px; border-bottom: 1px solid var(--line); }
.tabs a { margin-bottom: -1px; padding: 8px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--gold); font-weight: 600; }
.period { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.chip { min-height: 34px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 30px; background: #fff; font-size: 12px; cursor: pointer; }
.chip:hover { border-color: var(--gold-deep); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.period-dates { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; color: var(--muted); font-size: 12px; }
.period-dates input { min-height: 34px; padding: 5px 8px; }
.export { gap: 6px; }
.share { display: inline-block; width: 90px; height: 8px; margin-right: 6px; border-radius: 8px; background: #efe7d8; overflow: hidden; vertical-align: middle; }
.share > span { display: block; width: 0; height: 100%; border-radius: 8px; background: #a8761a; }

/* Extrato: contas lado a lado */
.accounts { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.account { flex: 0 0 auto; display: grid; gap: 2px; min-width: 160px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; cursor: pointer; }
.account span { font-size: 12px; color: var(--muted); }
.account b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.account:hover { border-color: var(--gold-deep); }
.account.on { border-color: var(--gold); background: #fffaf0; box-shadow: 0 0 0 2px #c7a45a55; }
.account.total { background: var(--night); border-color: var(--night); color: #fff; cursor: default; }
.account.total span { color: #b9ad97; }

/* Gráfico de colunas (uma série, dourado) */
.chart { position: relative; }
.chart-plot { width: 100%; }
.chart-plot svg { display: block; max-width: 100%; overflow: visible; }
.chart-plot svg:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 4px; border-radius: 6px; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart line.grid { stroke: #efe7d8; stroke-width: 1; }
.chart line.base { stroke: #cbbd9f; stroke-width: 1; }
.chart .bar { fill: #a8761a; transition: opacity .15s ease; }
.chart svg.hovering .bar:not(.on) { opacity: .35; }
.chart-tip { position: absolute; z-index: 5; display: grid; gap: 2px; padding: 8px 10px; border: 1px solid #c7a45a77; border-radius: 10px; background: var(--night); color: #e7dcc6; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: 0 10px 24px #0004; }
.chart-tip b { color: #f0d9a4; }
.chart-table { margin-top: 10px; }
.chart-table summary { color: var(--gold-deep); font-size: 12px; font-weight: 600; cursor: pointer; }
.chart-table table { margin-top: 8px; }

/* Janelas (dialog) */
dialog.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid #dcc79c; border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px #0006; }
dialog.modal.wide { width: min(860px, calc(100vw - 32px)); }
dialog.modal[open] { animation: modal-in .2s ease; }
dialog.modal::backdrop { background: #0b0b0acc; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; }
.modal-body .stack { max-width: none; }
.done { display: grid; justify-items: center; gap: 8px; text-align: center; }
.done p { margin: 0; }
.done-check { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #ecd39f, #c7a45a); color: #17130c; font-size: 26px; font-weight: 700; }
.done-total { font-size: 32px; font-weight: 600; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.done-change { font-size: 16px; }
.done .actions { justify-content: center; }
@media (prefers-reduced-motion: reduce) { dialog.modal[open], .user-menu .menu { animation: none; } }

/* Campos: dinheiro, porcentagem/dias, busca de contato, aparelho */
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack.wide-stack { max-width: none; }
.stack.narrow { max-width: 440px; }
label.inline { display: flex; align-items: center; gap: 8px; }
label.inline .dd { min-width: 170px; }
.money-field, .unit-field { display: flex; align-items: center; min-height: 42px; border: 1px solid #d9cdb3; border-radius: 8px; background: #fff; overflow: hidden; font-weight: 400; }
.money-field > span, .unit-field > span { flex: none; padding: 0 10px; color: var(--muted); font-size: 12px; font-weight: 500; }
.money-field > span { padding-right: 0; }
.unit-field > span { padding-left: 0; }
.money-field input, .unit-field input { flex: 1; width: 100%; min-width: 0; min-height: 40px; border: 0; background: transparent; }
.unit-field input { text-align: right; }
.money-field input:focus, .unit-field input:focus { outline: none; }
.money-field:focus-within, .unit-field:focus-within { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.money-field:has(input:disabled), .unit-field:has(input:disabled) { background: #f6f2ea; color: var(--muted); }
.device-fields, .device-dependent { display: contents; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 42px; padding: 8px 12px; border: 1px solid #d9cdb3; border-radius: 8px; background: #fffcf6; font-weight: 400; }
.results { list-style: none; margin: 4px 0 0; padding: 6px; max-height: 320px; overflow-y: auto; border: 1px solid #dcc79c; border-radius: 10px; background: #fffdf9; box-shadow: 0 18px 36px #2a1f0a22; font-weight: 400; }
.results li button { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; }
.results li button:hover, .results li button:focus-visible { background: #f5eddc; }
.results .none { padding: 10px; }
.bill-head { margin: 0; padding: 12px 14px; border: 1px solid #efe7d8; border-radius: 10px; background: #fbf8f1; }
.margin-line { display: flex; align-items: center; gap: 6px; min-height: 42px; margin: 0; font-size: 14px; font-weight: 400; }
fieldset.choice { margin: 0; padding: 6px 14px 8px; border: 1px solid var(--line); border-radius: 12px; }
fieldset.choice legend, .denoms legend { padding: 0 6px; font-size: 12px; font-weight: 600; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 16px 0 0; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; }
.totals .grand { padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); font-size: 18px; font-weight: 600; }

/* Compra: um bloco por produto */
fieldset.line > legend { padding: 0 8px; color: var(--gold-deep); font-weight: 600; }
.purchase-form > .actions { margin: 0 0 18px; }
.owed { margin-top: 4px; padding: 12px; border: 1px dashed #d8c39a; border-radius: 12px; background: #fffcf6; }

/* Balcão (PDV) */
.pdv { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.pdv-side { position: sticky; top: 92px; }
.pdv-side h2 { margin-top: 18px; }
.pdv-search { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.pdv-search .grow { min-width: 220px; }
#pdv-items { display: grid; gap: 10px; margin-top: 14px; }
.cart-item { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; padding: 12px; border: 1px solid #efe7d8; border-radius: 12px; background: #fffdf9; }
.cart-desc { flex: 1 1 100%; display: grid; gap: 2px; }
.cart-item > label { flex: 1 1 130px; }
.cart-item > .qty { flex: 0 0 76px; }
.cart-item > .icon { margin-left: auto; }
.cart-margin { flex: 1 1 100%; margin: 0; color: var(--muted); font-size: 12px; }
.cart-margin:empty { display: none; }
.btn.icon { justify-content: center; width: 32px; padding: 0; }
.btn.block { justify-content: center; width: 100%; min-height: 48px; font-size: 15px; }
.small-empty { padding: 18px; font-size: 13px; }
.unit-results .price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-methods { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
#pdv-payments { display: grid; gap: 10px; }
.pay-line { padding: 10px 12px; border: 1px solid #efe7d8; border-radius: 12px; background: #fffdf9; }
.pay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; }
.pay-grid > .check, .pay-grid > .btn { grid-column: 1 / -1; justify-self: start; }
.pay-info { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.pay-info:empty { display: none; }
.remaining { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: #f7ecd6; color: var(--warn); font-size: 13px; }
.remaining.bad { background: #f6e1e3; color: var(--bad); }
.remaining.ok { background: #e3efe6; color: var(--ok); }
.pdv-profit { margin: 10px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.pdv-profit:empty { display: none; }
.pix-box { display: grid; justify-items: center; gap: 10px; text-align: center; }
.pix-box p { margin: 0; }
.pix-box .qr { width: 220px; height: 220px; }

/* Caixa: contagem por cédula e moeda */
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: 12px; }
.denom { gap: 4px; }
.denom span { color: var(--muted); font-weight: 500; }
.denom input { min-height: 36px; padding: 6px 8px; text-align: right; }
.close-check { margin: 0; padding: 10px 12px; border: 1px solid #efe7d8; border-radius: 10px; background: #fbf8f1; font-size: 13px; }
.close-check:empty { display: none; }

/* Equipe: comissão */
.commission { display: flex; align-items: center; gap: 6px; }
.commission .unit-field { width: 84px; min-height: 36px; }
.commission .unit-field input { min-height: 34px; padding: 4px 6px; }
td .commission .dd-button { min-width: 112px; }

/* Ajustes: prévia do recibo, Pix e taxas */
.settings-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.settings-split > .panel { margin-bottom: 0; }
.settings-split .stack { max-width: none; }
.receipt-preview { position: sticky; top: 92px; display: grid; justify-items: center; gap: 8px; }
.receipt-preview > p { margin: 0; justify-self: start; }
.paper { max-width: 100%; max-height: 75vh; overflow: auto; border-radius: 4px; background: #fff; box-shadow: 0 1px 0 #0000000f, 0 14px 30px #2a1f0a1f; }
.paper.paper-a4 .receipt { zoom: .45; }
.pix-preview .qr { display: block; width: 200px; height: 200px; margin: 0 auto 10px; }
.pix-preview label { margin-top: 10px; }
.mono { font: 12px/1.4 ui-monospace, Consolas, monospace; word-break: break-all; }
.fees { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.model-group > h2 { margin: 26px 0 10px; }

/* Recibo não fiscal (prévia na tela e impressão térmica 80/58 mm ou A4) */
.receipt { background: #fff; color: #000; font: 500 12px/1.35 'DM Sans', Arial, sans-serif; }
.paper-80 .receipt { width: 80mm; padding: 4mm; }
.paper-58 .receipt { width: 58mm; padding: 3mm 2.5mm; font-size: 10.5px; }
.paper-a4 .receipt { width: 186mm; font-size: 13px; }
.paper-a4 .receipt + .receipt { margin-top: 10mm; padding-top: 10mm; border-top: 1px dashed #000; }
.receipt h1 { margin: 0 0 2px; color: #000; font: 700 1.3em/1.2 'DM Sans', Arial, sans-serif; letter-spacing: 0; text-align: center; }
.receipt p { margin: 0 0 4px; }
.receipt .c { text-align: center; }
.receipt .small { font-size: .88em; }
.receipt .muted { color: #222; }
.receipt .big { font-size: 1.2em; letter-spacing: .5px; }
.receipt .via { margin: 0 0 6px; padding: 1px 0; border: 1px solid #000; font-size: .85em; font-weight: 700; letter-spacing: 2px; text-align: center; }
.receipt .rule { margin: 6px 0; border-top: 1px dashed #000; }
.receipt .sec { margin: 0 0 4px; font-size: .85em; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.receipt .row { display: flex; justify-content: space-between; gap: 8px; }
.receipt .row > span:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt .row.total { margin-top: 3px; padding-top: 3px; border-top: 1px solid #000; font-size: 1.15em; font-weight: 700; }
.receipt .item { margin-bottom: 5px; }
.receipt .item p { margin: 0; }
.receipt .terms { font-size: .85em; text-align: justify; white-space: pre-line; }
.receipt .sign { margin-top: 10px; font-size: .9em; text-align: center; }
.receipt .sign span { display: block; margin: 0 6mm; padding-top: 2px; border-top: 1px solid #000; }
.receipt .cancel { margin: 4px 0; padding: 2px 0; border: 2px solid #000; font-size: 1.2em; font-weight: 700; }
.receipt .qr { display: block; width: 36mm; height: 36mm; margin: 4px auto; }
.paper-58 .receipt .qr { width: 30mm; height: 30mm; }
#print-root { position: fixed; top: 0; left: -10000px; visibility: hidden; pointer-events: none; }
@media print {
  body { background: #fff; }
  body > :not(#print-root) { display: none !important; }
  #print-root { position: static; visibility: visible; }
  #print-root.paper-80 .receipt, #print-root.paper-58 .receipt { break-after: page; }
  #print-root .receipt:last-child { break-after: auto; }
  .receipt { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 1000px) {
  .pdv, .settings-split { grid-template-columns: 1fr; }
  .pdv-side, .receipt-preview { position: static; }
}
@media (max-width: 860px) {
  .dash-grid, .form-grid.two, .pay-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi > b { font-size: 20px; }
  td.num { text-align: left; }
  .clip { max-width: none; white-space: normal; }
  .period-dates { margin-left: 0; }
  .user-menu > summary { max-width: 180px; }
}
