/* AppGestor — TIX PDV 5000VS */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
[data-theme="dark"] {
  --bg-0: #070b12;
  --bg-1: #0c121c;
  --bg-2: #121a28;
  --bg-3: #182235;
  --surface: rgba(18, 26, 40, 0.88);
  --surface-strong: rgba(22, 32, 50, 0.96);
  --stroke: rgba(0, 163, 255, 0.2);
  --stroke-soft: rgba(255, 255, 255, 0.1);
  --text: #e8eef8;
  --text-dim: #8fa3bf;
  --text-mute: #667891;
  --blue: #00a3ff;
  --blue-2: #3dc4ff;
  --cyan: #5ef0ff;
  --silver: #c8d0dc;
  --ok: #2dd4a8;
  --warn: #f5b942;
  --danger: #ff6b7a;
  --danger-bg: rgba(255, 107, 122, 0.14);
  --danger-border: rgba(255, 107, 122, 0.28);
  --danger-text: #ffb0b8;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --glow: 0 0 28px rgba(0, 163, 255, 0.28);
  --nav-bg: rgba(8, 12, 20, 0.9);
  --splash-a: rgba(0, 163, 255, 0.18);
  --splash-b: rgba(94, 240, 255, 0.08);
  --splash-grad: linear-gradient(165deg, #05080f 0%, #0a1220 45%, #070b12 100%);
  --login-grad: linear-gradient(180deg, #070b12 0%, #0b1320 100%);
  --app-glow: rgba(0, 163, 255, 0.12);
  --total-grad: linear-gradient(135deg, rgba(0, 163, 255, 0.2), rgba(18, 26, 40, 0.96));
  --empty-border: rgba(255, 255, 255, 0.12);
  --empty-bg: rgba(255, 255, 255, 0.03);
  --modal-scrim: rgba(3, 6, 12, 0.72);
  --chip-bg: rgba(0, 163, 255, 0.1);
  --theme-btn-bg: rgba(255, 255, 255, 0.06);
  --input-bg: rgba(7, 11, 18, 0.72);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 76px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-0: #f3f6fb;
  --bg-1: #eef3fa;
  --bg-2: #ffffff;
  --bg-3: #e8eef8;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --stroke: rgba(0, 132, 214, 0.28);
  --stroke-soft: rgba(15, 35, 60, 0.1);
  --text: #122033;
  --text-dim: #5a6f8a;
  --text-mute: #7a8da6;
  --blue: #0088d6;
  --blue-2: #0099ef;
  --cyan: #0077c2;
  --silver: #4a5d75;
  --ok: #0f9f78;
  --warn: #c98a10;
  --danger: #d64555;
  --danger-bg: rgba(214, 69, 85, 0.1);
  --danger-border: rgba(214, 69, 85, 0.24);
  --danger-text: #c0394a;
  --shadow: 0 16px 40px rgba(18, 40, 70, 0.12);
  --glow: 0 0 22px rgba(0, 153, 239, 0.18);
  --nav-bg: rgba(255, 255, 255, 0.92);
  --splash-a: rgba(0, 153, 239, 0.16);
  --splash-b: rgba(0, 163, 255, 0.08);
  --splash-grad: linear-gradient(165deg, #eaf2fb 0%, #f7fafe 55%, #eef4fb 100%);
  --login-grad: linear-gradient(180deg, #eaf2fb 0%, #f5f8fc 100%);
  --app-glow: rgba(0, 153, 239, 0.1);
  --total-grad: linear-gradient(135deg, rgba(0, 153, 239, 0.14), #ffffff);
  --empty-border: rgba(15, 35, 60, 0.14);
  --empty-bg: rgba(255, 255, 255, 0.7);
  --modal-scrim: rgba(18, 32, 52, 0.42);
  --chip-bg: rgba(0, 153, 239, 0.1);
  --theme-btn-bg: rgba(15, 35, 60, 0.06);
  --input-bg: #f7fafd;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s ease, color 0.25s ease;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a { color: var(--blue-2); text-decoration: none; }

.hidden { display: none !important; }

.screen {
  min-height: 100dvh;
  width: 100%;
  position: relative;
}

/* Theme toggle */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--theme-btn-bg);
  border: 1px solid var(--stroke-soft);
  color: var(--blue-2);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--stroke);
  background: var(--chip-bg);
}

.theme-toggle:active { transform: scale(0.96); }

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

/* Splash */
#screen-splash {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 80% 50% at 50% 20%, var(--splash-a), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 90%, var(--splash-b), transparent 50%),
    var(--splash-grad);
  overflow: hidden;
}

#screen-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 163, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 163, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, black 20%, transparent 70%);
  pointer-events: none;
}

.splash-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  animation: splashIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.splash-logo {
  width: min(86vw, 340px);
  height: auto;
  filter: drop-shadow(0 12px 40px rgba(0, 163, 255, 0.35));
  animation: logoFloat 3.2s ease-in-out infinite;
}

.splash-tag {
  margin: 0;
  color: var(--text-dim);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 500;
}

.splash-loader {
  width: 120px;
  height: 4px;
  border-radius: 999px;
  background: var(--stroke-soft);
  overflow: hidden;
  margin-top: 0.5rem;
}

.splash-loader > span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: var(--glow);
  animation: loadSlide 1.1s ease-in-out infinite;
}

@keyframes splashIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes loadSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* Login */
#screen-login {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, var(--splash-a), transparent 55%),
    var(--login-grad);
}

.login-panel {
  width: min(100%, 420px);
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 2rem 1.6rem 1.6rem;
  animation: panelIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
}

.login-theme {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

.login-brand img {
  width: min(78%, 280px);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 163, 255, 0.3));
}

.login-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.login-brand p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 28ch;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.field label {
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--silver);
  letter-spacing: 0.02em;
}

.field input,
.field textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke-soft);
  background: var(--input-bg);
  padding: 0.95rem 1.1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field textarea {
  min-height: 72px;
  resize: vertical;
  border-radius: var(--radius-md);
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(0, 163, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 163, 255, 0.12), var(--glow);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-mute);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.2s, opacity 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  width: 100%;
  color: #041018;
  background: linear-gradient(135deg, var(--blue-2) 0%, var(--blue) 55%, #0080d0 100%);
  box-shadow: 0 10px 28px rgba(0, 163, 255, 0.3);
}

[data-theme="light"] .btn-primary {
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 136, 214, 0.28);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 34px rgba(0, 163, 255, 0.42);
}

.btn-ghost {
  background: var(--theme-btn-bg);
  border: 1px solid var(--stroke-soft);
  color: var(--text);
  border-radius: 999px;
}

.btn-ghost:hover {
  border-color: var(--stroke);
  background: var(--chip-bg);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  border-radius: 999px;
}

.btn-sm {
  min-height: 38px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.login-error {
  min-height: 1.25rem;
  margin: 0 0 0.85rem;
  color: var(--danger);
  font-size: 0.88rem;
  text-align: center;
}

.login-foot {
  margin-top: 1.25rem;
  text-align: center;
  color: var(--text-mute);
  font-size: 0.75rem;
}

/* App shell */
#screen-app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 30% at 50% 0%, var(--app-glow), transparent 55%),
    var(--bg-0);
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--bg-0) 78%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--stroke-soft);
}

.app-top-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.app-top-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 14px;
}

.app-top-brand .titles {
  min-width: 0;
}

.app-top-brand .titles strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.app-top-brand .titles span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34vw;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--chip-bg);
  border: 1px solid var(--stroke);
  color: var(--blue-2);
  white-space: nowrap;
}

.sync-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 70%, transparent);
}

.sync-chip.is-offline .dot {
  background: var(--warn);
  box-shadow: 0 0 8px color-mix(in srgb, var(--warn) 70%, transparent);
}

.sync-chip.is-syncing .dot {
  background: var(--blue);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.app-main {
  flex: 1;
  padding: 1rem 1rem 1.25rem;
  width: min(720px, 100%);
  margin: 0 auto;
}

.page { display: none; animation: pageIn 0.35s ease both; }
.page.is-active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-head h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-head p {
  margin: 0.3rem 0 0;
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.35;
}

.page-head .btn {
  width: auto;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  margin-bottom: 0.85rem;
}

.search-box input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--stroke-soft);
  background: var(--surface-strong);
  padding: 0.95rem 1.15rem 0.95rem 2.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: rgba(0, 163, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(0, 163, 255, 0.1);
}

.search-box .icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-mute);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.search-box .icon svg {
  width: 18px;
  height: 18px;
}

.product-list,
.prevenda-list,
.picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product-card,
.prevenda-card,
.stat-card,
.cart-item,
.panel-card,
.customer-chip {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--stroke-soft);
  padding: 0.95rem 1.05rem;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}

.product-card:active,
.prevenda-card:active {
  transform: scale(0.99);
}

.product-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  cursor: pointer;
}

.product-card:hover,
.prevenda-card:hover {
  border-color: var(--stroke);
  background: var(--surface-strong);
}

.product-card .name,
.cart-item .name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}

.product-card .meta,
.cart-item .line {
  margin-top: 0.3rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  align-items: center;
}

.product-card .price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-align: right;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--empty-border);
  background: var(--empty-bg);
}

.empty-state strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.35rem;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0.55rem 1rem calc(0.55rem + var(--safe-bottom));
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--stroke-soft);
}

.bottom-nav-inner {
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--theme-btn-bg);
  border: 1px solid var(--stroke-soft);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0.4rem;
  border-radius: 999px;
  color: var(--text-mute);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.nav-btn svg {
  width: 22px;
  height: 22px;
}

.nav-btn.is-active {
  color: var(--cyan);
  background: var(--chip-bg);
  box-shadow: inset 0 0 0 1px var(--stroke);
}

/* Pré-venda editor — alinhado */
.cart-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.section-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.panel-card {
  padding: 1rem;
}

.customer-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.customer-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
}

.customer-chip .avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--chip-bg);
  color: var(--blue-2);
  flex-shrink: 0;
}

.customer-chip .avatar svg {
  width: 20px;
  height: 20px;
}

.customer-chip .info {
  min-width: 0;
  flex: 1;
}

.customer-chip .info strong {
  display: block;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-chip .info span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.76rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.pv-results {
  max-height: 220px;
  overflow: auto;
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pv-results:empty { display: none; }

.cart-item {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.cart-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.cart-item-top .price-col {
  text-align: right;
  flex-shrink: 0;
}

.cart-item-top .unit {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.cart-item-top .sum {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
  margin-top: 0.15rem;
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.qty-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.qty-row button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--stroke);
  color: var(--blue-2);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1;
}

.qty-row span {
  min-width: 1.6rem;
  text-align: center;
  font-weight: 650;
}

.total-bar {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px);
  z-index: 5;
  margin-top: 0.35rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--total-grad);
  border: 1px solid var(--stroke);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  box-shadow: var(--shadow);
}

.total-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.total-bar .label {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 550;
}

.total-bar .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: -0.02em;
  line-height: 1;
}

.total-bar-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.6rem;
}

.total-bar-actions .btn {
  width: 100%;
  margin: 0;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.actions-row .btn { flex: 1; min-width: 140px; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.stat-card strong {
  display: block;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-top: 0.35rem;
  word-break: break-word;
}

.stat-card span {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.prevenda-card { cursor: pointer; }

.prevenda-card .row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.prevenda-card .num {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prevenda-card .status {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--blue-2);
}

.prevenda-card .status.is-cancelled {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.prevenda-card .status.is-ok {
  background: rgba(45, 212, 168, 0.14);
  color: var(--ok);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
  align-items: center;
}

.card-actions .btn {
  width: auto;
  flex: 0 0 auto;
  min-width: 0;
  padding: 0.4rem 0.75rem;
}

.pix-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  background: var(--surface);
  text-align: center;
}

.pix-box img {
  width: min(100%, 240px);
  height: auto;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  margin: 0.75rem auto;
  display: block;
}

.pix-box .copia {
  word-break: break-all;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 0.5rem 0 0.85rem;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--input-bg);
  border: 1px solid var(--stroke-soft);
}

.view-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
  max-height: 240px;
  overflow: auto;
}

.view-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke-soft);
  background: var(--surface);
  font-size: 0.88rem;
}

.view-item span {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%) translateY(20px);
  z-index: 50;
  max-width: min(92vw, 360px);
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  text-align: center;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--modal-scrim);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: end center;
  padding: 1rem;
}

.modal-sheet {
  width: min(100%, 480px);
  max-height: min(88dvh, 720px);
  overflow: auto;
  background: var(--bg-2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl) var(--radius-xl) 24px 24px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  animation: sheetUp 0.3s ease both;
}

@keyframes sheetUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal-sheet h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.modal-sheet .sub {
  margin: 0 0 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke-soft);
  background: var(--surface);
  cursor: pointer;
}

.picker-item:hover {
  border-color: var(--stroke);
  background: var(--surface-strong);
}

.picker-item strong {
  display: block;
  font-size: 0.92rem;
}

.picker-item span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.76rem;
  color: var(--text-dim);
}

@media (min-width: 720px) {
  .modal-backdrop { place-items: center; }
  .modal-sheet { border-radius: var(--radius-xl); }
  .total-bar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .total-bar-top { margin: 0; }
  .total-bar-actions {
    grid-template-columns: auto auto;
    min-width: 260px;
  }
}
