:root {
  --bg: #0f1419;
  --panel: #1a222d;
  --panel-2: #222c38;
  --line: #2e3a48;
  --text: #e8eef4;
  --muted: #9aabbc;
  --accent: #3d9cf0;
  --ok: #3ecf8e;
  --bad: #f07178;
  --warn: #e6b450;
  --radius: 12px;
  --font: "Segoe UI", system-ui, sans-serif;
  --sidebar: 260px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html[data-theme="light"] {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #eef1f6;
  --line: #d5dbe3;
  --text: #12161c;
  --muted: #5c6775;
  --accent: #2563eb;
  --ok: #0d9f6e;
  --bad: #dc3d4a;
  --warn: #b45309;
}

html[data-theme="light"] body {
  background: var(--bg);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a3a55 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #1e2f28 0%, transparent 45%),
    var(--bg);
  -webkit-tap-highlight-color: transparent;
}

button, input, select {
  font: inherit;
}

#lockScreen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  background:
    radial-gradient(720px 420px at 12% -8%, rgba(106, 61, 255, 0.55), transparent 62%),
    radial-gradient(560px 380px at 100% 110%, rgba(101, 194, 0, 0.22), transparent 58%),
    linear-gradient(165deg, #12061f 0%, #2a0d52 46%, #0c1016 100%);
}

#lockScreen .auth-shell {
  width: min(420px, 100%);
}

#lockScreen .auth-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 4px 16px;
  color: #fff;
}

#lockScreen .auth-brand strong {
  font-size: 1.85rem;
  letter-spacing: -0.05em;
  line-height: 1;
}

#lockScreen .auth-brand span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
}

#lockScreen.hidden,
#app.hidden,
.hidden {
  display: none !important;
}

.lock-card {
  width: min(420px, 100%);
  background: rgba(16, 20, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 28px 24px 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.lock-card h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}
.lock-card p { margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.lock-card label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #c5d0dc;
  margin-bottom: 6px;
}
.lock-card input {
  width: 100%;
  background: #0d1218;
  border: 1px solid #3a4656;
  color: #f4f7fb;
  border-radius: 12px;
  padding: 14px 14px;
  margin-bottom: 14px;
  font-size: 1rem;
}
.lock-card input:focus {
  outline: none;
  border-color: #65c200;
  box-shadow: 0 0 0 3px rgba(101, 194, 0, 0.18);
}
.lock-card .pw-field {
  position: relative;
  margin-bottom: 14px;
}
.lock-card .pw-field input {
  margin-bottom: 0;
  padding-right: 48px;
}
.lock-card .pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9aabbc;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lock-card .pw-toggle:hover { color: #f4f7fb; }
.lock-card .pw-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lock-card .pw-toggle .pw-slash { display: none; }
.lock-card .pw-toggle.is-on .pw-slash { display: block; }
.lock-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
#lockScreen .btn.primary {
  width: 100%;
  justify-content: center;
  background: #65c200;
  border-color: #65c200;
  color: #102006;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 700;
}
#lockScreen .btn.primary:hover { filter: brightness(1.05); }
.lock-error { color: var(--bad); font-size: 0.85rem; min-height: 1.2em; margin: 0 0 10px; }
.lock-switch { margin: 16px 0 0; font-size: 0.92rem; color: var(--muted); text-align: center; }
.lock-switch button {
  background: none;
  border: 0;
  color: #8fd24a;
  padding: 0;
  cursor: pointer;
  font-weight: 700;
}

.theme-btn { min-width: 132px; }
.theme-btn-lock {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 40;
}
body:has(#app:not(.hidden)) > .theme-btn-lock,
body:has(#shell:not(.hidden)) > .theme-btn-lock {
  display: none !important;
}
body:has(#lockScreen:not(.hidden)) > .theme-btn-lock {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
}

.mobile-bar { display: none; }
.mobile-only { display: none !important; }
.desktop-only { display: block; }
.sidebar-backdrop { display: none; }

#app {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(8px);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
}

.brand { padding: 4px 8px 14px; }
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.brand h1 { margin: 0; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand .sub { color: var(--muted); font-size: 0.78rem; margin-top: 4px; line-height: 1.35; }

.account-list { display: flex; flex-direction: column; gap: 4px; }

.account-btn {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 44px;
}
.account-btn:hover { background: var(--panel-2); }
.account-btn.active { border-color: var(--accent); background: #1e3348; }
.account-btn.slot-full {
  border-color: #275744;
  background: #12241c;
}
.account-btn.slot-full strong { color: var(--ok); }
.account-btn.slot-full.active {
  border-color: var(--ok);
  background: #163226;
}
.account-btn.slot-open {
  border-color: #5a4a22;
  background: #241f12;
}
.account-btn.slot-open strong { color: var(--warn); }
.account-btn.slot-open.active {
  border-color: var(--warn);
  background: #2e2714;
}
.account-btn strong { font-size: 0.92rem; }
.account-btn span { font-size: 0.75rem; color: var(--muted); }
.account-balance {
  font-size: 0.8rem !important;
  font-weight: 600;
  color: #7ec8ff !important;
  margin-top: 2px;
}

#inventoryView > .sub {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-creds {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}
.cred-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}
.cred-head strong { font-size: 1.05rem; }
.cred-head span { color: var(--muted); font-size: 0.8rem; }
.cred-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.cred-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 10px 10px 12px;
  min-width: 0;
}
.cred-meta { min-width: 0; flex: 1; }
.cred-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cred-value {
  display: block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9rem;
  word-break: break-all;
}
.cred-psprices {
  align-items: stretch;
}
.cred-psprices .btn {
  margin-top: 6px;
}
.cred-balance-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}
.cred-balance-row input {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 36px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9rem;
}
.cred-balance-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.cred-balance-row .btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.8rem;
}
.cred-balance-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.copy-btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.8rem;
}
.copy-btn.copied {
  border-color: var(--ok);
  color: var(--ok);
}
.copy-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .cred-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .cred-grid { grid-template-columns: 1fr; }
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  border-color: var(--accent);
  background: #1e3348;
}
.chip.slot-full {
  border-color: #275744;
  color: var(--ok);
}
.chip.slot-full.active {
  border-color: var(--ok);
  background: #163226;
}
.chip.slot-open {
  border-color: #5a4a22;
  color: var(--warn);
}
.chip.slot-open.active {
  border-color: var(--warn);
  background: #2e2714;
}

.main {
  padding: 20px 22px calc(40px + var(--safe-bottom));
  min-width: 0;
}

.board-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}
.board-toggle-btn {
  border: 0 !important;
  border-radius: 0 !important;
  min-height: 44px;
  padding: 11px 14px;
  background: transparent;
}
.board-toggle-btn + .board-toggle-btn {
  border-left: 1px solid var(--line) !important;
}
.board-toggle-btn.active {
  background: #1e3348;
  color: #fff;
  font-weight: 700;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar > .field {
  flex: 1 1 150px;
  min-width: 0;
}
.toolbar > .field.grow { flex: 2 1 220px; }
.toolbar .btn { width: auto; white-space: nowrap; }

.field { flex: 1; min-width: 140px; }
.field.grow { flex: 2; }
.field.lock-field { flex: 0 0 auto; min-width: auto; }
.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 5px;
}
.field input,
.field select,
.btn {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  min-height: 44px;
}
.field input:focus,
.field select:focus { outline: none; border-color: var(--accent); }

.btn {
  cursor: pointer;
  width: auto;
  background: var(--panel-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: #1e3348; border-color: var(--accent); }
.icon-btn {
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 1.15rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.stat .v { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.stat .l { font-size: 0.76rem; color: var(--muted); }

.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.accent { color: var(--accent); }

.card.account-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card.account-card h3 { margin: 0 0 2px; }
.card.account-card .account-card-stats {
  margin-bottom: 2px;
}
.card.account-card .account-pspull {
  margin-top: 10px;
  width: 100%;
}
.card.account-card .paid-line {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #7ec8ff;
}
.card.account-card.slot-full {
  border-color: #275744;
}
.card.account-card.slot-open {
  border-color: #5a4a22;
}
.card.add-conta {
  min-height: 132px;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  background: transparent;
  gap: 6px;
}
.card.add-conta .add-conta-plus {
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 500;
  color: var(--muted);
}
.card.add-conta strong {
  font-size: 0.95rem;
}
.card.add-conta:hover {
  border-color: var(--accent);
  background: var(--panel-2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
}
.card:hover,
.card:active { border-color: #3d5670; }
.card.has-client-hit {
  border-color: #5a4a22;
  background: #1c1a12;
}
.card h3 { margin: 0 0 6px; font-size: 1rem; line-height: 1.3; }
.card .meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 10px; }
.card .meta.client-match {
  color: var(--warn);
  margin-top: -6px;
  margin-bottom: 10px;
  font-weight: 600;
}

.client-hits {
  background: var(--panel);
  border: 1px solid #5a4a22;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}
.client-hits-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.client-hits-head strong { color: var(--warn); font-size: 0.95rem; }
.client-hits-head span { color: var(--muted); font-size: 0.8rem; }
.client-hits-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.client-hit {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.client-hit:hover { border-color: var(--warn); }
.client-hit.email-hit:hover { border-color: var(--accent); }
.client-hit strong { font-size: 0.9rem; }
.client-hit-game { font-size: 0.85rem; }
.client-hit-meta { font-size: 0.75rem; color: var(--muted); }

.paid-line {
  font-weight: 700;
  color: #8fd0ff;
  margin-top: 2px;
}
.paid-line.muted {
  font-weight: 500;
  color: var(--muted);
}
.pill {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.pill.ok { color: var(--ok); border-color: #275744; background: #163226; }
.pill.bad { color: #f0c0c4; border-color: #5a3036; background: #2a1a1c; }

.empty { color: var(--muted); padding: 28px 8px; }

body.drawer-open { overflow: hidden; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  z-index: 80;
}
.drawer-backdrop.open { display: block; }
#accountBackdrop { z-index: 80; }
#accountWindow { z-index: 40; }
#accountWindow.open { z-index: 85; }
#drawer { z-index: 40; }
#drawer.open { z-index: 95; }
#drawerBackdrop.open { z-index: 90; }

.drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(1120px, calc(100vw - 48px));
  height: min(860px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  z-index: 40;
  transform: translate(-50%, -46%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.drawer.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
  z-index: 90;
}
.drawer-handle { display: none; }

.drawer-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 1;
}
.drawer-head h2 { margin: 0 0 4px; font-size: 1.35rem; letter-spacing: -0.02em; }
.drawer-head .meta { color: var(--muted); font-size: 0.85rem; }
.drawer-scroll {
  flex: 1;
  overflow: auto;
  padding: 18px 22px;
  background: var(--bg);
}
.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 22px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.game-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.game-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.game-hero .cost-box {
  margin: 0;
  min-width: min(280px, 100%);
  background: var(--panel-2);
}
.game-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
}
.game-modal-side {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.game-modal-side > .section-title {
  margin-top: 0;
}
.game-modal-side .slot-list {
  max-height: none;
}

.secret-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}
.secret-row .label {
  color: var(--muted);
  font-size: 0.75rem;
  display: block;
  margin-bottom: 2px;
}
.secret-row code {
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
}

.reveal-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.75rem;
  min-height: 36px;
}
.reveal-btn:hover { color: var(--text); border-color: var(--accent); }

.slot-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.slot-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.slot-card.slot-hit {
  border-color: var(--warn);
  box-shadow: 0 0 0 1px rgba(230, 180, 80, 0.35);
  background: #2a2414;
}
.slot-card .slot-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.slot-card .slot-platform { font-weight: 600; }
.slot-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.btn.wa-send {
  background: #145c3a;
  border-color: #1f8f5a;
  color: #d8ffe9;
  font-size: 0.78rem;
  padding: 6px 10px;
  min-height: 32px;
  white-space: nowrap;
}
.btn.wa-send:hover {
  border-color: #3ecf8e;
  background: #1a7048;
}
.btn.wa-send:disabled {
  opacity: 0.55;
  cursor: wait;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop.hidden { display: none !important; }
.modal-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.modal-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.modal-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}
.modal-card label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.modal-card input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 12px;
  min-height: 44px;
}
.modal-card input:focus {
  outline: none;
  border-color: var(--accent);
}
.modal-error {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--bad);
  font-size: 0.85rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.slot-meta {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
}
.slot-meta .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.slot-meta .k { color: var(--muted); }
.slot-meta .v { text-align: right; word-break: break-word; }
.sale-row {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  align-items: center;
}
.sale-edit {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.sale-input {
  width: 110px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 36px;
  text-align: right;
}
.sale-input:focus {
  outline: none;
  border-color: var(--accent);
}
.sale-save {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.8rem;
}
.client-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.client-edit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: left;
}
.client-edit input,
.client-edit textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.92rem;
}
.client-edit textarea { resize: vertical; min-height: 58px; }
.client-edit input:focus,
.client-edit textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.client-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.client-sold-check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  color: var(--text) !important;
  font-size: 0.88rem !important;
}
.client-edit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.client-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.section-title {
  margin: 18px 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.pill.accent {
  color: #b8d9f8;
  border-color: #2a4a66;
  background: #163044;
}

.cost-box {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.cost-box label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.cost-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cost-row input {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  min-height: 44px;
}
.cost-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.cost-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.dash-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 8px 12px;
}
.nav-tab {
  flex: 1 1 30%;
  min-width: 88px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  min-height: 40px;
}
a.dash-link {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 8px 12px;
  text-decoration: none;
  border-color: var(--accent);
  background: #1e3348;
  font-weight: 700;
}
.nav-tab.active {
  border-color: var(--accent);
  background: #1e3348;
}
.account-list.hidden { display: none !important; }

.messages-view {
  padding: 4px 4px 32px;
}
.msg-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.msg-head h2 { margin: 0 0 6px; font-size: 1.25rem; }
.msg-head p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.4; max-width: 52ch; }
.msg-status { color: var(--ok); font-size: 0.85rem; min-height: 1.2em; }
.msg-status.err { color: var(--bad); }
.msg-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.msg-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.msg-key {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.85rem;
}
.msg-key.active {
  border-color: var(--accent);
  background: #1e3348;
}
.msg-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.msg-token {
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}
.msg-token:hover { color: var(--text); border-color: var(--accent); }
.msg-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.msg-editor textarea {
  width: 100%;
  min-height: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}
.msg-editor textarea:focus { outline: none; border-color: var(--accent); }
.msg-preview-wrap label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 5px;
}
.msg-preview {
  margin: 0;
  min-height: 420px;
  max-height: 70vh;
  overflow: auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text);
}
.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.dash-view { padding: 4px 0 32px; }
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dash-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.dash-card h3 { margin: 0 0 8px; font-size: 0.95rem; }
.dash-card .big { font-size: 1.6rem; font-weight: 700; }
.dash-card .muted { color: var(--muted); font-size: 0.82rem; }
.dash-list { display: flex; flex-direction: column; gap: 8px; }
.dash-row {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  line-height: 1.4;
}
.dash-row strong { display: block; margin-bottom: 2px; }
.dash-row .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.alert-bad { border-color: #7a3038; }
.alert-warn { border-color: #6b5420; }
.wa-ok { color: var(--ok); }
.wa-bad { color: var(--bad); }
.wa-qr { max-width: 220px; border-radius: 8px; margin-top: 8px; }
.wa-status-bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 14px;
}
.wa-status-bar.wa-up { border-color: var(--ok); }
.wa-status-bar.wa-down { border-color: var(--bad); }
.wa-status-bar strong { display: block; margin-bottom: 4px; }
.wa-status-bar .muted { color: var(--muted); font-size: 0.9rem; }
.wa-status-bar .wa-status-actions { margin-top: 8px; }
#app.staff-mode .cost-box,
#app.staff-mode .cred-balance,
#app.staff-mode .cred-psprices,
#app.staff-mode .account-pspull,
#app.staff-mode #pspicesToolbarBtn,
#app.staff-mode .account-creds,
#app.staff-mode .secret-row { display: none !important; }

@media (max-width: 1100px) {
  .msg-editor { grid-template-columns: 1fr; }
  .msg-editor textarea,
  .msg-preview { min-height: 280px; }
}

/* -------- Mobile -------- */
@media (max-width: 900px) {
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }

  #app {
    display: block;
    padding-top: calc(58px + var(--safe-top));
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding: calc(8px + var(--safe-top)) 12px 8px;
    background: rgba(15, 20, 25, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }
  .mobile-bar-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }
  .mobile-bar-title strong { font-size: 0.95rem; }
  .mobile-bar-title span {
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
  }
  .sidebar-backdrop.open { display: block; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 88vw);
    height: 100dvh;
    z-index: 36;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--line);
    padding-top: calc(14px + var(--safe-top));
  }
  .sidebar.open { transform: translateX(0); }

  .account-chips { display: none !important; }

  .main { padding: 14px 14px calc(28px + var(--safe-bottom)); }

  .toolbar { gap: 8px; }
  .toolbar > .field,
  .toolbar > .field.grow { flex: 1 1 140px; min-width: 0; }

  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat .v { font-size: 1.15rem; }

  .grid { grid-template-columns: 1fr; gap: 10px; }

  .drawer {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    border-radius: 16px;
    transform: translate(-50%, -46%) scale(0.98);
    padding: 0;
  }
  .drawer.open { transform: translate(-50%, -50%) scale(1); }
  .drawer-handle { display: none; }
  .drawer-head,
  .drawer-scroll,
  .drawer-foot { padding-left: 14px; padding-right: 14px; }
  .game-modal-grid { grid-template-columns: 1fr; }
}

html[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.96);
}
html[data-theme="light"] .mobile-bar {
  background: rgba(255, 255, 255, 0.96);
}
html[data-theme="light"] .account-btn:hover {
  background: var(--panel-2);
}
html[data-theme="light"] .account-btn.active {
  background: #e8f1ff;
  color: var(--text);
}
html[data-theme="light"] .account-btn.slot-full {
  border-color: #86efac;
  background: #f0fdf4;
}
html[data-theme="light"] .account-btn.slot-full.active {
  background: #dcfce7;
  border-color: #22c55e;
}
html[data-theme="light"] .account-btn.slot-open {
  border-color: #fde68a;
  background: #fffbeb;
}
html[data-theme="light"] .account-btn.slot-open.active {
  background: #fef3c7;
  border-color: #f59e0b;
}
html[data-theme="light"] .account-balance {
  color: #2563eb !important;
}
html[data-theme="light"] .chip.active,
html[data-theme="light"] .btn.primary,
html[data-theme="light"] .nav-tab.active,
html[data-theme="light"] .board-toggle-btn.active,
html[data-theme="light"] a.dash-link {
  background: #e8f1ff;
  color: var(--text);
  border-color: var(--accent);
}
html[data-theme="light"] .chip.slot-full.active {
  background: #ecfdf5;
  border-color: var(--ok);
}
html[data-theme="light"] .chip.slot-open.active {
  background: #fffbeb;
  border-color: var(--warn);
}
html[data-theme="light"] .card {
  background: var(--panel);
  color: var(--text);
}
html[data-theme="light"] .card h3 {
  color: var(--text);
}
html[data-theme="light"] .card .meta {
  color: var(--muted);
}
html[data-theme="light"] .card:hover,
html[data-theme="light"] .card:active {
  border-color: var(--accent);
}
html[data-theme="light"] .card.account-card.slot-full {
  border-color: #86efac;
  background: #f0fdf4;
}
html[data-theme="light"] .card.add-conta {
  background: #fff;
  border-color: #cbd5e1;
}
html[data-theme="light"] .card.add-conta:hover {
  background: #f8fafc;
  border-color: var(--accent);
}
html[data-theme="light"] .paid-line {
  color: #1d4ed8;
}
html[data-theme="light"] .pill.ok {
  color: #047857;
  background: #ecfdf5;
  border-color: #6ee7b7;
}
html[data-theme="light"] .pill.bad {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
html[data-theme="light"] .pill.accent {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
html[data-theme="light"] .client-hits {
  background: #fffbeb;
  border-color: #fcd34d;
}
html[data-theme="light"] .slot-card.slot-hit {
  background: #fffbeb;
}
html[data-theme="light"] .btn.wa-send {
  background: #059669;
  border-color: #047857;
  color: #fff;
}
html[data-theme="light"] .btn.wa-send:hover {
  background: #047857;
  border-color: #065f46;
}
html[data-theme="light"] .drawer {
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
}
html[data-theme="light"] .drawer-backdrop {
  background: rgba(15, 23, 42, 0.48);
}
html[data-theme="light"] .msg-key.active,
html[data-theme="light"] .chips button.active {
  background: #e8f1ff;
  color: var(--text);
}

body:has(#app:not(.hidden)) {
  background: #0c0e12;
}
#app:not(.hidden) {
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(214, 238, 74, 0.08), transparent 55%),
    #0c0e12;
  color: #f4f6f8;
}
.home-top { padding: 22px 28px 0; }
#homeView {
  min-height: auto;
  padding: 8px 28px 40px;
  background: transparent;
  color: #f4f6f8;
}
.home-top {
  display: flex;
  align-items: center;
  gap: 18px;
}
.home-brand {
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.05rem;
  white-space: nowrap;
}
.home-mark { font-weight: 800; }
.home-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.home-nav-btn,
.home-tool,
.home-btn,
.home-more {
  font: inherit;
  color: #c5cad3;
  background: transparent;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}
.home-nav-btn {
  border-radius: 999px;
  padding: 8px 14px;
}
.home-nav-btn.active,
.home-nav-btn:hover {
  background: #1c1f27;
  color: #fff;
}
.home-tools { display: flex; gap: 8px; margin-left: auto; }
.home-tool {
  border: 1px solid #2a2e38;
  background: #14171d;
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
}
.home-hello-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 18px;
}
#homeHello {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.045em;
}
.home-sync { margin: 0; color: #8b93a1; font-size: 0.92rem; }
.home-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr;
  gap: 16px;
}
.home-card {
  background: #16181e;
  border: 1px solid #262a33;
  border-radius: 24px;
  padding: 20px;
  min-width: 0;
}
.home-card-kicker,
.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a7b0bd;
  font-size: 0.92rem;
}
.home-card-head h2,
.home-card h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.03em;
}
.home-balance-value {
  margin: 18px 0 16px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.05em;
}
.home-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.home-pill {
  flex: 1;
  background: #101216;
  border-radius: 16px;
  padding: 10px 12px;
}
.home-pill span { display: block; color: #8b93a1; font-size: 0.75rem; }
.home-pill strong { font-size: 0.95rem; }
.home-pill-lime {
  background: #d6ee4a;
  color: #142000;
}
.home-pill-lime span { color: #3d5210; }
.home-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.home-btn {
  border-radius: 999px;
  padding: 10px 16px;
  background: #22262f;
  color: #fff;
  min-height: 40px;
}
.home-btn-lime { background: #d6ee4a; color: #142000; font-weight: 700; }
.home-more {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #22262f;
  color: #fff;
}
.home-chip {
  border-radius: 999px;
  background: #22262f;
  padding: 4px 10px;
  font-size: 0.78rem;
}
.home-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.home-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
}
.home-row.is-hot { background: #d6ee4a; color: #142000; }
.home-row.is-hot small { color: #3d5210; }
.home-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #2a2f3a;
  font-weight: 700;
  flex: 0 0 auto;
}
.home-row.is-hot .home-avatar { background: #142000; color: #d6ee4a; }
.home-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.home-row-main strong,
.home-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-row-main small { color: #8b93a1; }
.home-row-val { font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.home-empty { color: #8b93a1; padding: 12px 0; }
.home-wa-body { margin-top: 12px; color: #c5cad3; line-height: 1.45; }
.home-wa-status { margin: 0 0 8px; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.04em; color: #fff; }
.home-wa-status.is-up { color: #d6ee4a; }
.home-chart { grid-column: 1 / 3; }
.home-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 170px;
  margin-top: 18px;
}
.home-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  color: #8b93a1;
  font-size: 0.75rem;
}
.home-bar-col {
  width: min(42px, 100%);
  border-radius: 999px;
  background: #2a2f3a;
}
.home-bar.is-hot .home-bar-col { background: #d6ee4a; }
.home-bar.is-hot { color: #d6ee4a; }
.home-bar-n { min-height: 1em; }
@media (max-width: 980px) {
  #homeView { padding: 16px; }
  .home-top { flex-wrap: wrap; }
  .home-grid, .home-chart { grid-template-columns: 1fr; display: block; }
  .home-card { margin-bottom: 12px; }
  .home-hello-row { flex-direction: column; align-items: flex-start; }
}
html[data-theme="light"] #homeView {
  background: #f4f5f7;
  color: #12161c;
}
html[data-theme="light"] .home-card { background: #fff; border-color: #e4e7ee; }
html[data-theme="light"] .home-nav-btn.active,
html[data-theme="light"] .home-tool,
html[data-theme="light"] .home-btn,
html[data-theme="light"] .home-more,
html[data-theme="light"] .home-chip { background: #eceff4; color: #12161c; }
html[data-theme="light"] .home-btn-lime,
html[data-theme="light"] .home-pill-lime,
html[data-theme="light"] .home-row.is-hot { background: #d6ee4a; color: #142000; }
html[data-theme="light"] #homeHello,
html[data-theme="light"] .home-card h2 { color: #12161c; }

#inventoryView .wa-status-bar,
#inventoryView .toolbar,
#inventoryView .stat,
#inventoryView .card,
#inventoryView .client-hits {
  background: #16181e;
  border: 1px solid #262a33;
  border-radius: 22px;
  color: #f4f6f8;
}
#inventoryView .wa-status-bar { padding: 16px 18px; }
#inventoryView .sub { color: #8b93a1; }
#inventoryView .toolbar {
  padding: 14px;
  margin-bottom: 16px;
  align-items: end;
}
#inventoryView .toolbar .lock-field,
#inventoryView #homeBack { display: none; }
#inventoryView .field label { color: #8b93a1; }
#inventoryView .field input,
#inventoryView .field select {
  background: #101216;
  border: 1px solid #2a2e38;
  border-radius: 14px;
  color: #f4f6f8;
}
#inventoryView .board-toggle {
  background: #101216;
  border: 1px solid #2a2e38;
  border-radius: 999px;
  padding: 3px;
}
#inventoryView .board-toggle-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #c5cad3;
}
#inventoryView .board-toggle-btn.active {
  background: #d6ee4a;
  color: #142000;
}
#inventoryView .toolbar .btn {
  border: 0;
  border-radius: 999px;
  background: #22262f;
  color: #fff;
}
#inventoryView .toolbar .btn.primary,
#inventoryView .toolbar a.btn[href*="caixa"] {
  background: #d6ee4a;
  color: #142000;
  font-weight: 700;
}
#inventoryView .stat { padding: 16px 18px; }
#inventoryView .stat .v {
  font-size: 2rem;
  letter-spacing: -0.05em;
}
#inventoryView .stat .l { color: #8b93a1; }
#inventoryView .grid { gap: 14px; }
#inventoryView .card { padding: 16px; }
#inventoryView .card:hover { border-color: #d6ee4a; }
#inventoryView .card h3 { letter-spacing: -0.03em; }
#inventoryView .pill {
  border-radius: 999px;
  border: 0;
  background: #22262f;
  color: #c5cad3;
}
#inventoryView .pill.ok {
  background: #d6ee4a;
  color: #142000;
}
#inventoryView .pill.bad { background: #2a1c22; color: #f0b4bc; }
#inventoryView .paid-line { color: #d6ee4a; }
.main { background: transparent; }
html[data-theme="light"] body:has(#app:not(.hidden)),
html[data-theme="light"] #app:not(.hidden) { background: #f4f5f7; color: #12161c; }
html[data-theme="light"] #inventoryView .wa-status-bar,
html[data-theme="light"] #inventoryView .toolbar,
html[data-theme="light"] #inventoryView .stat,
html[data-theme="light"] #inventoryView .card,
html[data-theme="light"] #inventoryView .client-hits {
  background: #fff;
  border-color: #e4e7ee;
  color: #12161c;
}
html[data-theme="light"] #inventoryView .field input,
html[data-theme="light"] #inventoryView .field select,
html[data-theme="light"] #inventoryView .board-toggle { background: #f4f5f7; color: #12161c; }
