/* WD Ferragens — azul-marinho + laranja do logo */
:root {
  --navy-950: #061430;
  --navy-900: #0a1f44;
  --navy-800: #102b5c;
  --navy-700: #173a78;
  --blue: #1f5fd1;
  --blue-l: #3b82f6;
  --blue-50: #eef4ff;
  --orange: #ff6a00;
  --orange-d: #e84e00;
  --orange-50: #fff3ea;
  --grad-orange: linear-gradient(135deg, #ff7a1a 0%, #ff5a00 55%, #e84400 100%);
  --grad-navy: linear-gradient(135deg, #0a1f44 0%, #123672 60%, #1a4796 100%);
  --ink: #0f1b2d;
  --text: #2a3648;
  --muted: #6b7a90;
  --line: #e3e8f0;
  --bg: #f4f7fb;
  --white: #fff;
  --red: #d63b2f;
  --green: #17945a;
  --radius: 12px;
  --radius-s: 8px;
  --shadow-s: 0 1px 2px rgba(10,31,68,.06), 0 1px 3px rgba(10,31,68,.05);
  --shadow: 0 4px 16px rgba(10,31,68,.08);
  --shadow-l: 0 18px 50px rgba(10,31,68,.18);
  --head: 'Montserrat', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--body); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
main { flex: 1; padding-top: 28px; padding-bottom: 56px; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--head); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; }
.inline { display: inline; }

/* ---------- Topo ---------- */
.top { background: var(--grad-navy); color: var(--white); position: sticky; top: 0; z-index: 20; box-shadow: 0 4px 20px rgba(6,20,48,.25); }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.logo { height: 54px; width: auto; display: block; }
.brand-tag { font: 600 11px/1.25 var(--body); text-transform: uppercase; letter-spacing: .12em; color: #a9bce0; border-left: 2px solid var(--orange); padding-left: 12px; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a, .linkbtn { color: #dbe5f7; text-decoration: none; padding: 9px 14px; border-radius: 999px; font: 600 14px var(--body); background: none; border: 0; cursor: pointer; transition: background .15s, color .15s; }
.nav a:hover, .linkbtn:hover { background: rgba(255,255,255,.1); color: var(--white); }
.nav a.on { background: rgba(255,255,255,.14); color: var(--white); }
.cartlink { background: var(--grad-orange) !important; color: var(--white) !important; box-shadow: 0 4px 14px rgba(255,90,0,.35); margin-left: 6px; }
.cartlink .badge { background: var(--white); color: var(--orange-d); }
.badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--orange); color: var(--white); font-size: 12px; font-weight: 700; text-align: center; margin-left: 4px; }
.accent-line { height: 4px; background: linear-gradient(90deg, var(--orange) 0%, #ff8a3d 35%, var(--blue-l) 100%); }
.menu-btn { display: none; margin-left: auto; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: var(--white); font-size: 20px; padding: 6px 12px; border-radius: var(--radius-s); cursor: pointer; }
.foot { background: var(--navy-950); color: #9fb0cf; padding: 26px 0; font-size: 13px; }
.foot-in { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot-in b { color: var(--white); }
.foot-in a { margin-left: auto; color: var(--orange); text-decoration: none; font-weight: 600; }
.foot-logo { height: 40px; }

/* ---------- Componentes ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-s); margin-bottom: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: 1px solid var(--line); background: var(--white); color: var(--ink);
  font: 600 14px var(--body); border-radius: var(--radius-s); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--grad-orange); border-color: transparent; color: var(--white); box-shadow: 0 6px 16px rgba(255,90,0,.28); }
.btn.primary:hover { color: var(--white); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(255,90,0,.35); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: var(--white); }
.btn.blue:hover { background: var(--navy-700); color: var(--white); }
.btn.danger { color: var(--red); border-color: #f1c6c2; }
.btn.danger:hover { background: var(--red); color: var(--white); border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 14px 26px; font-size: 16px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.iconbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 6px 10px; border-radius: var(--radius-s); }
.iconbtn:hover { color: var(--red); background: #fdeceb; }

.fld { display: block; margin-bottom: 16px; }
.fld > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
input, select, textarea { width: 100%; padding: 11px 13px; border: 1px solid #cfd8e6; border-radius: var(--radius-s); font: 15px var(--body); background: var(--white); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-l); box-shadow: 0 0 0 4px rgba(59,130,246,.15); }
input[readonly] { background: var(--bg); color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--orange); }
.check { display: flex; gap: 10px; align-items: center; margin: 8px 0 14px; }
.fld.inline { display: flex; align-items: center; gap: 10px; }
.fld.inline > span { margin: 0; flex: 1; }
.fld.inline input { width: 140px; }
fieldset { border: 0; border-top: 1px solid var(--line); padding: 18px 0 0; margin: 0 0 6px; }
legend { font: 700 12px var(--head); text-transform: uppercase; color: var(--orange-d); letter-spacing: .12em; padding-right: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.form-wide { max-width: 780px; margin: 0 auto; padding: 32px; }
input.money { text-align: right; max-width: 130px; }
input.short { width: 90px; }
.short-name { width: 200px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form .check { margin: 0; }

.flash { padding: 14px 18px; border-radius: var(--radius-s); margin-bottom: 20px; border: 1px solid; font-weight: 500; }
.flash.ok { border-color: #bfe8d3; background: #ecfaf3; color: #0d6b40; }
.flash.err { border-color: #f4c7c2; background: #fdeeec; color: #a62a20; }
.flash.warn { border-color: #ffd5b5; background: var(--orange-50); color: #9a3d00; }
.empty { padding: 56px 20px; text-align: center; background: var(--white); border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; font-weight: 600; color: var(--muted); }
.back:hover { color: var(--blue); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 18px; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-head .actions, .page-head .search { margin-left: auto; }
.actions.full { grid-column: 1 / -1; }
.actions.sticky { position: sticky; bottom: 0; background: rgba(244,247,251,.95); backdrop-filter: blur(6px); padding: 14px 0; border-top: 1px solid var(--line); }
.spacer { flex: 1; }

.search { display: flex; gap: 8px; flex: 1; max-width: 560px; }
.search select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { padding: 7px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; transition: .15s; }
.chip:hover { border-color: var(--blue-l); color: var(--blue); }
.chip small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip.on { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.chip.on small { color: #ffb37a; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 700 11px var(--body); text-transform: uppercase; letter-spacing: .04em; background: #eef1f6; color: var(--muted); vertical-align: middle; }
.tag.green, .st-aprovado, .us-approved { background: #e3f6ec; color: var(--green); }
.tag.red, .st-cancelado, .us-blocked { background: #fde6e4; color: var(--red); }
.st-novo { background: var(--orange-50); color: var(--orange-d); }
.st-em_analise { background: var(--blue-50); color: var(--blue); }
.st-respondido { background: #ece8ff; color: #5b3fd0; }

/* ---------- Hero do catálogo ---------- */
.hero { background: var(--grad-navy); color: var(--white); border-radius: var(--radius); padding: 28px 30px; margin-bottom: 22px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero::after { content: ''; position: absolute; right: -60px; top: -40px; width: 320px; height: 320px; background: var(--grad-orange); clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%); opacity: .95; transform: skewX(-12deg); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: var(--white); margin: 0 0 4px; }
.hero p { margin: 0 0 18px; color: #c7d4ee; max-width: 560px; }
.hero .search { max-width: 640px; }
.hero .search input { border: 0; padding: 13px 16px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; box-shadow: var(--shadow-s); }
.card .table-wrap { border: 0; box-shadow: none; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font: 700 11px var(--body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: #f7f9fc; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover td { background: #fafcff; }
.tbl.compact td, .tbl.compact th { padding: 8px 12px; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 600; border-bottom: 0; background: #f7f9fc; }
.tbl .total { font: 800 20px var(--head); color: var(--orange-d); }
.tbl tr.inactive td { opacity: .5; }
.tbl tr.unseen td { background: var(--orange-50); font-weight: 600; }
.tbl input.qty { width: 90px; text-align: right; }
.actions-cell { white-space: nowrap; }

/* ---------- Fotos ---------- */
.noimg { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f1f5fb, #e6edf7); color: #b7c5dc; }
.noimg .ph { width: 38%; height: 38%; }
.mini { width: 46px; height: 46px; object-fit: contain; background: var(--white); border-radius: var(--radius-s); border: 1px solid var(--line); display: block; }
.pphoto { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--white); display: flex; padding: 10px; }
.bigphoto { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); display: flex; padding: 20px; box-shadow: var(--shadow-s); }
.formphoto { width: 180px; height: 180px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 12px; display: flex; }

/* ---------- Catálogo ---------- */
.grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.pcard { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s, border-color .2s; }
.pcard:hover { box-shadow: var(--shadow-l); transform: translateY(-3px); border-color: transparent; }
.pimg { display: block; border-bottom: 1px solid var(--line); position: relative; }
.pbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcode { font: 700 11px var(--body); color: var(--blue); text-transform: uppercase; letter-spacing: .06em; }
.pname { color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35; flex: 1; }
.pname:hover { color: var(--blue); }
.pprice { font: 800 22px var(--head); color: var(--navy-900); }
.pprice small { font: 500 12px var(--body); color: var(--muted); }
.pprice.big { font-size: 34px; margin: 10px 0 18px; color: var(--orange-d); }
.noprice { font: 600 13px var(--body); color: var(--muted); background: #f2f5fa; padding: 4px 10px; border-radius: 999px; }
.addform { display: flex; gap: 6px; }
.addform input { width: 74px; text-align: right; padding: 9px; }
.addform .btn { flex: 1; }
.addform.big { flex-wrap: wrap; align-items: flex-end; margin-top: 18px; }
.addform.big .fld { margin: 0; }
.incart { font-size: 12px; color: var(--green); font-weight: 600; min-height: 1em; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 28px; }
.product { display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: 28px; align-items: start; }
.desc p { margin: 0 0 8px; }

/* ---------- Login / cadastro ---------- */
body:has(.auth) { background: radial-gradient(1200px 600px at 10% 0%, #dfe9fb 0%, var(--bg) 60%); }
.auth { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 980px; margin: 24px auto; box-shadow: var(--shadow-l); border-radius: 18px; overflow: hidden; background: var(--white); }
.auth-side { background: var(--grad-navy); color: #d3def3; padding: 44px; position: relative; overflow: hidden; }
.auth-side::before { content: ''; position: absolute; right: -120px; bottom: -120px; width: 340px; height: 340px; background: var(--grad-orange); transform: rotate(35deg); opacity: .9; border-radius: 24px; }
.auth-side > * { position: relative; }
.auth-logo { width: 190px; margin-bottom: 28px; }
.auth-side h1 { font-size: 34px; color: var(--white); }
.auth-side em { color: #ff8a3d; font-style: normal; display: block; }
.ticks { list-style: none; padding: 0; margin: 26px 0 0; }
.ticks li { padding: 7px 0 7px 32px; position: relative; color: var(--white); font-weight: 500; }
.ticks li::before { content: '✓'; position: absolute; left: 0; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: var(--white); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.auth-card { margin: 0; border: 0; border-radius: 0; padding: 44px; box-shadow: none; align-self: center; }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }

/* ---------- Admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { background: var(--white); border: 1px solid var(--line); padding: 18px 20px; border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-s); transition: .2s; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue-l); }
.stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat b { display: block; font: 800 34px/1.1 var(--head); color: var(--navy-900); }
.stat span { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat.hot { background: var(--grad-orange); border-color: transparent; }
.stat.hot::before { display: none; }
.stat.hot b, .stat.hot span { color: var(--white); }
.product-form { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.client-box div { margin-bottom: 2px; }
.note { white-space: pre-line; }
.note.hi { border-left: 4px solid var(--orange); background: var(--orange-50); }

/* ---------- Documento do pedido (PDF) ---------- */
body.bare { background: #dfe5ee; }
body.bare main { padding-top: 0; }
.print-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 0; position: sticky; top: 0; background: #dfe5ee; z-index: 2; }
.sheet { background: var(--white); max-width: 900px; margin: 0 auto 40px; box-shadow: var(--shadow-l); border-radius: 6px; overflow: hidden; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: var(--grad-navy); color: var(--white); padding: 22px 32px; border-bottom: 5px solid var(--orange); }
.sheet-logo { height: 64px; display: block; }
.sheet-head .small { margin-top: 6px; color: #c7d4ee; }
.sheet-head .right { text-align: right; }
.sheet-head h1 { font-size: 14px; margin: 0; color: #ffb37a; letter-spacing: .1em; }
.sheet-head .big { font: 800 30px var(--head); }
.sheet-body { padding: 24px 32px 30px; }
.sheet-client { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; padding: 12px 14px; background: #f4f7fb; border-radius: var(--radius-s); margin-bottom: 18px; font-size: 14px; }
.sheet-client .full { grid-column: 1 / -1; }
.sheet .table-wrap { border: 1px solid var(--line); overflow: visible; box-shadow: none; border-radius: var(--radius-s); }
.sheet .tbl th { background: var(--navy-900); color: var(--white); }

@media print {
  @page { size: A4; margin: 10mm; }
  body, body.bare { background: #fff; }
  .noprint, .top, .foot { display: none !important; }
  .sheet { box-shadow: none; margin: 0; max-width: none; border-radius: 0; }
  .wrap { padding: 0; max-width: none; }
  .sheet-head, .sheet .tbl th, .sheet-client, .tbl tfoot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr { break-inside: avoid; }
}

/* ---------- Toast ---------- */
.toast { position: fixed; right: 18px; bottom: 18px; background: var(--navy-900); color: var(--white); padding: 14px 20px; border-radius: var(--radius-s); border-left: 4px solid var(--orange); box-shadow: var(--shadow-l); z-index: 50; transform: translateY(20px); opacity: 0; transition: .25s; font-weight: 500; }
.toast.show { transform: none; opacity: 1; }
.toast a { color: #ff9a55; margin-left: 10px; font-weight: 700; }

/* ---------- Celular ---------- */
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .brand-tag { display: none; }
  .logo { height: 46px; }
  .top-in { min-height: 66px; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 66px; background: var(--navy-900); flex-direction: column; align-items: stretch; padding: 10px 16px 18px; box-shadow: var(--shadow-l); }
  .nav a, .linkbtn { border-radius: var(--radius-s); text-align: left; }
  .cartlink { margin: 6px 0 0; }
  body.nav-open .nav { display: flex; }
  .cols, .grid2, .product, .product-form, .auth, .sheet-client { grid-template-columns: 1fr; }
  .auth-side { padding: 30px 24px; }
  .auth-card { padding: 30px 24px; }
  .form-wide { padding: 22px; }
  .hero { padding: 22px 20px; }
  .hero::after { width: 160px; right: -70px; }
  .grid-products { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .addform { flex-direction: column; }
  .addform input { width: 100%; }
  .page-head .actions, .page-head .search { margin-left: 0; max-width: none; width: 100%; }
  .sheet-head { flex-direction: column; align-items: flex-start; padding: 18px; }
  .sheet-head .right { text-align: left; }
  .sheet-body { padding: 18px; }
  h1 { font-size: 23px; }
  .foot-in a { margin-left: 0; }
}

/* ---------- Cores / acabamentos ---------- */
.addform { flex-direction: column; }
.addrow { display: flex; gap: 6px; }
.addrow .btn { flex: 1; }
.addform.big { flex-direction: column; align-items: stretch; max-width: 360px; }
.addform.big .fld { margin: 0 0 4px; }
.color-sel { padding: 8px 10px; font-size: 14px; }
.pprice-cr { font-size: 13px; color: var(--muted); margin-top: -4px; }
.pprice-cr b { color: var(--navy-800); }
.tag.color-tag { background: var(--blue-50); color: var(--navy-700); text-transform: none; letter-spacing: 0; font-size: 12px; }
.color-checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.color-checks .check { margin: 4px 0; font-size: 14px; }

.steps { padding-left: 20px; margin: 0; }
.steps li { margin-bottom: 10px; }

/* ---------- Abas e painel ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--line); margin: 0 0 22px; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a:hover { color: var(--blue); }
.tabs a.on { color: var(--navy-900); border-bottom-color: var(--orange); }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.big-num { font: 800 32px var(--head); color: var(--orange-d); }
@media (max-width: 900px) { .cols3 { grid-template-columns: 1fr; } }
.inline-details { display: inline-block; margin-right: 6px; }
.inline-details > summary { list-style: none; }
.inline-details > summary::-webkit-details-marker { display: none; }

/* ---------- Relatórios ---------- */
.back-top { display: block; margin-bottom: 4px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.filters .fld { margin: 0; }
.filters select, .filters input[type=date] { width: auto; }
.filters .custom { display: contents; }
.filters .custom[hidden] { display: none; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-s); display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font: 700 28px/1.15 var(--head); color: var(--ink); }
.kpi.kpi-hero { grid-column: span 2; }
.kpi.kpi-hero .kpi-value { font-size: 48px; }
.delta { font-size: 12px; color: var(--muted); font-weight: 600; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.seg { display: inline-flex; background: #eef2f8; border-radius: 999px; padding: 3px; }
.seg a { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--white); color: var(--ink); box-shadow: var(--shadow-s); }

.hbars { display: flex; flex-direction: column; gap: 2px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 6px; outline: none; }
.hbar:hover, .hbar:focus-visible { background: #f4f7fc; }
.hbar-label { display: flex; flex-direction: column; min-width: 0; }
.hbar-label span { font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-label small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 16px; position: relative; }
.hbar-fill { height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; transition: background .15s; }
.hbar:hover .hbar-fill, .hbar:focus-visible .hbar-fill { background: var(--navy-700); }
.hbar-val { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.colchart { display: grid; grid-template-columns: auto 1fr; gap: 8px; height: 240px; margin: 8px 0 30px; }
.col-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; transform: translateY(-6px); height: calc(100% + 6px); }
.col-plot { position: relative; border-bottom: 1px solid #c9d3e2; }
.col-grid { position: absolute; left: 0; right: 0; height: 1px; background: #eef1f6; }
.col-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; outline: none; cursor: default; }
.col-fill { width: 100%; max-width: 24px; background: var(--blue); border-radius: 4px 4px 0 0; transition: background .15s; }
.col:hover .col-fill, .col:focus-visible .col-fill { background: var(--navy-700); }
.col:hover, .col:focus-visible { background: rgba(31,95,209,.05); }
.col-x { position: absolute; top: 100%; margin-top: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }

.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--navy-900); color: var(--white); font-size: 12px; font-weight: 500; padding: 7px 10px; border-radius: 6px; box-shadow: var(--shadow-l); max-width: 320px; }
.datatable { margin-top: 12px; }
.datatable summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); }
.datatable .table-wrap { margin-top: 8px; }
.meter { height: 8px; background: #e7edf6; border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; background: var(--blue); border-radius: 999px; }
@media (max-width: 900px) { .kpi.kpi-hero { grid-column: auto; } .kpi.kpi-hero .kpi-value { font-size: 36px; } .hbar { grid-template-columns: 1fr auto; } .hbar-track { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi.kpi-hero { grid-column: 1 / -1; } }

/* ---------- Envio pelo WhatsApp ---------- */
.btn.wa { background: #25d366; border-color: #1ebe5a; color: #fff; box-shadow: 0 6px 16px rgba(37,211,102,.3); }
.btn.wa:hover { background: #1ebe5a; color: #fff; }
.send-wa { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(135deg, #e9fbf0, #f4fff8);
  border: 1px solid #b6ecc9; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; }
.send-wa h2 { margin: 0 0 4px; color: #0d6b40; font-size: 20px; }
.send-wa p { margin: 0; color: var(--text); max-width: 620px; }
/* ---------- Janela de confirmação ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(6,20,48,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-l); padding: 24px; max-width: 420px; width: 100%; border-top: 4px solid var(--orange); }
.modal p { margin: 0 0 18px; font-size: 16px; font-weight: 600; color: var(--ink); }
.modal .actions { justify-content: flex-end; }
/* admin vendo a loja */
.is-admin .addform, .is-admin .incart { display: none; }
.admin-view-bar { background: var(--orange-50); color: #8a3a00; border-bottom: 1px solid #ffd5b5; text-align: center; padding: 8px 16px; font-size: 13px; font-weight: 600; }
.admin-view-bar a { margin-left: 8px; }
