/* LiveShopping - panel styles */
:root {
  --brand: #0F5257; --brand-dark: #0B3F43; --brand-soft: #E7F0EF;
  --bg: #F6F7F5; --card: #FFFFFF; --line: #E6E8EB; --line-soft: #EEF0F2;
  --text: #1A1D1F; --muted: #6B7280;
  --ok: #15803D; --ok-bg: #E8F5EC; --wait: #B45309; --wait-bg: #FDF3E3; --bad: #B91C1C; --bad-bg: #FDECEC;
  --radius: 12px;
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--bg);
       color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .86em; }
code { background: var(--brand-soft); color: var(--brand-dark); padding: .1em .4em; border-radius: 5px; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; }
h3 { font-size: .95rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .82rem; }

/* layout */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner, main { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.topbar-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); margin-right: auto; }
.logo { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff; display: grid;
        place-items: center; font-weight: 700; font-size: .95rem; letter-spacing: -.02em; }
.brand b { display: block; font-size: 1.05rem; line-height: 1.1; }
.brand span { font-size: .76rem; color: var(--muted); }
.store-picker { display: flex; gap: .5rem; align-items: center; }
.store-picker select { min-width: 200px; }
nav.tabs { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; display: flex; gap: .25rem; overflow-x: auto;
           scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { padding: .7rem .85rem; text-decoration: none; color: var(--muted); white-space: nowrap;
             border-bottom: 2px solid transparent; font-weight: 500; }
nav.tabs a:hover { color: var(--text); }
nav.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
main { padding-top: 1.5rem; padding-bottom: 4rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-head p { margin: .35rem 0 0; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.card + .card, .stack > * + * { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; }
.kpi span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi b { display: block; font-size: 1.55rem; font-weight: 600; margin-top: .25rem; letter-spacing: -.01em; }

/* forms */
label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .3rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: #FBFBFA; border: 1px solid var(--line);
  border-radius: 8px; padding: .55rem .7rem; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.field { margin-bottom: .85rem; }
.hint { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.check input { width: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 500;
       border-radius: 8px; padding: .55rem .95rem; border: 1px solid var(--line); background: var(--card); color: var(--text);
       cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #CBD2D6; background: #FAFAF9; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--bad); }
.btn-sm { padding: .3rem .6rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .78rem; text-transform: uppercase;
     letter-spacing: .04em; padding: .65rem .8rem; border-bottom: 1px solid var(--line); background: #FAFAF9; white-space: nowrap; }
td { padding: .6rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.show-sm { display: none; }
tr.cancel td:not(.actions) { color: var(--muted); text-decoration: line-through; }
.editable td { padding: .3rem .35rem; }
.editable input { padding: .4rem .5rem; background: transparent; border-color: transparent; }
.editable input:hover { border-color: var(--line); }
.editable input:focus { background: #fff; border-color: var(--brand); }
.editable .del { width: 36px; text-align: center; }

/* pills & alerts */
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.wait { background: var(--wait-bg); color: var(--wait); }
.pill.cancel { background: #F1F2F4; color: var(--muted); }
.pill.low { background: var(--bad-bg); color: var(--bad); }
.flash { border-radius: 10px; padding: .7rem .95rem; margin-bottom: .6rem; font-size: .92rem; border: 1px solid; }
.flash.success { background: var(--ok-bg); border-color: #C6E8D2; color: #14532D; }
.flash.error { background: var(--bad-bg); border-color: #F5C9C9; color: #7F1D1D; }
.flash.warning { background: var(--wait-bg); border-color: #F3DDB5; color: #78350F; }
.flash.info { background: var(--brand-soft); border-color: #CFE2E0; color: var(--brand-dark); }
.problem { border-left: 3px solid var(--wait); background: var(--wait-bg); border-radius: 8px; padding: .6rem .8rem; margin-top: .5rem; }
.problem small { display: block; color: var(--wait); }
.format-banner { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; background: var(--brand-soft);
                 border-radius: 10px; padding: .6rem .9rem; margin-bottom: 1rem; color: var(--brand-dark); font-size: .9rem; }
.format-banner code { background: #fff; font-size: .95rem; }

/* help popover */
details.help { position: relative; }
details.help summary { list-style: none; cursor: pointer; }
details.help summary::-webkit-details-marker { display: none; }
details.help[open] .help-body { display: block; }
.help-body { display: none; position: absolute; right: 0; top: calc(100% + 6px); width: min(420px, 86vw); z-index: 20;
             background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
             box-shadow: 0 12px 32px rgba(16, 24, 40, .12); padding: 1rem 1.1rem; font-size: .9rem; }
.help-body p:first-child { margin-top: 0; }
.help-body ul { padding-left: 1.1rem; margin: .4rem 0; }
details.fold > summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; }
details.fold > summary::after { content: "+"; color: var(--muted); }
details.fold[open] > summary::after { content: "–"; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { margin-bottom: .8rem; }

/* checklist & steps */
.checklist > div { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line-soft); }
.checklist > div:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .4rem; flex: none; }
.dot.ok { background: #16A34A; } .dot.warn { background: #D97706; } .dot.fail { background: #DC2626; }
.checklist b { display: block; }
.checklist span { color: #4B5563; font-size: .88rem; }
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
ol.steps li { counter-increment: s; display: flex; gap: .8rem; margin-bottom: .75rem; }
ol.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft);
                      color: var(--brand); font-weight: 700; display: grid; place-items: center; flex: none; font-size: .85rem; }
.qr { width: 220px; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
pre.msg { white-space: pre-wrap; word-break: break-all; background: #FAFAF9; border: 1px solid var(--line); border-radius: 10px;
          padding: .9rem; font-size: .85rem; margin: 0; max-height: 360px; overflow: auto; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16A34A; margin-right: .35rem;
            animation: pulse 2s infinite; }
.live-dot.off { background: #9CA3AF; animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
tr.new td { animation: flashrow 2.5s ease-out; }
@keyframes flashrow { from { background: #FFF6CC; } to { background: transparent; } }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 380px; }
.login-card .brand { margin: 0 0 1.4rem; }

/* mobile */
@media (max-width: 760px) {
  :root { font-size: 15.5px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 1.2rem; }
  .topbar-inner { padding-top: .6rem; padding-bottom: .6rem; }
  .store-picker { width: 100%; }
  .store-picker select { flex: 1; min-width: 0; }
  main { padding-top: 1rem; }
  h1 { font-size: 1.35rem; }
  .hide-sm { display: none; }
  .help-body { right: auto; left: auto; position: fixed; left: 50%; transform: translateX(-50%); top: 120px; }
}

/* users & account */
.store-name { font-weight: 600; padding: .45rem .2rem; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-grid;
          place-items: center; font-size: .72rem; font-weight: 700; }
.user-menu summary { gap: .45rem; }
td.actions .help-body { text-align: left; }
@media (max-width: 760px) {
  .topbar-inner { gap: .6rem; }
  .brand { order: 0; }
  .user-menu { order: 1; }
  .store-picker { order: 2; }
  .show-sm { display: inline; }
  td, th { padding: .55rem .5rem; }
}

/* login tabs & buyer portal */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #F1F2EF; border-radius: 10px; padding: 4px; margin-bottom: 1.1rem; }
.seg a { text-align: center; padding: .5rem; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .92rem; }
.seg a.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.at-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #FBFBFA; }
.at-input span { padding: 0 .1rem 0 .7rem; color: var(--muted); font-weight: 600; }
.at-input input { border: none; background: transparent; padding-left: .25rem; }
.at-input:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.at-input input:focus { box-shadow: none; }
.center { text-align: center; }
main.narrow { max-width: 640px; }
.cart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.cart + .cart { margin-top: 1rem; }
.cart-store { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .4rem; }
.cart-store h2 { margin: 0; }
.cart-lines { list-style: none; padding: 0; margin: 0; }
.cart-lines li { display: flex; justify-content: space-between; gap: .8rem; padding: .75rem 0; border-top: 1px solid var(--line-soft); }
.cart-item { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.cart-right { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; white-space: nowrap; }
.cart-lines li.cancel .cart-item b { text-decoration: line-through; color: var(--muted); }
.strike { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .2rem; }
.cart-total b { font-size: 1.25rem; }
li.new { animation: flashrow 2.5s ease-out; }
.banner-link { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.banner-link input { width: auto; padding: .25rem .5rem; font-size: .82rem; background: #fff; }
@media (max-width: 760px) { .banner-link { margin-left: 0; width: 100%; } .banner-link input { flex: 1; } }
.size-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; padding: .8rem; background: #FAFAF9;
             border: 1px dashed var(--line); border-radius: 10px; }
.size-grid-title { width: 100%; font-size: .82rem; color: var(--muted); font-weight: 500; }
.size-cell { display: flex; flex-direction: column; align-items: center; gap: .25rem; margin: 0; width: 74px; }
.size-cell span { font-weight: 700; font-size: .95rem; }
.size-cell input { text-align: center; padding: .4rem; background: #fff; }

/* presenter mode */
body:has(.presenter) { background: #0E1416; }
.presenter { min-height: 100vh; color: #F3F5F4; padding: 0 1.25rem 2rem; max-width: 1400px; margin: 0 auto; }
.p-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; }
.p-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; }
.p-brand span { color: #8FA3A6; font-size: .85rem; }
.p-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.p-btn { background: #1B2427; color: #E6ECEB; border: 1px solid #2C383C; border-radius: 9px; padding: .5rem .9rem; font: inherit;
         font-size: .9rem; cursor: pointer; text-decoration: none; }
.p-btn.on { background: #14532D; border-color: #16A34A; }
.p-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1.2rem; }
.p-kpis div { background: #162023; border: 1px solid #243034; border-radius: 12px; padding: .7rem 1rem; }
.p-kpis span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8FA3A6; }
.p-kpis b { font-size: 1.5rem; }
.p-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.p-h { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #8FA3A6; margin: 0 0 .7rem; display: flex; gap: .5rem; align-items: center; }
.p-h em { font-style: normal; background: #DC2626; color: #fff; border-radius: 999px; padding: 0 .55rem; font-size: .8rem; }
.p-card { background: #1A1414; border: 2px solid #DC2626; border-radius: 16px; padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.p-card.changed { border-color: #F59E0B; background: #1D1810; }
.p-card.fresh { animation: pflash 1.2s ease-out 3; }
@keyframes pflash { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .8); } 100% { box-shadow: 0 0 0 18px rgba(220, 38, 38, 0); } }
.p-card-head { display: flex; justify-content: space-between; align-items: center; }
.p-badge { background: #DC2626; color: #fff; font-weight: 800; letter-spacing: .06em; padding: .25rem .7rem; border-radius: 8px; font-size: .9rem; }
.p-card.changed .p-badge { background: #F59E0B; color: #1A1200; }
.p-time { color: #8FA3A6; font-variant-numeric: tabular-nums; }
.p-item { margin: .7rem 0 .4rem; display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.p-item b { font-size: 2.6rem; letter-spacing: -.02em; line-height: 1; }
.p-item span { font-size: 1.2rem; color: #C9D3D2; }
.p-lbl { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: #8FA3A6; margin-top: .6rem; }
.p-who { font-size: 2rem; font-weight: 700; color: #4ADE80; line-height: 1.2; word-break: break-all; }
.p-who small { font-size: 1rem; color: #A7F3D0; font-weight: 500; }
.p-waiting { color: #D6DEDD; font-size: 1.05rem; }
.p-ok { margin-top: 1rem; width: 100%; background: #F3F5F4; color: #0E1416; border: none; border-radius: 10px; padding: .8rem;
        font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.p-ok:active { transform: scale(.99); }
.p-empty { border: 2px dashed #2C383C; border-radius: 16px; padding: 2rem 1.2rem; text-align: center; font-size: 1.2rem; color: #C9D3D2; }
.p-empty span { font-size: .9rem; color: #8FA3A6; }
.p-done { margin-top: 1rem; background: #162023; border-radius: 12px; padding: .8rem 1rem; color: #C9D3D2; }
.p-done summary { cursor: pointer; font-weight: 600; }
.p-done-row { padding: .45rem 0; border-top: 1px solid #243034; font-size: .95rem; }
.p-done-row span { color: #8FA3A6; }
.p-link { background: none; border: none; color: #8FA3A6; text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }
.p-list { background: #162023; border: 1px solid #243034; border-radius: 12px; padding: .3rem .9rem; }
.p-last, .p-sale { display: flex; gap: .6rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid #243034; }
.p-last:last-child, .p-sale:last-child { border-bottom: none; }
.p-last b { color: #FBBF24; font-size: 1.15rem; }
.p-last span, .p-sale span { color: #C9D3D2; }
.p-sale b { color: #F3F5F4; }
.p-sale small { margin-left: auto; color: #8FA3A6; }
.p-sale.new { animation: psale 2.5s ease-out; }
@keyframes psale { from { background: #14532D; } to { background: transparent; } }
.p-muted { color: #8FA3A6; padding: .6rem 0; font-size: .9rem; }
@media (max-width: 860px) {
  .p-grid { grid-template-columns: 1fr; }
  .p-kpis { grid-template-columns: repeat(2, 1fr); }
  .p-item b { font-size: 2rem; }
  .p-who { font-size: 1.6rem; }
}

/* buyer pix */
.pay-btn { margin-top: .9rem; padding: .75rem; font-size: 1rem; }
.pay-notice { margin-top: .8rem; background: var(--wait-bg); border: 1px solid #F3DDB5; color: #78350F; border-radius: 10px; padding: .65rem .85rem; font-size: .9rem; }
.pix-amount { font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; margin: .2rem 0 .6rem; }
.pix-items { list-style: none; padding: 0; margin: 0 0 .6rem; font-size: .92rem; }
.pix-items li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-top: 1px solid var(--line-soft); }
.pix-items span { white-space: nowrap; }
.pix-box { display: flex; gap: 1.2rem; align-items: flex-start; margin-top: 1rem; flex-wrap: wrap; }
.pix-box .qr { width: 210px; }
.pix-steps { flex: 1; min-width: 200px; font-size: .92rem; }
textarea.mono { font-size: .78rem; word-break: break-all; resize: none; }
