/* Love — tema (mesmo visual do protótipo aprovado) */
:root {
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --serif: Georgia, "Times New Roman", serif;
  --brand-wine: #7C2E48;

  --ground: #FAF7F5;
  --panel: #FFFFFF;
  --panel-2: #F6F1EF;
  --ink: #221B1A;
  --muted: #7C706E;
  --faint: #A89C99;
  --line: #EAE0DB;
  --line-2: #D9CCC6;

  --rose: #833150;
  --rose-deep: #6A2740;
  --rose-soft: #F4E6EB;
  --gold: #A9814B;
  --gold-soft: #F3EADB;
  --money: #3E7A5E;
  --money-soft: #E6F0EA;
  --warn: #A9731F;
  --danger: #A9402F;
  --danger-soft: #F6E4E0;
  --consign: #7E5AA0;
  --consign-soft: #EEE8F5;
  --btn-text: #FFFFFF;
  --pdv-card-text: var(--ink);
  --pdv-card-muted: var(--faint);

  --shadow-sm: 0 1px 2px rgba(39,32,31,.05);
  --shadow: 0 2px 6px rgba(39,32,31,.05), 0 14px 34px -20px rgba(39,32,31,.22);
  --r: 14px;
}

/* Tema padrão = CLARO. O escuro só entra quando a pessoa clica no botão
   (data-theme="dark"), com contraste alto — texto claro em fundo escuro. */
:root[data-theme="dark"] {
  --ground: #16100F;
  --panel: #211917;
  --panel-2: #2A201D;
  --ink: #F5EDEA;      /* texto principal — bem claro */
  --muted: #C2B5B1;    /* texto secundário — cinza claro, legível */
  --faint: #93857F;
  --line: #382C29;
  --line-2: #4B3C37;

  --rose: #E88BA6;     /* rosé claro para brilhar no escuro */
  --rose-deep: #F3AEC4;
  --rose-soft: #3C2029;
  --gold: #DDB067;
  --gold-soft: #342819;
  --money: #6FCB9C;
  --money-soft: #17291F;
  --warn: #DFB362;
  --danger: #EC8E7B;
  --danger-soft: #3B241E;
  --consign: #C3A6EF;
  --consign-soft: #2C2142;
  --btn-text: #2A1016; /* texto escuro sobre botões claros */
  --pdv-card-text: #FFF1F5;   /* rosa quase branco para leitura no PDV */
  --pdv-card-muted: #D8C1C8;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 2px 8px rgba(0,0,0,.45), 0 16px 40px -22px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { margin: 0; letter-spacing: -.01em; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--rose); }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.money { color: var(--money); }
.muted { color: var(--muted); }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.brand { position: relative; padding: 20px 20px 18px; border-bottom: 1px solid var(--line); text-align: center; flex-shrink: 0; }
.logo-badge { display: inline-block; background: var(--brand-wine); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 23px; line-height: 1; padding: 11px 16px 13px; border-radius: 13px; box-shadow: 0 8px 20px -10px var(--brand-wine); }
.brand .sub { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin-top: 11px; }
nav.mainnav { padding: 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
nav.mainnav::-webkit-scrollbar { width: 7px; }
nav.mainnav::-webkit-scrollbar-track { background: transparent; }
nav.mainnav::-webkit-scrollbar-thumb { background: var(--line-2); border: 2px solid var(--panel); border-radius: 999px; }
nav.mainnav::-webkit-scrollbar-thumb:hover { background: var(--rose); }
.nav-lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 6px; }
.navbtn { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 0; background: none; color: var(--muted); border-radius: 10px; font-size: 14.5px; font-weight: 540; width: 100%; text-align: left; text-decoration: none; transition: background .12s, color .12s; }
.navbtn svg { width: 19px; height: 19px; flex-shrink: 0; }
.navbtn:hover { background: var(--panel-2); color: var(--ink); }
.navbtn.active { background: var(--rose-soft); color: var(--rose-deep); font-weight: 620; }
.navbtn.disabled { opacity: .45; pointer-events: none; }
.navbtn .soon { margin-left: auto; font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; }
.side .foot { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.side .foot .who { flex: 1; min-width: 0; }
.theme-toggle { border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; transition: color .12s, border-color .12s; }
.theme-toggle:hover { color: var(--rose-deep); border-color: var(--rose); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--rose), var(--gold)); color: var(--btn-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.side .foot a { font-size: 12px; }
.menu-toggle, .menu-close, .menu-backdrop { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 15px 26px; border-bottom: 1px solid var(--line); background: var(--ground); background: color-mix(in srgb, var(--ground) 85%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.pagetitle { font-size: 17px; font-weight: 660; }
.topbar .loja { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.content { padding: 26px; }

/* ---------- componentes ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.pill { font-family: var(--mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pill.consign { background: var(--consign-soft); color: var(--consign); }
.pill.own { background: var(--rose-soft); color: var(--rose-deep); }
.pill.ok { background: var(--money-soft); color: var(--money); }
.pill.warn { background: var(--gold-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.stock { background: var(--panel-2); color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px,1fr)); gap: 14px; }
.kpi { padding: 16px 17px; }
.kpi .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.kpi .v { font-size: 27px; font-weight: 720; margin-top: 8px; letter-spacing: -.02em; }
.kpi .d { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
tbody tr.birthday-today-row td { background: var(--rose-soft); }
tbody tr.birthday-today-row td:first-child { border-left: 3px solid var(--rose); }
tbody tr:last-child td { border-bottom: 0; }
.r { text-align: right; }
.tablewrap { overflow-x: auto; }
.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-th::after { content: "↕"; display: inline-block; margin-left: 6px; color: var(--faint); font-size: 10px; }
.sortable-th[aria-sort="ascending"]::after { content: "↑"; color: var(--rose); }
.sortable-th[aria-sort="descending"]::after { content: "↓"; color: var(--rose); }
.sortable-th:hover { color: var(--rose-deep); }
.sortable-th:focus-visible { outline: 2px solid var(--rose); outline-offset: -2px; border-radius: 4px; }

.btn { border: 0; border-radius: 11px; padding: 11px 16px; font-size: 14px; font-weight: 620; }
.btn-primary { background: var(--rose); color: var(--btn-text); box-shadow: 0 6px 16px -8px var(--rose); }
.btn-primary:hover { background: var(--rose-deep); }
.btn-ghost { background: var(--panel); border: 1px solid var(--line-2); color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label.f { display: block; font-size: 12.5px; color: var(--muted); font-weight: 560; margin-bottom: 5px; }
input.f, select.f { width: 100%; font-family: inherit; font-size: 14.5px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--ink); }
input.f:focus, select.f:focus { outline: 2px solid var(--rose-soft); border-color: var(--rose); }

.alertbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }
.alertbar.warn { background: var(--gold-soft); color: var(--warn); border: 1px solid #E3CD9C; border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alertbar.bad { background: var(--danger-soft); color: var(--danger); border: 1px solid #E5BCB1; border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alertbar.ok { background: var(--money-soft); color: var(--money); border: 1px solid #B8D8C7; border-color: color-mix(in srgb, var(--money) 30%, transparent); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 24px; background-color: var(--ground); background-image: radial-gradient(62% 60% at 50% 45%, rgba(28,10,18,.55), rgba(28,10,18,.32)), url('login-bg.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 26px 64px -18px rgba(18,7,12,.62); padding: 34px 32px 30px; text-align: center; }
.login-card .logo-badge { font-size: 27px; padding: 13px 20px 15px; }
.login-card .sub { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin: 12px 0 26px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.captcha-box { display: grid; grid-template-columns: 1fr 42px; gap: 10px; align-items: center; margin-bottom: 9px; }
.captcha-image { width: 100%; height: 96px; display: block; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); object-fit: cover; }
.captcha-refresh { width: 42px; height: 42px; border: 0; background: transparent; color: var(--rose); font-size: 28px; line-height: 1; border-radius: 10px; display: grid; place-items: center; }
.captcha-refresh:hover { background: var(--rose-soft); color: var(--rose-deep); }
.captcha-refresh:disabled { opacity: .45; cursor: wait; }
.captcha-input { text-align: center; font-family: var(--mono); letter-spacing: .12em; }
.love-instalar-link { margin-top: 18px; background: none; border: 0; padding: 4px; font-family: inherit; font-size: 12.5px; font-weight: 560; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; transition: color .12s; }
.love-instalar-link:hover { color: var(--rose); }

/* ---------- botão flutuante de instalar o app ---------- */
/* Fica escondido e só aparece quando o navegador confirma que dá para instalar. */
.pwa-install-fab { position: fixed; right: 16px; bottom: 16px; z-index: 45; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px; background: var(--rose); color: var(--btn-text); font-family: inherit; font-size: 13.5px; font-weight: 620; cursor: pointer; box-shadow: 0 10px 24px -8px rgba(131,49,80,.75), 0 2px 8px rgba(0,0,0,.14); transition: background .14s, transform .14s; }
.pwa-install-fab:hover { background: var(--rose-deep); transform: translateY(-1px); }
.pwa-install-fab:active { transform: none; }
.pwa-install-fab svg { width: 17px; height: 17px; flex: 0 0 auto; }
.pwa-install-fab[hidden] { display: none; }
@media (max-width: 720px) { .pwa-install-fab { right: 12px; bottom: 12px; padding: 9px 14px; font-size: 13px; } }

/* ========================================================================== */
/* Login editorial — experiência Love                                         */
/* ========================================================================== */
.love-login-page {
  --login-wine: #360a18;
  --login-wine-2: #551329;
  --login-berry: #8d3659;
  --login-rose: #dca0b3;
  --login-blush: #f4dfe4;
  --login-cream: #fbf7f1;
  --login-paper: #fffdf9;
  --login-gold: #d6ac67;
  --login-ink: #2a1820;
  --login-muted: #806d74;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--login-cream);
  color: var(--login-ink);
  font-family: "Manrope", var(--sans);
  overflow-x: hidden;
}

.love-login-page::selection { background: var(--login-blush); color: var(--login-wine); }

.login-skip {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: var(--login-wine);
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.login-skip:focus { transform: translateY(0); }

.login-experience {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(420px, .88fr);
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
}

.login-ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.login-orb { position: absolute; border-radius: 50%; filter: blur(8px); opacity: .5; }
.orb-one {
  width: 44vw;
  height: 44vw;
  left: calc(var(--pointer-x, 50%) - 30vw);
  top: calc(var(--pointer-y, 50%) - 36vw);
  background: radial-gradient(circle, rgba(218,145,171,.34), transparent 68%);
  transition: left 1.2s cubic-bezier(.2,.8,.2,1), top 1.2s cubic-bezier(.2,.8,.2,1);
}
.orb-two {
  width: 34vw;
  height: 34vw;
  left: 42vw;
  bottom: -20vw;
  background: radial-gradient(circle, rgba(214,172,103,.3), transparent 70%);
}
.login-grain {
  position: absolute;
  inset: -60%;
  opacity: .05;
  background-image: repeating-radial-gradient(circle at 30% 20%, #fff 0 1px, transparent 1px 4px);
  background-size: 7px 7px;
  animation: login-grain 1.2s steps(2) infinite;
}

.login-showcase {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(28px, 3vw, 54px) clamp(32px, 4.3vw, 76px) clamp(28px, 3vw, 46px);
  overflow: hidden;
  color: #fff8f6;
  background:
    radial-gradient(circle at 74% 33%, rgba(147,56,88,.8), transparent 32%),
    radial-gradient(circle at 10% 85%, rgba(104,26,51,.92), transparent 36%),
    linear-gradient(135deg, #260611 0%, var(--login-wine) 46%, #4c1025 100%);
}
.login-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.9%, rgba(255,255,255,.035) 50%, transparent 50.1%),
    linear-gradient(transparent 49.9%, rgba(255,255,255,.03) 50%, transparent 50.1%);
  background-size: 88px 88px;
  mask-image: linear-gradient(to right, rgba(0,0,0,.55), transparent 75%);
  pointer-events: none;
}
.login-showcase::after {
  content: "LOVE";
  position: absolute;
  right: -4vw;
  bottom: -5vw;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.055);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(150px, 24vw, 410px);
  font-weight: 600;
  line-height: .72;
  letter-spacing: -.08em;
  pointer-events: none;
}

.login-brandbar,
.showcase-footer {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.login-wordmark {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  color: #fff;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(38px, 3.3vw, 56px);
  font-weight: 600;
  line-height: .8;
  letter-spacing: -.055em;
  text-decoration: none;
}
.login-wordmark span { color: var(--login-rose); font-size: .48em; line-height: .9; }
.login-instagram {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 999px;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.login-instagram:hover { color: #fff; border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.07); }
.instagram-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--login-rose); box-shadow: 0 0 0 5px rgba(220,160,179,.12); }

.showcase-copy {
  position: relative;
  z-index: 4;
  align-self: center;
  width: min(46%, 530px);
  padding: 5vh 0 3vh;
  animation: login-copy-in .9s .12s both cubic-bezier(.2,.8,.2,1);
}
.showcase-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--login-rose);
  font-size: clamp(10px, .82vw, 13px);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.showcase-kicker span { width: 34px; height: 1px; background: currentColor; }
.showcase-copy h1 {
  margin: 0;
  color: #fff;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(52px, 5.3vw, 94px);
  font-weight: 500;
  line-height: .84;
  letter-spacing: -.055em;
}
.showcase-copy h1 em { color: var(--login-rose); font-weight: 500; }
.showcase-lead {
  max-width: 455px;
  margin: 30px 0 0;
  color: rgba(255,245,244,.66);
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.8;
}
.showcase-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.showcase-pills span {
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: rgba(255,255,255,.78);
  font-size: 10px;
  letter-spacing: .04em;
  backdrop-filter: blur(8px);
}

.login-gallery {
  position: absolute;
  z-index: 3;
  top: 14%;
  right: 2.4%;
  bottom: 9%;
  left: 45%;
  pointer-events: none;
  perspective: 1200px;
}
.gallery-card {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: clamp(16px, 1.5vw, 25px);
  background: #603048;
  box-shadow: 0 35px 80px -25px rgba(0,0,0,.72);
  transform: translate3d(var(--card-x, 0), var(--card-y, 0), 0) rotate(var(--card-r, 0deg));
  will-change: transform;
  transition: transform .6s cubic-bezier(.2,.8,.2,1), box-shadow .4s ease;
}
.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18), transparent 25%, transparent 70%, rgba(44,3,18,.3));
  pointer-events: none;
}
.gallery-card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.gallery-card figcaption {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 13px;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-shadow: 0 2px 12px rgba(0,0,0,.8);
  text-transform: uppercase;
}
.gallery-card figcaption b { font-weight: 500; opacity: .7; }
.gallery-main {
  width: min(43%, 330px);
  height: 76%;
  top: 8%;
  left: 15%;
  --card-r: -5deg;
  animation: gallery-main-in 1s .18s both cubic-bezier(.2,.8,.2,1), gallery-breathe 7s 1.2s infinite ease-in-out;
}
.gallery-top {
  width: min(35%, 255px);
  height: 42%;
  top: 0;
  right: 3%;
  --card-r: 6deg;
  animation: gallery-top-in 1s .32s both cubic-bezier(.2,.8,.2,1);
}
.gallery-bottom {
  width: min(38%, 275px);
  height: 43%;
  right: 0;
  bottom: 3%;
  --card-r: -2.5deg;
  animation: gallery-bottom-in 1s .42s both cubic-bezier(.2,.8,.2,1);
}
.gallery-seal {
  position: absolute;
  z-index: 5;
  bottom: 8%;
  left: 4%;
  display: grid;
  place-items: center;
  width: 102px;
  height: 102px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  color: rgba(255,255,255,.74);
  background: rgba(55,10,25,.3);
  box-shadow: inset 0 0 0 7px rgba(255,255,255,.035);
  backdrop-filter: blur(10px);
  animation: seal-in .8s .68s both ease, seal-float 6s 1.5s infinite ease-in-out;
}
.gallery-seal span { position: absolute; font-size: 8px; font-weight: 700; letter-spacing: .13em; transform: translateY(-32px); }
.gallery-seal b { color: var(--login-rose); font-size: 25px; font-weight: 400; }

.showcase-footer { align-self: end; justify-content: flex-start; color: rgba(255,255,255,.46); font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.showcase-line { width: clamp(38px, 5vw, 90px); height: 1px; background: rgba(255,255,255,.19); }

.login-access {
  position: relative;
  z-index: 7;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(24px, 3vw, 52px) clamp(28px, 4vw, 68px) 24px;
  background:
    radial-gradient(circle at 92% 5%, rgba(222,178,190,.2), transparent 28%),
    linear-gradient(145deg, var(--login-paper), var(--login-cream));
  box-shadow: -28px 0 70px -44px rgba(16,0,5,.75);
}
.login-access::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(transparent, rgba(117,48,73,.2), transparent);
}
.login-mobile-brand { display: none; }
.login-access-inner { width: min(100%, 410px); margin: auto; animation: access-in .8s .18s both cubic-bezier(.2,.8,.2,1); }
.access-heading { margin-bottom: clamp(26px, 3.2vh, 38px); }
.access-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--login-berry);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.access-eyebrow::before { content: ""; width: 17px; height: 1px; background: currentColor; }
.access-heading h2 {
  margin-top: 13px;
  color: var(--login-wine);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(40px, 3.5vw, 56px);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.045em;
}
.access-heading p { margin: 13px 0 0; color: var(--login-muted); font-size: 12px; }
.login-alert { border-radius: 13px; font-size: 12px; }

.login-form-modern { display: flex; flex-direction: column; gap: 20px; }
.login-field label,
.captcha-label-row label {
  display: block;
  margin-bottom: 8px;
  color: #59444c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.login-input-wrap { position: relative; }
.login-input-wrap input {
  width: 100%;
  height: 54px;
  padding: 0 54px 0 17px;
  border: 1px solid #ded1d2;
  border-radius: 14px;
  outline: 0;
  background: rgba(255,255,255,.68);
  color: var(--login-ink);
  font-family: inherit;
  font-size: 13px;
  box-shadow: 0 10px 30px -26px rgba(58,5,23,.45);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}
.login-input-wrap input::placeholder { color: #b4a4a9; }
.login-input-wrap input:hover { border-color: #cbbabd; background: rgba(255,255,255,.9); }
.login-input-wrap input:focus {
  border-color: var(--login-berry);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(141,54,89,.08), 0 16px 30px -24px rgba(58,5,23,.42);
  transform: translateY(-1px);
}
.field-mark,
.password-toggle {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: #aa989e;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}
.password-toggle {
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--login-berry);
  cursor: pointer;
  transition: background .2s ease;
}
.password-toggle:hover { background: var(--login-blush); }
.captcha-label-row { display: flex; align-items: center; justify-content: space-between; }
.captcha-label-row span { margin-bottom: 8px; color: #aa989e; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.captcha-modern {
  display: grid;
  grid-template-columns: minmax(104px, 1.25fr) 42px minmax(90px, .85fr);
  gap: 8px;
  align-items: center;
}
.captcha-modern .captcha-image {
  height: 60px;
  border: 1px solid #ded1d2;
  border-radius: 13px;
  filter: saturate(.85) contrast(1.02);
}
.captcha-modern .captcha-refresh {
  width: 42px;
  height: 42px;
  border: 1px solid #e3d8da;
  border-radius: 12px;
  background: rgba(255,255,255,.6);
  color: var(--login-berry);
  font-size: 23px;
  transition: transform .25s ease, background .2s ease;
}
.captcha-modern .captcha-refresh:hover { background: #fff; transform: rotate(45deg); }
.captcha-modern .captcha-input {
  width: 100%;
  height: 54px;
  padding: 0 10px;
  border: 1px solid #ded1d2;
  border-radius: 13px;
  outline: 0;
  background: rgba(255,255,255,.68);
  color: var(--login-wine);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .14em;
  text-align: center;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.captcha-modern .captcha-input:focus { border-color: var(--login-berry); box-shadow: 0 0 0 4px rgba(141,54,89,.08); }
.captcha-modern .captcha-input::placeholder { color: #c5b9bc; }

.login-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  margin-top: 4px;
  padding: 0 10px 0 22px;
  overflow: hidden;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(115deg, var(--login-wine), #631a35 58%, #7f2949);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 18px 34px -18px rgba(62,8,27,.72);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.login-submit::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -80%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-18deg);
  transition: left .65s ease;
}
.login-submit:hover { transform: translateY(-2px); box-shadow: 0 22px 42px -18px rgba(62,8,27,.78); }
.login-submit:hover::before { left: 135%; }
.login-submit:active { transform: translateY(0); }
.login-submit:disabled { cursor: wait; opacity: .8; }
.submit-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255,255,255,.12);
  font-size: 17px;
  transition: transform .2s ease, background .2s ease;
}
.login-submit:hover .submit-arrow { transform: rotate(45deg); background: rgba(255,255,255,.19); }
.login-submit.is-loading .submit-arrow { animation: login-spin 1s linear infinite; }

.login-divider { display: flex; align-items: center; gap: 11px; margin: 22px 0 17px; color: #b5a8ac; font-size: 9px; text-transform: uppercase; }
.login-divider::before,
.login-divider::after { content: ""; flex: 1; height: 1px; background: #e4dadb; }
.love-install-modern {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #e2d6d8;
  border-radius: 14px;
  background: rgba(255,255,255,.48);
  color: var(--login-ink);
  text-align: left;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.love-install-modern:hover { background: #fff; border-color: #cdbabd; transform: translateY(-1px); }
.install-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--login-blush); color: var(--login-wine); font-size: 17px; }
.love-install-modern > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.love-install-modern b { font-size: 11px; }
.love-install-modern small { color: var(--login-muted); font-size: 9px; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 0 0; color: #a29498; font-size: 9px; }
.login-security span { width: 6px; height: 6px; border-radius: 50%; background: #70a47c; box-shadow: 0 0 0 4px rgba(112,164,124,.1); }

.login-credits {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  color: #a4969a;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.login-credits a { color: #8b747c; text-decoration: none; transition: color .2s ease; }
.login-credits a:hover { color: var(--login-berry); }

.love-login-page :focus-visible { outline: 2px solid var(--login-gold); outline-offset: 3px; }

@keyframes login-copy-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes access-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes gallery-main-in { from { opacity: 0; transform: translate3d(0,45px,0) rotate(-10deg) scale(.92); } to { opacity: 1; transform: translate3d(var(--card-x,0),var(--card-y,0),0) rotate(var(--card-r)); } }
@keyframes gallery-top-in { from { opacity: 0; transform: translate3d(35px,-25px,0) rotate(12deg) scale(.9); } to { opacity: 1; transform: translate3d(var(--card-x,0),var(--card-y,0),0) rotate(var(--card-r)); } }
@keyframes gallery-bottom-in { from { opacity: 0; transform: translate3d(40px,35px,0) rotate(5deg) scale(.9); } to { opacity: 1; transform: translate3d(var(--card-x,0),var(--card-y,0),0) rotate(var(--card-r)); } }
@keyframes gallery-breathe { 0%,100% { box-shadow: 0 35px 80px -25px rgba(0,0,0,.72); } 50% { box-shadow: 0 46px 90px -20px rgba(0,0,0,.82); } }
@keyframes seal-in { from { opacity: 0; transform: scale(.65) rotate(-15deg); } to { opacity: 1; transform: none; } }
@keyframes seal-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes login-grain { 0% { transform: translate(0,0); } 25% { transform: translate(2%,-1%); } 50% { transform: translate(-1%,2%); } 75% { transform: translate(1%,1%); } }
@keyframes login-spin { to { transform: rotate(405deg); } }

@media (max-width: 1250px) {
  .login-experience { grid-template-columns: minmax(0, 1.25fr) minmax(410px, .9fr); }
  .login-showcase { padding-left: 42px; padding-right: 42px; }
  .showcase-copy { width: 48%; }
  .showcase-copy h1 { font-size: clamp(50px, 5.6vw, 72px); }
  .login-gallery { left: 43%; right: 0; }
  .gallery-main { width: 44%; }
  .gallery-top { right: -2%; }
  .gallery-bottom { right: -3%; }
  .login-access { padding-left: 42px; padding-right: 42px; }
}

@media (max-width: 980px) {
  .login-experience { grid-template-columns: minmax(0, 1fr) minmax(390px, .86fr); }
  .login-showcase { padding: 30px; }
  .login-instagram { padding: 9px 11px; font-size: 9px; }
  .showcase-copy { width: 70%; align-self: end; padding-bottom: 13vh; }
  .showcase-copy h1 { font-size: clamp(46px, 6.5vw, 64px); }
  .showcase-lead { max-width: 340px; }
  .showcase-pills, .showcase-footer { display: none; }
  .login-gallery { inset: 14% -6% 5% 36%; opacity: .78; }
  .gallery-main { width: 62%; height: 63%; top: 2%; left: 18%; filter: brightness(.7); }
  .gallery-top { display: none; }
  .gallery-bottom { width: 48%; height: 36%; right: 0; bottom: 1%; filter: brightness(.74); }
  .gallery-seal { width: 84px; height: 84px; bottom: 4%; }
  .gallery-seal span { display: none; }
  .login-access { padding-left: 32px; padding-right: 32px; }
}

@media (max-width: 760px) {
  .login-experience { display: block; min-height: 100svh; }
  .login-showcase {
    display: block;
    min-height: 290px;
    height: 34svh;
    max-height: 350px;
    padding: 24px;
    background:
      linear-gradient(90deg, rgba(36,5,16,.96) 0%, rgba(54,10,24,.82) 50%, rgba(54,10,24,.42) 100%),
      url('love-fachada.webp') center 57% / cover;
  }
  .login-showcase::after { right: -30px; bottom: -10px; font-size: 170px; }
  .login-instagram { background: rgba(35,3,14,.28); }
  .showcase-copy { position: absolute; left: 24px; bottom: 25px; width: calc(100% - 48px); padding: 0; }
  .showcase-kicker { margin-bottom: 11px; font-size: 8px; }
  .showcase-copy h1 { font-size: clamp(38px, 12vw, 54px); line-height: .86; }
  .showcase-copy h1 br { display: none; }
  .showcase-lead, .login-gallery { display: none; }
  .login-access {
    min-height: auto;
    padding: 40px 24px 22px;
    border-radius: 26px 26px 0 0;
    margin-top: -18px;
    box-shadow: 0 -18px 45px -34px rgba(16,0,5,.75);
  }
  .login-access::before { display: none; }
  .login-access-inner { width: min(100%, 470px); }
  .access-heading { margin-bottom: 27px; }
  .access-heading h2 { font-size: 44px; }
  .login-credits { width: min(100%, 470px); margin: 30px auto 0; }
}

@media (max-width: 430px) {
  .login-showcase { min-height: 255px; height: 30svh; padding: 20px; }
  .login-wordmark { font-size: 39px; }
  .login-instagram { padding: 8px 10px; letter-spacing: .02em; }
  .showcase-copy { left: 20px; bottom: 25px; width: calc(100% - 40px); }
  .showcase-copy h1 { font-size: 40px; }
  .login-access { padding: 35px 18px 20px; }
  .captcha-modern { grid-template-columns: minmax(98px,1fr) 40px minmax(86px,.8fr); gap: 6px; }
  .captcha-modern .captcha-refresh { width: 40px; }
  .login-credits { align-items: flex-start; flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .love-login-page *,
  .love-login-page *::before,
  .love-login-page *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
/* rodapé da página de login (fica colado no fim da tela, fora do card) */
.site-foot { align-self: end; padding-top: 26px; }
.site-foot .ritz { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: rgba(255,255,255,.92); text-shadow: 0 1px 8px rgba(0,0,0,.65); }
.site-foot .ritz:hover { color: #fff; }
.site-foot img { width: 62px; height: 62px; flex: 0 0 auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }
.site-foot .txt { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.4; }
.site-foot .txt b { font-size: 13px; font-weight: 600; }
.site-foot .txt span { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: rgba(255,255,255,.75); }
.site-foot .ritz:hover .txt span { color: #fff; }

/* ---------- PDV ---------- */
.pdv { display: grid; grid-template-columns: 1fr 372px; gap: 18px; }
@media (max-width: 1080px){ .pdv { grid-template-columns: 1fr; } }
.scanrow { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.scanbox { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1.5px solid var(--rose); border-radius: 12px; padding: 11px 14px; box-shadow: 0 0 0 4px var(--rose-soft); }
.scanbox svg { width: 20px; height: 20px; color: var(--rose); }
.scanbox input { border: 0; outline: 0; background: none; font-size: 15px; color: var(--ink); flex: 1; font-family: var(--mono); }
.scanbox input::placeholder { color: var(--faint); font-family: var(--sans); }
.vendsel { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.vendsel select { font-family: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--ink); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
.prod { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px; color: var(--pdv-card-text); transition: border-color .12s, transform .08s, box-shadow .12s; position: relative; overflow: hidden; }
.prod:hover { border-color: var(--rose); box-shadow: var(--shadow); transform: translateY(-1px); }
.prod .thumb { height: 66px; border-radius: 9px; background: linear-gradient(135deg, var(--panel-2), var(--rose-soft)); display: grid; place-items: center; margin-bottom: 10px; }
.prod .thumb svg { width: 26px; height: 26px; color: var(--rose); opacity: .7; }
.prod .nm { font-size: 13.5px; font-weight: 600; line-height: 1.25; color: var(--pdv-card-text); }
.prod .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.prod .pr { font-weight: 720; font-size: 15px; color: var(--pdv-card-text); }
.prod .tag-c { position: absolute; top: 9px; right: 9px; }
.prod .est { font-family: var(--mono); font-size: 10.5px; color: var(--pdv-card-muted); }
.prod .est.low { color: var(--warn); }

.cart { display: flex; flex-direction: column; position: sticky; top: 86px; align-self: start; max-height: calc(100vh - 108px); }
.cart .ch { padding: 15px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.cart .ch h3 { font-size: 15px; }
.cart .lines { padding: 8px 10px; overflow-y: auto; flex: 1; min-height: 70px; }
.cart .empty { color: var(--faint); text-align: center; font-size: 13px; padding: 26px 10px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 7px 10px; padding: 10px 8px; border-radius: 9px; align-items: center; }
.line:hover { background: var(--panel-2); }
.line .ln { grid-column: 1; font-size: 13.5px; font-weight: 580; }
.line .lp { grid-column: 2; font-weight: 640; font-size: 13.5px; text-align: right; }
.line .lqty { grid-column: 1; display: flex; align-items: center; gap: 9px; }
.line .lm { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.line .rm { grid-column: 2; justify-self: end; align-self: center; border: 0; background: none; color: var(--faint); font-size: 16px; padding: 0 2px; line-height: 1; }
.line .rm:hover { color: var(--rose-deep); }
.qstep { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--panel); }
.qbtn { width: 26px; height: 26px; border: 0; background: var(--panel-2); color: var(--ink); font-size: 16px; line-height: 1; font-weight: 600; display: grid; place-items: center; }
.qbtn:hover { background: var(--rose-soft); color: var(--rose-deep); }
.qinput { width: 36px; height: 26px; border: 0; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: center; font-family: var(--mono); font-size: 13px; background: var(--panel); color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.qinput::-webkit-outer-spin-button, .qinput::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.campaign { margin: 4px 12px; padding: 9px 12px; border-radius: 10px; background: var(--money-soft); border: 1px dashed #9CC9B2; border-color: color-mix(in srgb, var(--money) 40%, transparent); font-size: 12.5px; color: var(--money); font-weight: 560; }
.totals { padding: 13px 17px; border-top: 1px solid var(--line); }
.trow { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; padding: 3px 0; color: var(--muted); }
.trow.big { font-size: 21px; font-weight: 760; color: var(--ink); padding-top: 9px; margin-top: 5px; border-top: 1px solid var(--line); }
.trow input.mini { width: 90px; text-align: right; font-family: var(--mono); font-size: 13px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); }
.split { margin: 10px 17px 0; padding: 11px 13px; border-radius: 10px; background: var(--consign-soft); font-size: 12.5px; display: none; }
.split.show { display: block; }
.split .sr { display: flex; justify-content: space-between; padding: 2px 0; color: var(--consign); }
.split .sr b { font-weight: 680; }
.split .st { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--consign); opacity: .8; margin-bottom: 4px; }
.comm { margin: 8px 17px 0; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }
.comm b { color: var(--gold); }
.checkout { padding: 14px 17px 17px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- PDV — layout largo (itens à esquerda, total à direita) ---------- */
.pdv-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; align-items: start; }
.pdv-col-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pdv-col-side { min-width: 0; }

.pdv-top { padding: 18px 20px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,300px); gap: 14px 22px; align-items: start; }
.pdv-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pdv-lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pdv-cliente { display: flex; gap: 9px; align-items: center; }
.pdv-cliente input { flex: 1; min-width: 0; font-family: inherit; font-size: 16px; padding: 12px 15px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--ink); }
.pdv-cliente input:focus { outline: 2px solid var(--rose-soft); border-color: var(--rose); }
.pdv-iconbtn { border: 1px solid var(--line-2); background: var(--panel); color: var(--rose); width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; }
.pdv-iconbtn svg { width: 21px; height: 21px; }
.pdv-iconbtn:hover { border-color: var(--rose); background: var(--rose-soft); }
.pdv-iconbtn:disabled { opacity: .38; cursor: not-allowed; background: var(--panel); border-color: var(--line-2); }
.pdv-top select { width: 100%; font-family: inherit; font-size: 15.5px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--ink); }
.pdv-top select:focus { outline: 2px solid var(--rose-soft); border-color: var(--rose); }

/* campo de bipar/buscar — largura total, maior */
.pdv-scan { position: relative; width: 100%; min-width: 0; }
.scanbox-lg { padding: 15px 18px; border-radius: 14px; }
.scanbox-lg svg { width: 24px; height: 24px; }
.scanbox-lg input { font-size: 18px; }

/* lista de itens (esquerda) */
.pdv-itens .ch { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.pdv-itens .ch h3 { font-size: 18px; }
.pdv-itens .lines { padding: 8px 14px; }
.pdv-itens .empty { color: var(--faint); text-align: center; font-size: 15px; padding: 40px 12px; }

/* item: quantidade na frente do nome */
.pdv-itens .line { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; gap: 2px 16px; align-items: center; padding: 13px 8px; border-radius: 10px; }
.pdv-itens .line:hover { background: var(--panel-2); }
.pdv-itens .line .qstep { grid-column: 1; }
.pdv-itens .line .ln { grid-column: 2; display: flex; flex-direction: column; gap: 2px; font-size: 15.5px; font-weight: 580; }
.pdv-itens .line .lm { font-size: 12.5px; color: var(--faint); font-family: var(--mono); font-weight: 400; }
.pdv-itens .line .lp { grid-column: 3; font-weight: 660; font-size: 16px; text-align: right; white-space: nowrap; }
.pdv-itens .line .rm { grid-column: 4; justify-self: end; align-self: center; border: 0; background: none; color: var(--faint); font-size: 18px; line-height: 1; padding: 0 2px; }
.pdv-itens .line .rm:hover { color: var(--rose-deep); }
.pdv-itens .qbtn { width: 32px; height: 32px; font-size: 19px; }
.pdv-itens .qinput { width: 44px; height: 32px; font-size: 15px; }

/* resumo/checkout (direita) — fixo ao rolar */
.pdv-resumo { position: sticky; top: 86px; overflow: hidden; }
.pdv-resumo .campaign { margin: 14px 16px 0; font-size: 13px; }
.pdv-resumo .totals { padding: 16px 18px; border-top: 0; }
.pdv-resumo .trow { font-size: 14.5px; padding: 4px 0; }
.pdv-resumo .trow.big { font-size: 27px; padding-top: 12px; }
.pdv-resumo .trow input.mini { width: 104px; font-size: 14px; padding: 7px 10px; }
.pdv-resumo .comm { margin: 8px 18px 0; font-size: 13.5px; }
.pdv-resumo .checkout { padding: 14px 18px 18px; gap: 10px; }
.pdv-resumo .checkout label.f { font-size: 13px; }
.pdv-resumo .checkout select.f { font-size: 15.5px; padding: 11px 13px; }
.pdv-resumo .checkout .btn { font-size: 16px; padding: 14px 16px; }

@media (max-width: 980px){
  .pdv-grid { grid-template-columns: 1fr; }
  .pdv-top { grid-template-columns: 1fr; }
  .pdv-resumo { position: static; }
}

/* overlay de sucesso */
.overlay { position: fixed; inset: 0; background: rgba(20,12,15,.45); display: none; place-items: center; z-index: 50; padding: 20px; }
.overlay.show { display: grid; }
.overlay .box { position: relative; width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; text-align: center; }
.overlay .overlay-x { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--faint); font-size: 27px; line-height: 1; }
.overlay .overlay-x:hover { background: var(--panel-2); color: var(--ink); }
.overlay .overlay-x:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.overlay .big-ok { width: 54px; height: 54px; border-radius: 50%; background: var(--money-soft); color: var(--money); display: grid; place-items: center; margin: 0 auto 14px; font-size: 26px; }
.overlay .sumline { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); padding: 3px 0; }
.overlay .sumline.b { font-size: 17px; font-weight: 720; color: var(--ink); border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }

/* ---------- modais ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(18,10,13,.55); display: none; place-items: center; z-index: 60; padding: 18px; }
.modal-bg.show { display: grid; }
.modal { width: 100%; max-width: 430px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); max-height: 92vh; overflow-y: auto; }
.modal.wide { max-width: 640px; }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.modal .mh h3 { font-size: 16px; }
.modal .mh .x { border: 0; background: none; color: var(--faint); font-size: 24px; line-height: 1; padding: 0 4px; }
.modal .mh .x:hover { color: var(--ink); }
.modal .mb { padding: 18px 20px; display: flex; flex-direction: column; gap: 13px; }
.modal .mf { padding: 14px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.grid2c { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3c { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.fhint { font-size: 12px; margin-top: 5px; min-height: 1px; }
.fhint.ok { color: var(--money); } .fhint.bad { color: var(--danger); } .fhint.warn { color: var(--warn); }
.pay-total { background: var(--rose-soft); color: var(--rose-deep); border-radius: 12px; padding: 13px 16px; text-align: center; }
.pay-total .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.pay-total .v { font-size: 27px; font-weight: 760; margin-top: 2px; }
.troco-box { background: var(--money-soft); color: var(--money); border-radius: 12px; padding: 11px 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.troco-box .v { font-size: 22px; font-weight: 780; }
.cred-preview { display: flex; flex-direction: column; gap: 2px; max-height: 168px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; }
.cred-preview .row { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; font-size: 13px; color: var(--muted); }
.cred-preview .row:nth-child(odd) { background: var(--line); border-radius: 6px; }
.cred-preview .row span:last-child { color: var(--ink); font-weight: 600; }
.linkbtn { border: 0; background: none; cursor: pointer; font-size: 12px; text-decoration: underline; font-family: inherit; padding: 0; }
.pg-status { text-align: center; font-weight: 640; font-size: 14px; padding: 9px; border-radius: 10px; background: var(--line); color: var(--muted); }
.pg-status.ok { background: var(--money-soft); color: var(--money); }
.pg-lista-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; margin-bottom: 8px; font-size: 13.5px; }
.pg-lista-item .who { display: flex; flex-direction: column; }
.pg-lista-item .who small { color: var(--faint); font-size: 11.5px; }
.pg-lista-item .amt { margin-left: auto; font-weight: 640; }
.pg-lista-item .rm { border: 0; background: none; color: var(--faint); font-size: 19px; line-height: 1; cursor: pointer; padding: 0 2px; }
.pg-lista-item .rm:hover { color: var(--bad, #e5484d); }
.scanwrap { position: relative; flex: 1; min-width: 240px; }
.search-results { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; display: none; }
.search-results.show { display: block; }
.sr-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sr-item:hover { background: var(--rose-soft); }
.sr-item:last-child { border-bottom: 0; }
.sr-item .nm { font-size: 13.5px; font-weight: 560; }
.sr-item .mt { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.iconbtn { border: 1px solid var(--line-2); background: var(--panel); color: var(--rose); width: 38px; height: 38px; border-radius: 10px; font-size: 20px; line-height: 1; flex-shrink: 0; }
.iconbtn:hover { border-color: var(--rose); background: var(--rose-soft); }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(86vw, 330px);
    height: 100dvh;
    overflow: hidden;
    box-shadow: 14px 0 42px rgba(25, 15, 18, .22);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .24s ease, visibility 0s linear .24s;
  }
  body.menu-open { overflow: hidden; }
  body.menu-open .side { transform: translateX(0); visibility: visible; transition: transform .24s ease; }
  .brand { padding: 18px 18px 16px; }
  .brand .logo-badge { font-size: 21px; padding: 10px 15px 12px; }
  nav.mainnav { padding: 10px 12px 18px; overflow-y: auto; overscroll-behavior: contain; }
  .nav-lbl { display: block; padding-top: 16px; }
  .navbtn { min-height: 46px; padding: 11px 12px; font-size: 15px; }
  .side .foot { display: flex; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .menu-toggle, .menu-close { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--panel); color: var(--ink); }
  .menu-toggle svg, .menu-close svg { width: 22px; height: 22px; }
  .menu-close { position: absolute; top: 14px; right: 14px; background: var(--panel-2); color: var(--muted); }
  .menu-toggle:focus-visible, .menu-close:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
  .menu-backdrop { position: fixed; inset: 0; z-index: 70; width: 100%; height: 100%; border: 0; background: rgba(27, 17, 20, .48); opacity: 0; visibility: hidden; transition: opacity .24s ease, visibility 0s linear .24s; }
  body.menu-open .menu-backdrop { display: block; opacity: 1; visibility: visible; transition: opacity .24s ease; }
  .topbar { padding: 10px 16px; min-height: 64px; }
  .pagetitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .loja { font-size: 12px; }
  .content { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .side, .menu-backdrop { transition: none !important; }
}

/* ---------- dashboard de inteligência ---------- */
.dashboard-intel { display: flex; flex-direction: column; gap: 18px; max-width: 1680px; margin: 0 auto; }
.dash-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 2px 2px 4px; }
.dash-heading h1 { font-family: var(--serif); font-size: clamp(29px, 3vw, 42px); font-weight: 500; line-height: 1.08; margin: 5px 0 7px; letter-spacing: -.035em; }
.dash-heading p { color: var(--muted); margin: 0; font-size: 13.5px; }
.dash-status { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 12px; color: var(--muted); font-size: 11.5px; box-shadow: var(--shadow-sm); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--money); box-shadow: 0 0 0 4px var(--money-soft); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 17px 18px 16px; min-width: 0; position: relative; overflow: hidden; }
.metric-card.featured { border-color: color-mix(in srgb, var(--rose) 28%, var(--line)); background: linear-gradient(145deg, var(--panel) 42%, var(--rose-soft)); }
.metric-card.featured::after { content: ""; position: absolute; width: 86px; height: 86px; border: 18px solid color-mix(in srgb, var(--rose) 9%, transparent); border-radius: 50%; right: -42px; bottom: -44px; }
.metric-button { display: block; width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.metric-button:hover { border-color: color-mix(in srgb, var(--rose) 50%, var(--line)); transform: translateY(-1px); box-shadow: var(--shadow); }
.metric-button:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
.metric-button .metric-tag::after { content: "Ver dias"; margin-left: 5px; color: var(--rose); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.metric-tag { letter-spacing: .04em; font-size: 9px; border: 1px solid var(--line); background: var(--panel-2); padding: 2px 6px; border-radius: 999px; }
.metric-card > strong { display: block; font-size: clamp(25px, 2.25vw, 34px); line-height: 1; letter-spacing: -.04em; margin: 15px 0 13px; font-variant-numeric: tabular-nums; }
.metric-comparisons { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; color: var(--muted); font-size: 11.5px; }
.delta { font-weight: 620; }
.delta.up { color: var(--money); }
.delta.down { color: var(--danger); }
.delta.neutral { color: var(--muted); }

.sales-days-modal { max-width: 760px; }
.sales-days-modal .mh { align-items: flex-start; }
.sales-days-modal .mh h3 { margin-bottom: 3px; }
.sales-days-modal .mh span { color: var(--muted); font-size: 12px; }
.sales-days-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.sales-days-summary > div { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); padding: 10px 12px; }
.sales-days-summary span { display: block; color: var(--muted); font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.sales-days-summary strong { display: block; margin-top: 5px; font-size: 15px; font-variant-numeric: tabular-nums; }
.sales-days-tablewrap { max-height: 56vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.sales-days-table th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.sales-days-table td:first-child strong, .sales-days-table td:first-child span { display: block; }
.sales-days-table td:first-child span { color: var(--faint); font-size: 10.5px; margin-top: 2px; }
.sales-days-table .muted-day td { color: var(--faint); }
.sales-days-table .muted-day td:first-child strong { color: var(--muted); }

.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .85fr); gap: 14px; align-items: stretch; }
.section-head { min-height: 71px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: 16px; font-weight: 680; margin-top: 3px; }
.section-head p { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.chart-card { min-width: 0; overflow: hidden; }
.chart-legend { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; justify-content: flex-end; color: var(--muted); font-size: 10.5px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-legend i { width: 19px; height: 3px; border-radius: 4px; background: var(--faint); }
.chart-legend i.current { background: var(--rose); }
.chart-legend i.previous { background: var(--gold); }
.chart-legend i.year { height: 2px; background: repeating-linear-gradient(90deg, var(--faint) 0 4px, transparent 4px 7px); }
.chart-wrap { height: 278px; padding: 10px 12px 0 4px; }
.chart-wrap canvas { display: block; max-width: 100%; }
.chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 11px 18px; color: var(--muted); font-size: 11.5px; }
.chart-foot strong { color: var(--ink); font-size: 12.5px; }

.intelligence-card { overflow: hidden; display: flex; flex-direction: column; }
.local-badge { border: 1px solid color-mix(in srgb, var(--money) 35%, transparent); color: var(--money); background: var(--money-soft); font-family: var(--mono); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; border-radius: 999px; padding: 4px 8px; white-space: nowrap; }
.insight-list { padding: 5px 17px; flex: 1; }
.insight { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.insight:last-child { border-bottom: 0; }
.insight-number { font-family: var(--mono); font-size: 10px; color: var(--faint); padding-top: 3px; }
.insight.positive .insight-number { color: var(--money); }
.insight.attention .insight-number { color: var(--warn); }
.insight h3 { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.insight p { color: var(--muted); font-size: 11.5px; line-height: 1.45; margin: 0; }
.intelligence-note { margin: 0; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--panel-2); color: var(--faint); font-size: 10.5px; line-height: 1.4; }

.product-grid { display: grid; grid-template-columns: 1.15fr 1.15fr .9fr; gap: 14px; align-items: stretch; }
.champion-card, .ranking-card, .category-card { overflow: hidden; }
.trophy { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--gold); }
.champion-main { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 21px 20px 18px; }
.category-label { display: inline-block; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--rose); background: var(--rose-soft); border-radius: 999px; padding: 3px 8px; }
.champion-main h3 { font-family: var(--serif); font-size: clamp(23px, 2.2vw, 31px); line-height: 1.1; margin: 9px 0 7px; font-weight: 500; }
.champion-main p { color: var(--muted); font-size: 12px; margin: 0; max-width: 360px; }
.penetration-ring { --ring: calc(var(--value) * 1%); width: 102px; aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(circle at center, var(--panel) 57%, transparent 58%), conic-gradient(var(--rose) var(--ring), var(--rose-soft) var(--ring)); }
.penetration-ring strong { font-size: 21px; line-height: 1; font-variant-numeric: tabular-nums; }
.penetration-ring span { color: var(--muted); font-size: 9px; margin-top: 3px; }
.champion-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: var(--panel-2); }
.champion-stats > div { padding: 11px 15px; border-right: 1px solid var(--line); }
.champion-stats > div:last-child { border-right: 0; }
.champion-stats span { display: block; color: var(--faint); font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.champion-stats strong { display: block; font-size: 13.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.least-chip { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); padding: 4px 8px; font-size: 9.5px; }
.rank-list { padding: 5px 17px; }
.rank-row { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-pos { color: var(--faint); font-family: var(--serif); font-size: 17px; font-style: italic; }
.rank-name, .rank-value { min-width: 0; }
.rank-name strong, .rank-name span, .rank-value strong, .rank-value span { display: block; }
.rank-name strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-name span, .rank-value span { color: var(--muted); font-size: 10.5px; }
.rank-value { text-align: right; font-variant-numeric: tabular-nums; }
.rank-value strong { font-size: 12.5px; }
.category-list { padding: 9px 17px 13px; }
.category-row { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(55px, .8fr) auto; gap: 9px; align-items: center; padding: 8px 0; }
.category-row > div:first-child strong, .category-row > div:first-child span { display: block; }
.category-row > div:first-child strong { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-row > div:first-child span { color: var(--faint); font-size: 9.5px; }
.category-row > b { font-size: 10.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.category-bar { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.category-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rose), var(--gold)); }
.empty-state { color: var(--muted); text-align: center; padding: 25px 18px !important; font-size: 12.5px; }

.stagnant-card, .recent-card { overflow: hidden; }
.stagnant-head { align-items: flex-end; }
.stagnant-filters { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.stagnant-filters button { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 6px 9px; font-size: 10.5px; transition: background .12s, color .12s, border-color .12s; }
.stagnant-filters button b { margin-left: 4px; color: var(--ink); }
.stagnant-filters button:hover, .stagnant-filters button.active { background: var(--rose-soft); border-color: color-mix(in srgb, var(--rose) 35%, var(--line)); color: var(--rose-deep); }
.stagnant-table td:first-child strong, .stagnant-table td:first-child span { display: block; }
.stagnant-table td:first-child span { color: var(--faint); font-size: 10.5px; margin-top: 2px; }
.stagnant-table tr[hidden] { display: none; }
.never { color: var(--danger); font-size: 11.5px; font-weight: 650; }
.age-pill { display: inline-block; border-radius: 999px; padding: 3px 7px; font-size: 10px; font-family: var(--mono); white-space: nowrap; }
.age-pill.range-7 { background: var(--money-soft); color: var(--money); }
.age-pill.range-15 { background: var(--gold-soft); color: var(--warn); }
.age-pill.range-30 { background: var(--danger-soft); color: var(--danger); }
.action-copy { color: var(--muted); font-size: 11.5px; max-width: 245px; }
.recent-card .section-head a { color: var(--rose); text-decoration: none; font-size: 11.5px; font-weight: 650; }
.recent-card tbody td { color: var(--muted); }
.recent-card tbody td strong, .recent-card tbody td:first-child { color: var(--ink); }

@media (max-width: 1320px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .category-card { grid-column: 1 / -1; }
  .category-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
}
@media (max-width: 1080px) {
  .analytics-grid { grid-template-columns: 1fr; }
  .insight-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .insight:nth-last-child(2) { border-bottom: 0; }
  .stagnant-head { align-items: flex-start; flex-direction: column; }
  .stagnant-filters { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .dash-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .dash-status { font-size: 10.5px; }
  .metric-grid, .product-grid { grid-template-columns: 1fr; }
  .category-card { grid-column: auto; }
  .category-list, .insight-list { display: block; }
  .insight:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .chart-card .section-head { align-items: flex-start; flex-direction: column; }
  .chart-legend { justify-content: flex-start; }
  .chart-wrap { height: 245px; }
  .sales-days-summary { grid-template-columns: 1fr; }
  .champion-main { grid-template-columns: 1fr; }
  .penetration-ring { width: 90px; }
  .champion-stats > div { padding: 10px 9px; }
  .section-head { min-height: 64px; }
}
@media (max-width: 480px) {
  .content { padding: 13px; }
  .dashboard-intel { gap: 12px; }
  .metric-card > strong { font-size: 27px; }
  .chart-foot { align-items: flex-start; flex-direction: column; gap: 3px; }
  .champion-stats { grid-template-columns: 1fr; }
  .champion-stats > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .champion-stats > div:last-child { border-bottom: 0; }
  .least-chip { display: none; }
}

/* Histórico compartilhado do cliente */
.cliente-history-link { border: 0; background: none; color: var(--ink); font: inherit; font-weight: 620; padding: 2px 0; cursor: pointer; text-align: left; }
.cliente-history-link:hover { color: var(--rose); text-decoration: underline; text-underline-offset: 3px; }
.cliente-history-link:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 3px; }
.modal.cliente-history-modal { max-width: 900px; }
.cliente-history-loading, .cliente-history-empty, .cliente-history-error { padding: 30px 14px; text-align: center; color: var(--muted); }
.cliente-history-error { color: var(--danger); }
.cliente-history-person { display: flex; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); }
.cliente-history-person h4 { margin: 0 0 5px; font-size: 17px; }
.cliente-history-contact { color: var(--muted); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.cliente-history-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; min-width: 330px; }
.cliente-history-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cliente-history-kpi .k { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.cliente-history-kpi .v { display: block; margin-top: 4px; font-weight: 720; font-size: 14px; }
.cliente-history-list { display: flex; flex-direction: column; gap: 9px; }
.cliente-history-sale { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.cliente-history-sale summary { list-style: none; display: grid; grid-template-columns: 120px 1fr 130px 110px; gap: 12px; align-items: center; padding: 13px 15px; cursor: pointer; }
.cliente-history-sale summary::-webkit-details-marker { display: none; }
.cliente-history-sale summary:hover { background: var(--panel-2); }
.cliente-history-sale .sale-date { font-weight: 650; font-size: 12.5px; }
.cliente-history-sale .sale-meta { color: var(--muted); font-size: 12px; }
.cliente-history-sale .sale-total { text-align: right; font-weight: 750; }
.cliente-history-sale .sale-status { text-align: right; }
.cliente-history-sale[open] summary { border-bottom: 1px solid var(--line); background: var(--panel-2); }
.cliente-history-items { padding: 5px 14px 12px; }
.cliente-history-items table { font-size: 12.5px; }
.cliente-history-items th { font-size: 9.5px; }
.cliente-history-items .item-name { min-width: 210px; font-weight: 560; }
.cliente-history-discount { text-align: right; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* Edição da ficha do cliente dentro do modal de histórico */
.cliente-history-head-actions { display: flex; align-items: center; gap: 10px; }
.cliente-history-edit-btn { padding: 8px 13px; font-size: 13px; white-space: nowrap; cursor: pointer; }
#cliente-history-modal.editing .cliente-history-edit-btn { border-color: var(--rose); color: var(--rose); }
#cliente-history-modal.editing .cliente-history-person { display: none; }
.cliente-history-form { padding: 16px 20px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.cliente-history-form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cliente-history-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; flex-wrap: wrap; }
.cliente-history-form-erro { margin-top: 12px; padding: 10px 13px; border-radius: 10px; font-size: 13px; background: var(--danger-soft); color: var(--danger); }

@media (max-width: 760px) {
  .cliente-history-person { flex-direction: column; }
  .cliente-history-kpis { min-width: 0; }
  .cliente-history-sale summary { grid-template-columns: 1fr auto; }
  .cliente-history-sale .sale-meta { grid-column: 1; }
  .cliente-history-sale .sale-total { grid-column: 2; grid-row: 1; }
  .cliente-history-sale .sale-status { grid-column: 2; grid-row: 2; }
  .cliente-history-form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .cliente-history-kpis { grid-template-columns: 1fr; }
  .modal-bg { padding: 8px; }
  .modal.cliente-history-modal { max-height: 96vh; }
  .cliente-history-edit-btn { padding: 7px 10px; font-size: 12px; }
  .cliente-history-form-grid { grid-template-columns: 1fr; }
  .cliente-history-form-foot { flex-direction: column; align-items: stretch; }
  .cliente-history-form-foot > div { justify-content: flex-end; }
}
