* { box-sizing: border-box; }

:root {
  color-scheme: only dark;
  --bg: #0b1120;
  --card: #111827;
  --card2: #172033;
  --input: #0b1220;
  --border: #263247;
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --blue2: #2563eb;
  --blue-light: #60a5fa;
  --green: #22c55e;
  --green2: #16a34a;
  --yellow: #f59e0b;
  --red: #ef4444;
  --purple: #a78bfa;
  --teal: #2dd4bf;
  --sidebar: 230px;
}

html, body { margin: 0; }

body {
  background: radial-gradient(circle at top right, rgba(37,99,235,.18), transparent 30%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: Inter, system-ui, Arial, Helvetica, sans-serif;
  min-height: 100vh;
}

body.modal-open { overflow: hidden; }

a { color: var(--blue-light); }

h1 { margin: 0 0 6px; font-size: clamp(26px, 4vw, 38px); line-height: 1.1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { margin: 0 0 16px; font-size: 18px; }
h3 { margin: 0 0 8px; font-size: 16px; }

.muted { color: var(--muted); }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar);
  background: rgba(11,18,32,.95);
  border-right: 1px solid var(--border);
  padding: calc(18px + env(safe-area-inset-top)) 14px 18px;
  display: flex; flex-direction: column; gap: 24px;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); padding: 0 6px; }
.brand img { width: 100%; max-width: 190px; height: auto; display: block; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 6px; font-size: 13px; color: var(--muted); }
.sidebar-foot a { color: #cbd5e1; text-decoration: none; font-weight: 600; }
.sidebar-foot .btn { align-self: flex-start; }

/* ---------- Login do colaborador ---------- */
body.logged-out .layout { display: none; }
#login:empty { display: none; }
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.4); text-align: center;
}
.login-card img { width: 130px; margin: 0 auto; }
.login-card h1 { font-size: 22px; justify-content: center; }
.login-card .field { text-align: left; }
.login-card .btn.full { margin-top: 4px; }
.login-card a.help { text-decoration: none; }

/* ---------- Configuração da loja ---------- */
.card h3 { margin: 22px 0 12px; }
.provider { background: var(--input); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-top: 14px; }
.provider-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); cursor: pointer; }
.switch input { width: 18px; height: 18px; }
.test-row { display: flex; gap: 10px; margin-top: 14px; }
.test-row input { max-width: 200px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 22px; letter-spacing: .02em; }
.brand-text em { color: var(--blue); font-style: normal; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: #cbd5e1; text-decoration: none; font-weight: 600; font-size: 15px;
}
.nav a i { font-style: normal; width: 22px; text-align: center; }
.nav a:hover { background: rgba(59,130,246,.08); }
.nav a.active { background: rgba(59,130,246,.16); color: white; box-shadow: inset 3px 0 0 var(--blue); }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }

.container {
  width: min(1180px, 94%);
  margin: 0 auto;
  padding: calc(30px + env(safe-area-inset-top)) 0 60px;
}

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head p { color: var(--muted); margin: 0; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  background: rgba(59,130,246,.12); color: var(--blue-light);
  border: 1px solid rgba(59,130,246,.25);
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; margin-bottom: 10px;
}

/* ---------- Cards e grids ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.full { grid-column: 1 / -1; }

.card {
  background: rgba(17,24,39,.94);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 15px 40px rgba(0,0,0,.18);
  margin-bottom: 20px;
}
.grid > .card { margin-bottom: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card-grid .card { margin: 0; display: flex; flex-direction: column; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; }

/* ---------- Formulários ---------- */
.fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.fields > .field { grid-column: span 3; }
.fields > .field.full-width { grid-column: 1 / -1; }
.fields > .field.third { grid-column: span 2; }
.fields.four > .field { grid-column: span 3; }
@media (min-width: 900px) { .fields.four { grid-template-columns: repeat(4, 1fr); } .fields.four > .field { grid-column: span 1; } }

.field { display: flex; flex-direction: column; gap: 7px; }
.checkbox-field { justify-content: flex-end; }
.checkbox-field label { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.checkbox-field input { width: auto; }

label { color: #cbd5e1; font-size: 13px; font-weight: 700; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--input);
  color: white;
  padding: 12px 14px;
  border-radius: 10px;
  outline: none;
  font: inherit; font-size: 15px;
}
textarea { resize: vertical; }
input[type=file] { padding: 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
input[readonly] { color: var(--blue-light); font-weight: 700; }

.search { margin-bottom: 16px; }
.row-inline { display: flex; gap: 10px; }
.row-inline select { flex: 1; }

.help { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 10px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: white;
  padding: 11px 16px;
  border-radius: 11px;
  font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.primary { background: linear-gradient(135deg, var(--blue), var(--blue2)); border-color: transparent; }
.btn.success { background: linear-gradient(135deg, var(--green), var(--green2)); border-color: transparent; }
.btn.danger { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.4); color: #fca5a5; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.full { width: 100%; margin-top: 18px; }
.danger-text { color: #fca5a5 !important; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; }

/* ---------- Listas ---------- */
.list { padding: 8px 0; }
.list h2 { padding: 12px 22px 0; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(148,163,184,.08);
  color: inherit; text-decoration: none;
}
.list-row:last-child { border-bottom: none; }
a.list-row:hover { background: rgba(59,130,246,.06); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-value { min-width: 100px; text-align: right; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(148,163,184,.12); color: #cbd5e1;
  margin-left: 6px; white-space: nowrap;
}

.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status.blue { background: rgba(59,130,246,.15); color: #93c5fd; }
.status.purple { background: rgba(167,139,250,.15); color: #c4b5fd; }
.status.green { background: rgba(34,197,94,.15); color: #86efac; }
.status.yellow { background: rgba(245,158,11,.15); color: #fcd34d; }
.status.teal { background: rgba(45,212,191,.15); color: #5eead4; }
.status.indigo { background: rgba(129,140,248,.15); color: #a5b4fc; }
.status.red { background: rgba(239,68,68,.15); color: #fca5a5; }
.status.gray { background: rgba(148,163,184,.15); color: #cbd5e1; }
h1 .status { font-size: 14px; }

.empty { text-align: center; color: var(--muted); padding: 30px 16px; grid-column: 1 / -1; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.tab {
  background: transparent; border: 1px solid var(--border); color: #cbd5e1;
  padding: 9px 14px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.tab span { background: rgba(148,163,184,.15); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.tab.active { background: var(--blue); border-color: var(--blue); color: white; }

/* ---------- Painel ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat strong { font-size: 24px; }
.stat small { color: var(--muted); font-size: 12px; }

.pend-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.pend-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; gap: 4px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
  color: inherit; text-decoration: none; transition: .15s;
}
.pend-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.pend-icon {
  grid-row: 1 / 4; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(59,130,246,.12); display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.pend-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pend-card strong { font-size: 30px; line-height: 1; }
.pend-card small { color: var(--muted); font-size: 12px; }
.pend-card.zero strong { color: var(--muted); }
.late { color: #fca5a5; }

.revenue-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.revenue-row div { background: var(--input); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.revenue-row span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.revenue-row strong { font-size: 24px; }
.revenue-row small { color: var(--muted); font-size: 12px; }

.bars { display: flex; gap: 10px; height: 170px; align-items: stretch; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; cursor: default; }
.bar-track {
  flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center;
  border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(to top, transparent 0 33.2%, rgba(148,163,184,.07) 33.2% 33.4%);
}
.bar { width: min(36px, 70%); background: #3b82f6; opacity: .55; border-radius: 4px 4px 0 0; min-height: 0; transition: opacity .15s; }
.bar-col.current .bar { opacity: 1; }
.bar-col small { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.bar-col.current small { color: var(--text); font-weight: 700; }
.bar-col:hover .bar { opacity: 1; }
.bar-tip {
  position: absolute; bottom: calc(100% - 10px); left: 50%; transform: translateX(-50%);
  background: #0b1220; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 2;
  display: flex; flex-direction: column; text-transform: capitalize;
}
.bar-col:hover .bar-tip { opacity: 1; }

.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: r; }
.rank li { counter-increment: r; }
.rank-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.rank-head span::before { content: counter(r) ". "; color: var(--muted); }
.rank-bar { height: 8px; background: rgba(148,163,184,.1); border-radius: 4px; overflow: hidden; }
.rank-bar div { height: 100%; background: #3b82f6; border-radius: 4px; }
.rank small { color: var(--muted); font-size: 12px; }

.cost-table { margin: 0; }
.cost-table td small { font-size: 11px; }
.cost-table tr.sum td { font-weight: 800; border-top: 1px solid var(--border); }
.cost-table tr.profit td { color: #4ade80; font-weight: 800; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-head h2 { margin: 0; }

/* ---------- Impressoras ---------- */
.printer-icon { width: 100%; height: 100%; display: block; }
.printer-card { text-align: center; }
.printer-card-icon { width: 96px; height: 96px; margin: 0 auto 10px; }
.printer-card h3 { margin: 0; }
.printer-card p { margin: 2px 0 12px; font-size: 13px; }
.printer-card .card-actions { justify-content: center; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 0; text-align: left; }
.kv div { background: var(--input); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.kv dt { color: var(--muted); font-size: 11px; }
.kv dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.icon-pick input, .printer-option input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span, .printer-option span {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 12px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--input);
  cursor: pointer; height: 100%;
}
.icon-pick svg { width: 54px; height: 54px; }
.icon-pick small, .printer-option small { color: var(--muted); font-size: 11px; font-weight: 600; }
.icon-pick input:checked + span, .printer-option input:checked + span {
  border-color: var(--blue); background: rgba(59,130,246,.12); box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.printer-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.printer-option svg { width: 64px; height: 64px; }
.printer-option strong { font-size: 14px; }

/* ---------- Calculadora ---------- */
.result-main {
  background: linear-gradient(135deg, rgba(34,197,94,.14), rgba(59,130,246,.10)), var(--card2);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: 16px; padding: 24px; text-align: center; margin-bottom: 18px;
}
.result-main .small { color: #86efac; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sale-price { font-size: clamp(38px, 7vw, 62px); font-weight: 900; margin: 7px 0; }
.profit-label { color: var(--muted); font-size: 13px; }

.cost-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cost-box { background: var(--input); border: 1px solid var(--border); padding: 16px; border-radius: 13px; }
.cost-box span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.cost-box strong { font-size: 20px; }

.report { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 8px; }
.report-row { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid rgba(148,163,184,.08); font-size: 14px; }
.report-row span:first-child { color: var(--muted); }
.report-row.total { font-weight: 800; font-size: 16px; }
.report-row.sale { color: #4ade80; font-size: 18px; font-weight: 900; }

.printer-info {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--input); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-top: 14px;
}
.printer-info span { color: var(--muted); font-size: 12px; }
.printer-info strong { color: var(--blue-light); }

.calc-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  background: rgba(34,197,94,.06); border: 1px solid rgba(34,197,94,.18);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #cbd5e1; margin-top: 12px;
}
.calc-box b { color: #86efac; }

/* ---------- Produtos ---------- */
.product-card { padding: 0; overflow: hidden; }
.product-card > .thumb { width: 100%; height: 170px; border-radius: 0; border: none; border-bottom: 1px solid var(--border); }
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-body h3 { margin: 2px 0; }
.price { font-size: 20px; font-weight: 800; color: #4ade80; }
.product-card.inactive { opacity: .55; }
.features { color: #cbd5e1; font-size: 13px; line-height: 1.5; white-space: pre-line; margin: 8px 0 0; }

/* ---------- Anexos ---------- */
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.thumb {
  position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden;
  background: var(--input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.thumb.big { width: 120px; height: 120px; }
.thumb a { display: block; width: 100%; height: 100%; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph { font-size: 28px; opacity: .6; }
.thumb-file { font-size: 11px; padding: 6px; word-break: break-all; display: flex !important; align-items: center; }
.thumb-x {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.7); color: white; cursor: pointer; font-size: 12px;
}
.photo-row { display: flex; gap: 14px; align-items: center; }
.links { margin: 8px 0; padding-left: 18px; font-size: 13px; word-break: break-all; }

/* ---------- Pedidos ---------- */
.stepper { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 18px; counter-reset: s; }
.stepper li {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer;
}
.stepper li span {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--card2); border: 1px solid var(--border); font-size: 13px;
}
.stepper li.current { color: white; border-color: var(--blue); }
.stepper li.current span { background: var(--blue); border-color: var(--blue); }
.stepper li.done { color: #86efac; }
.stepper li.done span { background: rgba(34,197,94,.2); border-color: rgba(34,197,94,.4); }

.step-nav { display: flex; justify-content: space-between; gap: 10px; }

.info-box {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--input); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin-top: 14px;
}
.info-box small { color: var(--muted); }
.info-box:empty { display: none; }

.item-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.item-card, .price-item {
  background: var(--input); border: 1px solid var(--border); border-radius: 14px; padding: 16px;
}
.item-card + .item-card, .price-item + .price-item { margin-top: 12px; }
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.item-card .kv div { background: var(--card); }

.totals {
  margin-top: 18px; margin-left: auto; max-width: 380px;
  display: flex; flex-direction: column; gap: 2px;
}
.totals div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(148,163,184,.08); font-size: 14px; }
.totals span { color: var(--muted); }
.totals .big { font-size: 20px; font-weight: 900; }
.totals .big b { color: #4ade80; }
.totals .pos b { color: #86efac; }
.totals .neg b { color: #fca5a5; }

.table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 8px; border-bottom: 1px solid rgba(148,163,184,.08); vertical-align: top; }
.table td small { display: block; color: var(--muted); white-space: pre-line; }
.table th:not(:first-child), .table td:not(:first-child) { text-align: right; white-space: nowrap; }

.actions-card { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px; }
.actions-card [data-delete] { margin-left: auto; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid rgba(148,163,184,.08); font-size: 14px; }
.tl-date { color: var(--muted); font-size: 12px; min-width: 110px; }

.pick-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pick-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--input); cursor: pointer;
}
.pick-row input { width: auto; }
.pick-row .thumb { width: 52px; height: 52px; }
.pick-row .thumb a { pointer-events: none; }
.pick-main { flex: 1; display: flex; flex-direction: column; }
.pick-main small { color: var(--muted); font-weight: 500; }
.pick-row .price { font-size: 16px; }
.pick-row:has(input:checked) { border-color: var(--blue); background: rgba(59,130,246,.1); }

/* ---------- Modal e toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(2,6,23,.75); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: calc(30px + env(safe-area-inset-top)) 12px 30px; overflow-y: auto;
}
.modal {
  width: min(520px, 100%);
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.modal.wide { width: min(780px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px; }
.modal-body p { line-height: 1.5; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(90px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: #14532d; border: 1px solid var(--green2); color: white;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: opacity .4s;
}
.toast.error { background: #7f1d1d; border-color: var(--red); }
.toast.hide { opacity: 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .sidebar {
    inset: auto 0 0 0; width: auto; height: auto;
    flex-direction: row; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid var(--border);
  }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; gap: 0; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 10px; flex: 1; text-align: center; }
  .nav a i { font-size: 20px; }
  .nav a.active { box-shadow: inset 0 3px 0 var(--blue); }
  .main { margin-left: 0; padding-bottom: 80px; }

  .grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .pend-grid { grid-template-columns: 1fr 1fr; }
  .cost-grid { grid-template-columns: 1fr 1fr; }
  .stepper li { font-size: 0; justify-content: center; }
  .stepper li span { font-size: 13px; }
  .stepper li.current { font-size: 13px; }
}

@media (max-width: 560px) {
  .fields > .field, .fields > .field.third, .fields.four > .field { grid-column: 1 / -1; }
  .list-row { flex-wrap: wrap; }
  .list-main { flex-basis: 100%; }
  .list-value { margin-left: auto; }
  .row-inline { flex-direction: column; }
  .head-actions, .head-actions .btn { width: 100%; }
  .actions-card .btn { flex: 1 1 100%; }
  .actions-card [data-delete] { margin-left: 0; }
}

/* ---------- Opções de produto / frete grátis ---------- */
.option-box { background: var(--input); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tiers { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tiers[hidden] { display: none; }
.tier-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: #cbd5e1; }
.tier-row input { width: 90px; padding: 8px 10px; }
.tier-row b { color: #86efac; min-width: 90px; }
.inline-field { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #cbd5e1; }
.inline-field input { width: 140px; }
.checkbox-field .help { margin-top: 0; }

.check-row { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.check-row label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check-row input { width: auto; }
.product-card .price small { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ---------- Produtos: filtros ---------- */
.filter-row { display: flex; gap: 10px; margin-bottom: 6px; }
.filter-row .search { flex: 1; margin: 0; }
.filter-row select { width: auto; min-width: 230px; }
.tabs { flex-wrap: wrap; }
.product-group { margin-top: 18px; }
.group-title { font-size: 17px; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.group-title span { font-size: 12px; color: var(--muted); background: rgba(148,163,184,.12); padding: 2px 8px; border-radius: 999px; }
.pending { color: #fcd34d; font-size: 12px; }
@media (max-width: 560px) { .filter-row { flex-direction: column; } .filter-row select { min-width: 0; width: 100%; } }
.clickable { cursor: pointer; }
.product-card .thumb.clickable:hover img { opacity: .85; }
.product-card h3.clickable:hover { color: var(--blue-light); }

/* ---------- Galeria de fotos do produto ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.g-item, .g-add {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--input);
}
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-item.cover { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(59,130,246,.25); }
.g-item.g-art { opacity: .6; }
.g-cover {
  position: absolute; top: 6px; left: 6px; background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.g-art .g-cover { background: rgba(0,0,0,.7); }
.g-actions {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px;
  padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.8));
  opacity: 0; transition: opacity .15s;
}
.g-item:hover .g-actions, .g-item:focus-within .g-actions { opacity: 1; }
.g-actions button {
  width: 28px; height: 28px; border-radius: 8px; border: none; cursor: pointer;
  background: rgba(255,255,255,.15); color: #fff; font-size: 14px;
}
.g-actions button:hover { background: var(--blue); }
.g-actions [data-g-del]:hover { background: var(--red); }
.g-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-style: dashed; cursor: pointer; color: var(--muted);
}
.g-add:hover { border-color: var(--blue); color: var(--text); }
.g-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.g-add span { font-size: 28px; line-height: 1; }
.g-add small { font-size: 12px; font-weight: 600; }
.photo-count {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff;
  font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
}
@media (hover: none) { .g-actions { opacity: 1; } }

.stock-tag { align-self: flex-start; font-size: 11px; font-weight: 700; color: #86efac; background: rgba(34,197,94,.12); padding: 2px 8px; border-radius: 999px; }

/* ---------- Venda pelo painel ---------- */
.quote-list { display: grid; gap: 8px; margin: 10px 0; }
.quote-opt { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; font: inherit; }
.quote-opt small { color: var(--muted); }
.quote-opt span { font-size: 13px; color: #cbd5e1; }
.quote-opt:hover, .quote-opt.active { border-color: var(--blue); background: rgba(59,130,246,.1); }
.pending-file { position: absolute; bottom: 4px; left: 4px; right: 4px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-inline .help { align-self: center; margin: 0; }

/* ---------- Envio e etiqueta do pedido ---------- */
.ship-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ship-line small, .label-row small { display: block; color: var(--muted, #94a3b8); margin-top: 3px; }
.label-list { display: grid; gap: 8px; margin-bottom: 12px; }
.label-row { padding: 10px 12px; border: 1px solid rgba(148,163,184,.2); border-radius: 10px; }
.label-row .status { margin-left: 6px; vertical-align: middle; }
.label-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

/* Aprovação da personalização */
.info-box.approval.wait { border-color: rgba(245,158,11,.5); }
.info-box.approval.ok { border-color: rgba(34,197,94,.45); }
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

@media (prefers-color-scheme: dark) { :root { color-scheme: only dark; } }

/* Vídeo na galeria do produto */
.g-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-cover.g-video { background: rgba(0,0,0,.7); }

/* Calculadora de frete */
.frete-linha { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border, rgba(148,163,184,.2)); }
.frete-linha .field { margin: 0; }
.frete-linha .field.grow { flex: 1 1 220px; }
.frete-linha .field.qtd { flex: 0 0 92px; }
.frete-linha .check-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; padding-bottom: 9px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.table td small { display: block; color: var(--muted, #94a3b8); font-size: 12px; }

/* Calculadora de frete: abas e opções em "chips" */
.abas-frete { display: flex; gap: 8px; margin: 6px 0 14px; flex-wrap: wrap; }
.abas-frete button { background: transparent; border: 1px solid rgba(148,163,184,.3); color: inherit; border-radius: 999px; padding: 8px 14px; cursor: pointer; font: inherit; font-size: 14px; }
.abas-frete button.ativo { border-color: var(--blue, #3b82f6); background: rgba(59,130,246,.15); }
.opcoes-chip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; flex-direction: column; justify-content: center; border: 1px solid rgba(148,163,184,.3); border-radius: 12px; padding: 9px 14px; cursor: pointer; font-weight: 600; min-width: 92px; }
.chip small { font-weight: 400; opacity: .7; font-size: 12px; }
.chip input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.chip.ativo { border-color: var(--blue, #3b82f6); background: rgba(59,130,246,.15); }
.chip-campo { flex-direction: row; align-items: center; gap: 8px; }
.chip-campo input { width: 80px; }

/* Prévia da imagem da cotação de frete */
.previa-frete { display: block; width: 100%; max-width: 420px; margin: 0 auto 10px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.4); }

/* Celular: tabelas rolam dentro do cartão; cotação de frete compacta */
.tabela-rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.tabela-rolagem .table { margin: 10px 0; }
.card { min-width: 0; }
@media (max-width: 560px) {
  .tabela-frete th:nth-child(5), .tabela-frete td:nth-child(5) { display: none; }
  .tabela-frete th, .tabela-frete td { padding: 8px 6px; font-size: 13px; }
  .tabela-frete td:nth-child(2) { white-space: nowrap; }
}
/* Janela: botões quebram linha no celular */
.modal-foot { flex-wrap: wrap; }
@media (max-width: 560px) { .modal-foot .btn { flex: 1 1 calc(50% - 10px); } }
/* Menu de baixo: 7 itens cabem (o texto encurta se precisar) */
@media (max-width: 900px) {
  .nav a { min-width: 0; flex: 1 1 0; }
  .nav a span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 400px) { .nav a { font-size: 9px; padding: 6px 1px; } .nav a i { font-size: 18px; } }
@media (max-width: 560px) {
  .tabela-frete td small { display: none; }
  .tabela-frete td:nth-child(2) { white-space: normal; }
  .tabela-frete th, .tabela-frete td { padding: 8px 5px; font-size: 12.5px; }
  .tabela-frete th:first-child, .tabela-frete td:first-child { padding-left: 0; }
}
