:root {
  --bg: #0b1220;
  --bg-2: #0f172a;
  --panel: #111c33;
  --panel-2: #15213c;
  --line: #1f2c4a;
  --line-2: #243353;
  --text: #e6ecf5;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #f59e0b;
  --accent-2: #fbbf24;
  --primary: #3b82f6;
  --primary-2: #60a5fa;
  --success: #10b981;
  --success-2: #34d399;
  --danger: #ef4444;
  --danger-2: #f87171;
  --warn: #f59e0b;
  --info: #38bdf8;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --pad: 18px;
}
.offline-banner { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 2000; padding: 8px; text-align: center; background: #7f1d1d; color: #fecaca; font-size: 12px; font-weight: 700; }
.brand-logo { width: 74px; height: 74px; object-fit: contain; border-radius: 18px; box-shadow: 0 8px 24px rgba(245,158,11,.18); }
.brand-logo.sm { width: 38px; height: 38px; border-radius: 10px; box-shadow: none; }
body.offline .offline-banner { display: block; }
[data-require="admin"] { display: none !important; }
[data-admin-only="true"] { display: none !important; }
body.admin-mode [data-require="admin"] { display: flex !important; }
body.admin-mode [data-admin-only="true"] { display: block !important; }

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: 15px;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.5px;
}

.muted { color: var(--muted); }
.muted.small { font-size: 13px; }
.text-pos { color: var(--success); }
.text-neg { color: var(--danger); }

/* Screens */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(245, 158, 11, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(59, 130, 246, 0.20), transparent 60%),
    linear-gradient(180deg, #0b1220, #0a1020);
}

.login-brand {
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-brand .brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0b1220;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 32px;
  margin-bottom: 18px;
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.35);
}
.login-brand h1 { font-size: 38px; margin: 0 0 8px; }
.brand-sub { color: var(--muted); margin: 0 0 24px; font-size: 17px; }
.brand-features { list-style: none; padding: 0; margin: 0; }
.brand-features li {
  padding: 8px 0;
  color: var(--text);
  border-bottom: 1px dashed var(--line);
}
.brand-features li:last-child { border: none; }

.login-card {
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 540px;
}
.login-card h2 { margin: 0 0 6px; font-size: 26px; }

.pin-display {
  display: flex;
  gap: 12px;
  margin: 24px 0 16px;
}
.pin-display span {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}
.pin-display span.filled { background: rgba(245, 158, 11, 0.12); }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.keypad button {
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  transition: all 0.15s;
}
.keypad button:hover { background: var(--panel-2); border-color: var(--line-2); }
.keypad button:active { transform: scale(0.97); }

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

/* ---------- App Layout ---------- */
#screen-app {
  display: none;
  min-height: 100vh;
}
#screen-app.active {
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0b1220;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}
.brand-mark.sm { width: 38px; height: 38px; font-size: 18px; border-radius: 10px; }
.brand-title { font-weight: 700; font-size: 16px; }
.brand-sub-sm { font-size: 12px; color: var(--muted); }

.nav {
  padding: 12px;
  flex: 1;
  overflow-y: auto;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  margin-bottom: 4px;
  transition: all 0.15s;
}
.nav-btn:hover {
  background: var(--panel-2);
  color: var(--text);
}
.nav-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(59, 130, 246, 0.10));
  color: var(--text);
  border-color: rgba(245, 158, 11, 0.35);
}
.nav-ico { font-size: 18px; }

.side-foot { padding: 16px; border-top: 1px solid var(--line); }

/* Hamburger menu toggle — hidden on desktop, shown on mobile */
.hamburger {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
}
.limit-preset-row { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--line); }
.receipt-logo-preview { display:block; max-width:180px; max-height:90px; object-fit:contain; background:#fff; border-radius:8px; padding:6px; margin-top:8px; }

.main {
  padding: 28px;
  max-width: 1400px;
  width: 100%;
  overflow-x: hidden;
}

.view { display: none; }
.view.active { display: block; }

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
  flex-wrap: wrap;
}
.view-head h1 { margin: 0 0 4px; font-size: 26px; }
.head-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Results display inside POS ---------- */
.results-display-view.active { display: flex; flex-direction: column; min-height: calc(100vh - 56px); }
.results-display-shell {
  flex: 1;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #060912;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
.results-display-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 160px);
  min-height: 640px;
  border: 0;
  background: #060912;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn.full { width: 100%; }
.btn.big { padding: 14px 18px; font-size: 15px; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0b1220;
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--line-2); }
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-2);
  border-color: rgba(239, 68, 68, 0.35);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

/* ---------- Segmented ---------- */
.seg {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.seg-btn {
  padding: 7px 12px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.seg-btn.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- KPIs ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 80px at -10% 0%, rgba(245, 158, 11, 0.06), transparent 70%);
  pointer-events: none;
}
.kpi.accent {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(59, 130, 246, 0.10));
  border-color: rgba(245, 158, 11, 0.30);
}
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -0.5px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.card.danger-zone { border-color: rgba(239, 68, 68, 0.30); }
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th, .data-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-2);
  position: sticky;
  top: 0;
}
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.data-table .r { text-align: right; }

.search-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.search-row input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.field input, .field select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus { border-color: var(--accent); }

.btn-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- Web pull (lottery results from internet) ---------- */
.webpull-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
  max-height: 360px;
  overflow-y: auto;
}
.webpull-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #0e1830;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.webpull-row:hover { border-color: var(--accent); background: #11203c; }
.webpull-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  cursor: pointer;
  accent-color: var(--accent);
}
.webpull-meta { flex: 1; min-width: 0; }
.webpull-title { font-size: 14px; color: var(--text); }
.webpull-nums {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
  letter-spacing: 1px;
}
.webpull-row .muted.small { font-size: 11px; }

/* ---------- Sell layout ---------- */
.sell-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
}
.sell-main { min-width: 0; }
.sell-side .sticky { position: sticky; top: 12px; }

.games {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-select-wrap { margin: 0; }
.game-select-wrap select { font-weight: 700; font-size: 16px; min-height: 48px; }
.game-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.game-card { display: flex; align-items: center; gap: 10px; min-height: 76px; padding: 10px; text-align: left; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; transition: .15s ease; }
.game-card:hover, .game-card.selected { border-color: var(--accent); background: rgba(245,158,11,.10); transform: translateY(-1px); }
.game-card-logo { width: 70px; height: 42px; object-fit: contain; border-radius: 6px; background: #fff; flex: 0 0 auto; }
.game-card-copy { display: grid; gap: 5px; }
.game-card-copy strong { font-size: 13px; }
.game-card-copy small, .draw-card small { color: var(--muted); font-size: 11px; }
.draw-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.draw-card { display: grid; gap: 5px; padding: 12px; text-align: left; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.draw-card:hover, .draw-card.selected { border-color: var(--primary); background: rgba(59,130,246,.13); }
.draw-card.closed { opacity: .55; cursor: not-allowed; }
.draw-card-title { font-weight: 800; }
@media (max-width: 640px) { .game-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .game-card { min-height: 68px; padding: 8px; } .game-card-logo { width: 54px; height: 34px; } .game-card-copy strong { font-size: 11px; } }
.games-group-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 2px 0;
}
.games-group-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.game-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.game-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.game-card.active {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.10);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}
.game-card .gn { font-weight: 700; font-size: 15px; }
.game-card .gt { font-size: 12px; color: var(--muted); margin-top: 2px; }
.game-card .gp { font-size: 13px; margin-top: 8px; color: var(--accent-2); font-weight: 600; }

/* Number picker */
.picker-area { padding-top: 6px; }
.picker-amount-field { margin: 12px 0; }
.picker-amount-field input { font-size: 18px; font-weight: 800; border-color: rgba(245,158,11,.55); }
.borlette-line-head, .borlette-line { display: grid; grid-template-columns: 1.35fr .7fr .85fr .8fr .8fr 34px; gap: 8px; align-items: center; }
.borlette-line-head { color: var(--muted); font-size: 11px; margin: 10px 0 5px; }
.borlette-line { margin-bottom: 8px; }
.borlette-line input, .borlette-line select { min-width: 0; width: 100%; }
.loto-line {
  display: grid;
  grid-template-columns: .8fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.05);
}
.loto-field { display: grid; gap: 5px; min-width: 0; }
.loto-field > span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.loto-line input, .loto-line select { min-width: 0; width: 100%; }
.loto-st-amount, .loto-box-amount { font-weight: 800; font-size: 16px; border-color: rgba(245, 158, 11, .55); }
@media (max-width: 720px) {
  .borlette-line-head { display: none; }
  .borlette-line { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
  .borlette-line .borlette-remove { grid-column: 1 / -1; }
  .loto-line { grid-template-columns: 1fr; align-items: stretch; }
  .loto-line .loto-remove { justify-self: stretch; }
}
.number-entry { display: grid; gap: 12px; max-width: 520px; }
.number-entry-help {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--accent-2);
  font-size: 13px;
}
.number-entry-input {
  font-size: 24px;
  letter-spacing: 5px;
  max-width: 220px;
  font-weight: 800;
}
.balls-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.balls-grid.b3 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.ball {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.12s;
  font-family: "JetBrains Mono", monospace;
  max-width: 44px;
}
.ball:hover { border-color: var(--line-2); }
.ball.selected {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  border-color: var(--accent);
  color: #0b1220;
  transform: scale(1.05);
}

.selected-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  min-height: 38px;
}
.selected-chip {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.selected-chip button {
  background: transparent;
  color: inherit;
  border: none;
  cursor: pointer;
  font-weight: 700;
  opacity: 0.6;
}
.selected-chip button:hover { opacity: 1; }

.scratch-pick {
  display: grid;
  gap: 10px;
}
.scratch-pick .help {
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  padding: 14px;
  color: var(--muted);
}

.ticket-preview {
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  white-space: pre-wrap;
  min-height: 60px;
  color: var(--accent-2);
}
.quick-ticket {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.05);
}
.quick-ticket-head { margin-bottom: 12px; }
.quick-ticket-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 620px) { .quick-ticket-grid { grid-template-columns: 1fr; } }

/* Multi-bet cart */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0e1830;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.cart-item .ci-info { flex: 1; min-width: 0; font-size: 12px; line-height: 1.35; }
.cart-item .ci-game { font-weight: 700; color: var(--accent); font-size: 13px; }
.cart-item .ci-nums { font-family: "JetBrains Mono", monospace; font-weight: 700; color: var(--text); }
.cart-item .ci-meta { color: var(--muted); font-size: 11px; }
.cart-item .ci-amt { font-weight: 700; color: #34d399; font-family: "JetBrains Mono", monospace; white-space: nowrap; }
.cart-item .ci-del {
  background: transparent; border: none; color: #f87171; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 4px;
}
.cart-item .ci-del:hover { color: #ef4444; }

/* Sell side summary */
.line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.line span { color: var(--muted); }
.line.total {
  font-size: 18px;
  font-weight: 800;
  border-bottom: none;
  padding-top: 14px;
  margin-top: 6px;
  border-top: 2px solid var(--line-2);
}
.line.total strong { color: var(--accent); }

.pay-row { display: flex; gap: 6px; }
.pay-row .btn { flex: 1; }
.pay-input { margin-top: 8px; }
.pay-input input { width: 100%; }

/* ---------- Draws ---------- */
.draw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.draw-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.draw-card .dn { font-size: 13px; color: var(--muted); font-weight: 600; }
.draw-card .dd { font-size: 12px; color: var(--muted-2); margin: 2px 0 8px; }
.draw-card .nums { display: flex; flex-wrap: wrap; gap: 6px; }
.draw-card .nums span {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.30);
  color: var(--accent-2);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
}

/* ---------- Payout result ---------- */
.payout-result {
  margin-top: 14px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.payout-result.win {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.35);
}
.payout-result.lose {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.30);
}
.payout-result .big {
  font-size: 28px;
  font-weight: 800;
  margin: 6px 0;
}
.payout-result.win .big { color: var(--success-2); }
.payout-result.lose .big { color: var(--danger-2); }

/* ---------- Modal ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal.show { display: flex; }
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1100;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  max-width: 380px;
}
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- Scanner ---------- */
#scanner-container {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  position: relative;
}
#scanner-video {
  width: 100%;
  max-width: 320px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}
#btn-cancel-scan {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- Receipt ---------- */
.receipt-host { display: none; }
@media print {
  @page { size: auto; margin: 0; }
  @page receipt58 { size: 58mm auto; margin: 0; }
  @page receipt80 { size: 80mm auto; margin: 0; }
  body { background: #fff; color: #000; }
  /* Print only the receipt, never the POS dashboard behind it. */
  body > *:not(#receipt-host) { display: none !important; }
  .receipt-host {
    display: block !important;
    position: absolute;
    inset: 0;
    padding: 8px;
  }
  .receipt {
    width: 72mm;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    color: #000;
  }
  .receipt h2 { margin: 0 0 4px; text-align: center; font-size: 14px; }
  .receipt-logo { display: block; max-width: 80px; max-height: 55px; margin: 0 auto 6px; object-fit: contain; }
  .receipt-notice { border-top: 1px dashed #000; margin-top: 8px; padding-top: 8px; text-align: center; font-size: 10px; font-weight: 700; }
  .receipt .center { text-align: center; }
  .receipt hr { border: none; border-top: 1px dashed #000; margin: 8px 0; }
  .receipt .row { display: flex; justify-content: space-between; margin: 2px 0; }
  .receipt-meta { border-top: 1px dashed #000; border-bottom: 1px dashed #000; padding: 5px 0; margin: 6px 0; }
  .receipt .total-row { font-size: 14px; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 5px 0; margin: 6px 0; }
  .receipt-line { display: grid; grid-template-columns: 1.1fr 1.35fr .55fr .45fr .7fr; gap: 3px; align-items: baseline; padding: 3px 0; border-bottom: 1px dotted #777; }
  .receipt-line-number { font-size: 15px; font-weight: 800; }
  .receipt-line-game { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .receipt-line-type, .receipt-line-location { font-weight: 700; text-align: center; }
  .receipt-line-amount { text-align: right; white-space: nowrap; }
  .receipt .nums { font-size: 14px; font-weight: 700; letter-spacing: 1px; }
  .receipt .barcode { text-align: center; margin: 8px 0; font-family: monospace; }
  .receipt-qrcode { display: flex; justify-content: center; margin: 8px 0 4px; }
  .receipt-qrcode img, .receipt-qrcode canvas { width: 112px !important; height: 112px !important; image-rendering: pixelated; }
  .receipt-paper-auto { width: 72mm; }
  .receipt-paper-80 { width: 72mm; page: receipt80; }
  .receipt-paper-58 { width: 50mm; font-size: 10px; page: receipt58; }
  .receipt-paper-58 .receipt-line { grid-template-columns: 1fr 1.15fr .45fr .4fr .65fr; gap: 2px; }
  .receipt-paper-58 .receipt-line-number { font-size: 13px; }
  .receipt-paper-58 .receipt-qrcode img, .receipt-paper-58 .receipt-qrcode canvas { width: 82px !important; height: 82px !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .sell-layout { grid-template-columns: 1fr; }
  .sell-side .sticky { position: relative; top: 0; }
}
@media (max-width: 820px) {
  #screen-app.active { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.2s;
    z-index: 50;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-overlay { display: block; }
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .sidebar-close { display: inline-block; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 40px 28px 0; }
  .login-card { padding: 40px 28px; border-left: none; border-top: 1px solid var(--line); max-width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .main { padding: 18px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .main { padding: 12px; }
  .view-head { gap: 10px; align-items: flex-start; }
  .view-head h1 { font-size: 22px; }
  .games-group-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .game-card { padding: 12px 10px; min-height: 86px; }
  .game-card .gn { font-size: 13px; }
  .game-card .gp { margin-top: 5px; }
  .ball { max-width: none; font-size: 12px; }
  .balls-grid { gap: 5px; }
  .quick-ticket-grid { grid-template-columns: 1fr; }
  .btn { min-height: 44px; }
  input, select { min-height: 44px; }
  .head-actions, .btn-row { width: 100%; flex-wrap: wrap; }
  .head-actions .btn, .btn-row .btn { flex: 1 1 140px; }
  .sell-side { order: -1; }
  .cart-list { max-height: 260px; overflow-y: auto; }
}

@media (max-width: 620px) {
  .results-display-shell,
  .results-display-frame { min-height: 560px; }
  .results-display-frame { height: 76vh; }
}

/* SaaS simplified Sell screen: keep legacy controls in DOM for app logic, but show only Quick Pick + Cart. */
.sell-internal { display: none !important; }
.sell-layout-simple { align-items: start; }
.quickpick-card { min-height: 100%; }
.quickpick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quickpick-preview {
  margin-top: 14px;
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  letter-spacing: .5px;
}
.quickpick-preview.has-number {
  color: var(--accent-2);
  font-size: 24px;
  border-color: rgba(245,158,11,.45);
  background: rgba(245,158,11,.07);
}
@media (max-width: 760px) {
  .quickpick-grid { grid-template-columns: 1fr; }
}


/* ---------- Full ticket after QR / serial check ---------- */
.checked-ticket-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(59,130,246,.08), rgba(255,255,255,.02));
  padding: 16px;
}
.checked-ticket-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:10px; }
.checked-ticket-number { font-family:"JetBrains Mono", monospace; font-size:18px; font-weight:800; letter-spacing:.5px; }
.checked-ticket-total { font-size:24px; font-weight:900; color:var(--accent-2); white-space:nowrap; }
.checked-ticket-meta { display:flex; flex-wrap:wrap; gap:8px 16px; color:var(--muted); font-size:12px; margin-bottom:12px; }
.checked-ticket-table { margin-top:6px; }
.checked-ticket-actions { margin-top:14px; }
@media (max-width: 720px) {
  .checked-ticket-head { align-items:flex-start; }
  .checked-ticket-total { font-size:20px; }
  .checked-ticket-table .data-table { min-width:720px; }
}


/* ---------- Required PWA install gate ---------- */
.pwa-install-gate {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(700px 420px at 50% 0%, rgba(245,158,11,.17), transparent 62%),
    rgba(6,9,18,.985);
  overflow-y: auto;
}
.pwa-install-gate[hidden] { display: none !important; }
.pwa-install-card {
  width: min(100%, 460px);
  border: 1px solid rgba(245,158,11,.30);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18,29,52,.98), rgba(9,15,28,.98));
  box-shadow: 0 30px 80px rgba(0,0,0,.48), 0 0 45px rgba(245,158,11,.08);
  padding: 28px;
  text-align: center;
}
.pwa-install-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
  margin-bottom: 14px;
}
.pwa-install-kicker {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent-2);
  margin-bottom: 6px;
}
.pwa-install-card h1 { margin: 0 0 8px; font-size: 30px; }
.pwa-install-card > p { margin: 0 auto 20px; color: var(--muted); line-height: 1.55; max-width: 360px; }
.pwa-install-panel { margin-top: 12px; }
.pwa-install-panel[hidden], .pwa-install-success[hidden] { display:none !important; }
.pwa-install-main-btn { width: 100%; min-height: 56px; font-size: 17px; font-weight: 900; }
.pwa-install-help { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pwa-ios-steps { display: grid; gap: 10px; text-align: left; }
.pwa-ios-steps > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
}
.pwa-ios-steps span {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #111827;
  font-weight: 900;
}
.pwa-install-success {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,.35);
  background: rgba(16,185,129,.10);
  font-weight: 800;
}
.pwa-install-lock { margin-top: 16px; font-size: 12px; color: var(--muted); }
@media (max-width: 520px) {
  .pwa-install-card { padding: 22px 18px; border-radius: 20px; }
  .pwa-install-card h1 { font-size: 26px; }
  .pwa-install-logo { width: 82px; height: 82px; }
}


/* ---------- Animated opening splash ---------- */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 480px at 50% 0%, rgba(245,158,11,.18), transparent 62%),
    radial-gradient(720px 380px at 100% 100%, rgba(59,130,246,.18), transparent 62%),
    linear-gradient(180deg, #070d18 0%, #0b1220 100%);
  overflow: hidden;
}
.app-splash.hide { opacity: 0; transition: opacity .55s ease; pointer-events: none; }
.app-splash-card {
  position: relative;
  width: min(90vw, 420px);
  text-align: center;
  padding: 34px 26px 30px;
  border-radius: 26px;
  border: 1px solid rgba(245,158,11,.28);
  background: linear-gradient(180deg, rgba(17,28,51,.95), rgba(10,16,32,.96));
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 45px rgba(245,158,11,.10);
}
.app-splash-glow {
  position: absolute; inset: -20% -10% auto -10%; height: 70%;
  background: radial-gradient(circle at 50% 35%, rgba(245,158,11,.28), transparent 55%);
  filter: blur(20px); pointer-events:none;
}
.app-splash-logo {
  position: relative;
  width: min(72vw, 240px);
  max-width: 240px;
  height: auto;
  object-fit: contain;
  animation: splashFloat 2.5s ease-in-out infinite, splashGlow 1.9s ease-in-out infinite alternate;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,.34));
}
.app-splash-title { margin-top: 14px; font-size: 32px; font-weight: 900; letter-spacing: -.5px; }
.app-splash-sub { margin-top: 4px; font-size: 14px; color: var(--accent-2); font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.app-splash-loader { display:flex; justify-content:center; gap:10px; margin-top: 22px; }
.app-splash-loader span {
  width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  animation: splashDot 1s infinite ease-in-out;
  box-shadow: 0 0 14px rgba(245,158,11,.45);
}
.app-splash-loader span:nth-child(2){ animation-delay:.15s; }
.app-splash-loader span:nth-child(3){ animation-delay:.3s; }
@keyframes splashFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}
@keyframes splashGlow {
  0% { filter: drop-shadow(0 10px 26px rgba(0,0,0,.34)); }
  100% { filter: drop-shadow(0 12px 34px rgba(245,158,11,.28)); }
}
@keyframes splashDot {
  0%,80%,100% { transform: translateY(0); opacity:.45; }
  40% { transform: translateY(-8px); opacity:1; }
}
@media (max-width: 520px) {
  .app-splash-card { padding: 28px 18px 24px; width: min(92vw, 360px); }
  .app-splash-title { font-size: 28px; }
  .app-splash-logo { max-width: 210px; }
}


/* ---------- Receipt action dock / WhatsApp ---------- */
.receipt-action-dock {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(calc(100vw - 24px), 560px);
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(10,18,34,.96);
  box-shadow: 0 14px 42px rgba(0,0,0,.45);
  backdrop-filter: blur(12px);
}
.receipt-action-dock .btn { flex: 1; min-height: 46px; }
.receipt-whatsapp-btn { background: #128c4a; color: #fff; border: 1px solid #25d366; }
.receipt-whatsapp-btn:hover { filter: brightness(1.08); }
.receipt-action-close { width: 38px; height: 38px; flex: 0 0 38px; border: 0; border-radius: 50%; background: var(--panel-2); color: #fff; font-size: 22px; cursor: pointer; }
@media(max-width:520px){.receipt-action-dock{flex-wrap:wrap}.receipt-action-dock .btn{min-width:calc(50% - 12px)}.receipt-action-close{position:absolute;right:-5px;top:-16px}}
@media print {.receipt-action-dock{display:none!important}}


/* =========================================================
   V2.17 DESIGN UPLIFT — logo-inspired blue/gold visual pass
   ========================================================= */
:root {
  --bg: #060b16;
  --bg-2: #091428;
  --panel: #0f1c34;
  --panel-2: #132544;
  --line: #20365f;
  --line-2: #2d4a7a;
  --text: #edf4ff;
  --muted: #9fb3d4;
  --muted-2: #7387a8;
  --accent: #f4b400;
  --accent-2: #ffd84d;
  --primary: #1f7cff;
  --primary-2: #4db2ff;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
}
html, body {
  background:
    radial-gradient(1000px 520px at 50% -10%, rgba(244,180,0,.10), transparent 60%),
    radial-gradient(900px 480px at 100% 20%, rgba(31,124,255,.09), transparent 60%),
    linear-gradient(180deg, #050a14 0%, #091120 100%);
}
.login-wrap {
  background:
    radial-gradient(1200px 680px at 0% 0%, rgba(244,180,0,.16), transparent 58%),
    radial-gradient(950px 560px at 100% 100%, rgba(31,124,255,.22), transparent 58%),
    linear-gradient(135deg, #07101d 0%, #0b1730 55%, #0a1326 100%);
}
.login-brand {
  position: relative;
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: 36px 24px 36px 24px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  pointer-events: none;
}
.login-brand > * { position: relative; z-index: 1; }
.login-brand h1 {
  font-size: 42px;
  background: linear-gradient(180deg, #ffffff 0%, #c9d8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { color: #bfd0ec; }
.brand-features li { color: #eef5ff; border-bottom-color: rgba(255,255,255,.08); }
.login-card {
  margin: 24px;
  border: 1px solid rgba(255,255,255,.07);
  border-left: 1px solid rgba(255,255,255,.07);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(18,31,56,.96), rgba(9,17,32,.96));
  box-shadow: 0 30px 80px rgba(0,0,0,.50), inset 0 1px 0 rgba(255,255,255,.04);
}
.pin-display span,
.keypad button,
.field input, .field select,
.search-row input {
  background: linear-gradient(180deg, rgba(10,22,44,.98), rgba(11,18,34,.98));
  border-color: rgba(90,130,190,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.pin-display span.filled {
  background: linear-gradient(180deg, rgba(244,180,0,.22), rgba(31,124,255,.16));
  color: #ffe48a;
  border-color: rgba(244,180,0,.35);
}
.keypad button:hover,
.field input:focus, .field select:focus,
.search-row input:focus {
  border-color: rgba(77,178,255,.55);
  box-shadow: 0 0 0 3px rgba(31,124,255,.12), inset 0 1px 0 rgba(255,255,255,.02);
}
#screen-app.active {
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(244,180,0,.06), transparent 60%),
    radial-gradient(820px 440px at 100% 0%, rgba(31,124,255,.08), transparent 60%),
    linear-gradient(180deg, #060b16 0%, #0a1324 100%);
}
.sidebar {
  background: linear-gradient(180deg, #0c1830 0%, #0b1426 100%);
  border-right: 1px solid rgba(84,118,175,.22);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.02);
}
.brand {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
}
.brand-title { font-size: 17px; color: #f7fbff; }
.brand-sub-sm { color: #a8bbd9; }
.nav-btn {
  border-radius: 14px;
  color: #a9bddb;
}
.nav-btn:hover {
  background: linear-gradient(135deg, rgba(31,124,255,.13), rgba(255,255,255,.03));
  border-color: rgba(77,178,255,.18);
}
.nav-btn.active {
  background: linear-gradient(135deg, rgba(244,180,0,.18), rgba(31,124,255,.22));
  border-color: rgba(244,180,0,.34);
  box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
}
.main { padding: 30px; }
.view-head h1 {
  background: linear-gradient(180deg, #ffffff 0%, #cbd9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.btn {
  border-radius: 12px;
  font-weight: 700;
}
.btn-primary {
  background: linear-gradient(135deg, #ffcc1d 0%, #f4b400 48%, #ff9f0a 100%);
  color: #08111f;
  border-color: rgba(255,212,77,.45);
  box-shadow: 0 12px 26px rgba(244,180,0,.24), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn-ghost {
  background: linear-gradient(180deg, rgba(19,37,68,.95), rgba(14,27,49,.95));
  border-color: rgba(83,122,184,.28);
}
.btn-ghost:hover { background: linear-gradient(180deg, rgba(25,46,82,.98), rgba(16,30,55,.98)); }
.btn-danger {
  background: linear-gradient(180deg, rgba(91,31,43,.40), rgba(69,20,31,.32));
}
.kpi,
.card,
.results-display-shell,
.modal-card {
  background: linear-gradient(180deg, rgba(17,28,51,.96), rgba(10,19,37,.96));
  border-color: rgba(83,122,184,.24);
  box-shadow: 0 18px 40px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.03);
}
.kpi::after,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 22%);
}
.card { position: relative; }
.card-head {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  border-bottom-color: rgba(83,122,184,.22);
}
.card-head h3, .kpi-value { color: #f7fbff; }
.kpi.accent {
  background: linear-gradient(135deg, rgba(244,180,0,.20), rgba(31,124,255,.18));
  border-color: rgba(244,180,0,.32);
}
.table-wrap {
  border: 1px solid rgba(83,122,184,.20);
  background: rgba(8,14,29,.35);
}
.data-table th {
  background: linear-gradient(180deg, #132340 0%, #10203a 100%);
  color: #d7e3f9;
}
.data-table tr:hover td { background: rgba(77,178,255,.04); }
.seg {
  background: linear-gradient(180deg, rgba(18,32,58,.95), rgba(12,23,42,.95));
  border-color: rgba(83,122,184,.22);
}
.seg-btn.active {
  background: linear-gradient(135deg, rgba(244,180,0,.18), rgba(31,124,255,.14));
  color: #f6fbff;
  box-shadow: inset 0 0 0 1px rgba(244,180,0,.18);
}
.quickpick-preview.has-number,
.webpull-nums,
.checked-ticket-total,
.text-pos { color: #ffd84d; }
.modal-card {
  border-radius: 22px;
}
.toast {
  border-radius: 14px;
}
@media (max-width: 760px) {
  .login-card { margin: 12px; border-radius: 22px; }
  .main { padding: 18px; }
}

/* V2.18 Admin 8-digit / Cashier 4-digit PIN */
.pin-display-8 { gap: 8px; flex-wrap: nowrap; }
.pin-display-8 span { width: 44px; height: 52px; border-radius: 12px; }
@media (max-width: 520px) {
  .pin-display-8 { gap: 5px; }
  .pin-display-8 span { width: 34px; height: 44px; font-size: 20px; }
}

/* V2.38 Multi-location ticket + ST/MIX quick entry */
.qp-location-field { grid-column: span 2; }
.qp-location-buttons { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.qp-loc-btn { appearance:none; border:1px solid rgba(104,145,210,.35); background:rgba(13,28,52,.78); color:#dbe9ff; border-radius:12px; min-width:62px; padding:10px 14px; font-weight:800; cursor:pointer; transition:.18s ease; }
.qp-loc-btn:hover { transform:translateY(-1px); border-color:rgba(255,216,77,.55); }
.qp-loc-btn.active { background:linear-gradient(135deg,rgba(244,180,0,.26),rgba(31,124,255,.24)); color:#fff7c2; border-color:rgba(255,216,77,.85); box-shadow:0 0 0 2px rgba(255,216,77,.08),0 8px 22px rgba(0,0,0,.18); }
.qp-mix-badge { display:inline-flex; align-items:center; justify-content:center; padding:2px 7px; border-radius:8px; background:rgba(244,180,0,.18); color:#ffd84d; border:1px solid rgba(244,180,0,.34); font-size:11px; letter-spacing:.05em; }
.qp-number-field input { font-size:22px; font-weight:900; letter-spacing:.14em; }
@media (max-width:760px){ .qp-location-field{grid-column:1/-1}.qp-loc-btn{flex:1 1 58px;padding:11px 10px}.qp-money{grid-column:span 1} }

/* V2.40: ST / BOX / MIX are separate quick-entry controls */
.qp-mix-field{align-self:stretch}
.qp-mix-toggle{min-height:44px;font-weight:900;border-color:rgba(244,180,0,.45)}
.qp-mix-toggle.active{box-shadow:0 0 0 2px rgba(244,180,0,.22),0 10px 24px rgba(0,0,0,.18)}
.qp-mix-panel{margin-top:8px;display:grid;grid-template-columns:minmax(150px,1fr) minmax(100px,.45fr);gap:8px}
.qp-mix-panel[hidden]{display:none}
.qp-mix-panel input{width:100%}
.qp-mix-panel small{grid-column:1/-1}
@media(max-width:720px){.qp-mix-panel{grid-template-columns:1fr}}

/* V2.42 mobile PIN keypad hardening */
#screen-login .keypad{display:grid!important;grid-template-columns:repeat(3,minmax(64px,1fr))!important;gap:10px!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;}
#screen-login .keypad button{display:flex!important;align-items:center!important;justify-content:center!important;min-height:58px!important;visibility:visible!important;opacity:1!important;color:var(--text)!important;-webkit-tap-highlight-color:transparent;touch-action:manipulation;}
@media(max-width:520px){#screen-login .login-card{padding:28px 18px!important}.pin-display{justify-content:center}.pin-display span{width:52px;height:52px}.keypad button{font-size:24px!important;min-height:60px!important}}

/* V2.44: Android/PWA keypad touch reliability */
#screen-login .keypad,
#screen-login .keypad *{pointer-events:auto!important;}
#screen-login .keypad button{
  position:relative!important;
  z-index:2!important;
  user-select:none!important;
  -webkit-user-select:none!important;
  -webkit-touch-callout:none!important;
  touch-action:manipulation!important;
  cursor:pointer!important;
}
#screen-login .login-card{position:relative;z-index:3;}


/* V2.46 direct-click cashier PIN input */
.cashier-pin-input{
  display:block!important;width:100%!important;box-sizing:border-box!important;
  margin:14px 0 10px!important;padding:14px 16px!important;text-align:center!important;
  letter-spacing:14px!important;font-size:26px!important;font-weight:800!important;
  border-radius:14px!important;border:1px solid var(--line-2)!important;
  background:var(--panel-2)!important;color:var(--text)!important;
  position:relative!important;z-index:5!important;pointer-events:auto!important;
  touch-action:manipulation!important;
}
#screen-login .keypad button{z-index:6!important;pointer-events:auto!important;touch-action:manipulation!important;}


/* V2.47 keypad-only login: no OS keyboard, reliable Sign In */
#screen-login .login-actions{position:relative!important;z-index:10!important;pointer-events:auto!important;}
#screen-login #btn-login,#screen-login #btn-clear-pin{position:relative!important;z-index:11!important;pointer-events:auto!important;touch-action:manipulation!important;}
#screen-login #btn-login{min-height:52px!important;}

/* V2.48 native phone keyboard PIN login */
#screen-login .keypad, #screen-login .pin-display { display:none !important; }
#screen-login .native-pin-field { margin-top:18px; }
#screen-login .native-pin-input {
  width:100%; min-height:58px; text-align:center; font-size:30px; font-weight:800;
  letter-spacing:14px; border-radius:14px; padding:10px 14px;
}
#screen-login .native-pin-input::placeholder { letter-spacing:10px; opacity:.45; }

/* V2.49 native cashier PIN input */
#screen-login #keypad, #screen-login .pin-display { display:none !important; }
#cashier-pin-input { width:100%; min-height:54px; font-size:28px; letter-spacing:14px; text-align:center; font-weight:800; }
.cashier-pin-field { display:block; margin:16px 0; }
#btn-login { pointer-events:auto !important; touch-action:manipulation; }


/* V2.52 MIX checkbox */
.qp-mix-check-label{display:flex;align-items:center;gap:10px;min-height:46px;padding:10px 12px;border:1px solid var(--border,#334155);border-radius:12px;cursor:pointer;user-select:none}
.qp-mix-check-label input{width:24px;height:24px;accent-color:#f59e0b;flex:0 0 auto}
.qp-mix-check-label strong{font-size:15px}
.qp-mix-check-label small{margin-left:auto;opacity:.72}

/* V2.54 inline MIX checkbox */
.qp-number-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.qp-mix-inline{margin-left:auto;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border:1px solid rgba(245,158,11,.5);border-radius:9px;cursor:pointer;background:rgba(245,158,11,.08);user-select:none}
.qp-mix-inline input{width:20px;height:20px;accent-color:#f59e0b;margin:0}
.qp-mix-inline strong{font-size:13px;letter-spacing:.04em}
.qp-mix-amount-field input:disabled,.qp-money input:disabled{opacity:.5;cursor:not-allowed}

/* V2.55 simplified bet entry: 2 Ball ST only, 3/4 Ball ST+BOX, MIX single amount */
.qp-number-inline{display:flex;align-items:stretch;gap:10px}
.qp-number-inline #qp-number{flex:1;min-width:0}
.qp-mix-inline{display:flex;align-items:center;justify-content:center;gap:7px;min-width:88px;padding:0 12px;border:1px solid rgba(244,180,0,.42);border-radius:12px;background:rgba(244,180,0,.08);cursor:pointer;font-weight:900}
.qp-mix-inline input{width:19px;height:19px;accent-color:#f4b400}
#qp-box-field[hidden],#qp-mix-amount-field[hidden],#qp-st-field[hidden]{display:none!important}
@media(max-width:520px){.qp-number-inline{gap:7px}.qp-mix-inline{min-width:78px;padding:0 9px}.qp-number-inline #qp-number{font-size:20px}}

/* V2.78 Smart Dashboard + Fast Sell + Offline Queue */
.ops-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 16px}.ops-card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:5px;box-shadow:0 8px 24px rgba(0,0,0,.05)}.ops-card>span{font-size:12px;font-weight:800;color:var(--muted)}.ops-card>strong{font-size:18px}.ops-card>small{color:var(--muted);font-size:11px}.sync-queue-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;margin:0 0 16px;border:1px solid #f59e0b;border-radius:14px;background:rgba(245,158,11,.10)}.sync-queue-card>div{display:flex;flex-direction:column;gap:2px}.sync-queue-card span{font-size:12px;color:var(--muted)}.fast-sell-hint{margin-top:10px;padding:10px 12px;border-radius:12px;background:rgba(34,197,94,.11);border:1px solid rgba(34,197,94,.35);font-size:12px;font-weight:800}.fast-sell-on #btn-fast-sell{box-shadow:0 0 0 2px rgba(34,197,94,.28) inset}.fast-sell-on #qp-number{border-color:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.12)}
@media(max-width:900px){.ops-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.ops-grid{grid-template-columns:1fr 1fr;gap:8px}.ops-card{padding:11px}.ops-card>strong{font-size:15px}.sync-queue-card{align-items:flex-start}}

/* V2.82 Mobile compact layout: tuned for 360-520px phones */
@media (max-width: 520px) {
  html { font-size: 14px; }
  body { overflow-x: hidden; }
  .main { padding: 8px !important; }
  .view-head { margin-bottom: 12px; gap: 8px; }
  .view-head h1 { font-size: 19px; line-height: 1.12; }
  .view-head p, .view-head .muted { font-size: 11px; }

  .card { border-radius: 12px; margin-bottom: 10px; }
  .card-head { padding: 10px 12px; gap: 6px; }
  .card-head h3 { font-size: 13px; }
  .card-body { padding: 11px; }

  .kpis { gap: 7px; margin-bottom: 10px; }
  .kpi { padding: 10px; border-radius: 12px; }
  .kpi-label { font-size: 11px; }
  .kpi-value { font-size: 19px; margin-top: 3px; }
  .kpi-sub { font-size: 10px; }

  .ops-grid { gap: 6px !important; margin-bottom: 10px; }
  .ops-card { padding: 9px !important; border-radius: 12px; gap: 3px; }
  .ops-card > span { font-size: 10px; }
  .ops-card > strong { font-size: 14px !important; }
  .ops-card > small { font-size: 9px; }

  .btn { min-height: 38px !important; padding: 8px 10px; font-size: 12px; border-radius: 9px; gap: 5px; }
  .btn.big { min-height: 42px !important; padding: 9px 12px; font-size: 13px; }
  .btn.sm { min-height: 34px !important; padding: 6px 9px; font-size: 11px; }
  .head-actions .btn, .btn-row .btn { flex: 1 1 104px; }

  input, select, textarea { font-size: 16px !important; }
  input, select { min-height: 40px !important; padding-top: 8px; padding-bottom: 8px; }
  label, .field-label { font-size: 11px; }

  .quickpick-grid { gap: 8px; }
  .qp-location-buttons { gap: 5px; }
  .qp-loc-btn { min-width: 52px; padding: 8px 7px !important; border-radius: 9px; font-size: 11px; }
  .qp-number-field input, .qp-number-inline #qp-number { font-size: 18px !important; letter-spacing: .08em; }
  .qp-number-inline { gap: 5px !important; }
  .qp-mix-inline { min-width: 68px !important; padding: 0 7px !important; border-radius: 9px; }
  .qp-mix-inline strong { font-size: 11px; }
  .qp-mix-inline input { width: 17px; height: 17px; }
  .quickpick-preview { min-height: 44px; margin-top: 9px; font-size: 12px; }
  .quickpick-preview.has-number { font-size: 19px; }

  .cart-list { max-height: 210px; }
  .cart-item { padding: 8px; gap: 7px; }
  .cart-item .ci-info { font-size: 11px; }
  .cart-item .ci-game { font-size: 11px; }
  .cart-item .ci-meta { font-size: 9px; }
  .cart-item .ci-amt { font-size: 11px; }

  .sync-queue-card { padding: 9px 10px; margin-bottom: 10px; gap: 8px; border-radius: 11px; }
  .sync-queue-card strong { font-size: 12px; }
  .sync-queue-card span { font-size: 10px; }
  .fast-sell-hint { margin-top: 7px; padding: 7px 9px; font-size: 10px; }

  .checked-ticket-card { padding: 11px; border-radius: 12px; }
  .checked-ticket-number { font-size: 14px; }
  .checked-ticket-total { font-size: 18px; }
  .checked-ticket-meta { font-size: 10px; gap: 5px 10px; }

  .table-wrap { border-radius: 8px; }
  .data-table th, .data-table td { padding: 8px 7px; font-size: 11px; }

  .brand-logo.sm { width: 32px; height: 32px; border-radius: 8px; }
  .brand-title { font-size: 14px; }
  .brand-sub-sm { font-size: 10px; }

  .results-display-shell { border-radius: 10px; min-height: 500px; }
  .results-display-frame { min-height: 500px; height: 72vh; }
}

@media (max-width: 380px) {
  .main { padding: 6px !important; }
  .kpis, .ops-grid { grid-template-columns: 1fr 1fr !important; gap: 5px !important; }
  .card-body { padding: 9px; }
  .qp-loc-btn { min-width: 48px; font-size: 10px; padding: 7px 5px !important; }
  .btn { font-size: 11px; padding-left: 8px; padding-right: 8px; }
}
/* V2.83 Operations Pro */
.pro-dark body,.pro-dark{filter:none}.chips{display:flex;gap:8px;flex-wrap:wrap}.chip{padding:7px 10px;border-radius:999px;background:rgba(57,134,255,.12);border:1px solid rgba(91,157,255,.22);font-size:12px}.setting-row{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid rgba(120,150,190,.14)}.alert{padding:11px 13px;border-radius:12px;margin:8px 0}.alert.warning{background:rgba(255,185,55,.12);border:1px solid rgba(255,185,55,.28)}.alert.success{background:rgba(58,207,133,.10);border:1px solid rgba(58,207,133,.24)}
.pro-dark body{background:#050912!important}

/* V2.92: Activity & Receipts forced into first menu positions */
.nav-btn-activity{background:linear-gradient(135deg,rgba(244,180,0,.22),rgba(31,124,255,.16))!important;border:1px solid rgba(244,180,0,.38)!important;color:#fff!important;font-weight:800!important;margin:4px 0 8px!important;}
.nav-btn-activity .nav-ico{filter:drop-shadow(0 0 6px rgba(244,180,0,.5));}

/* V2.96 Triples quick action */
.quick-action-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:stretch;margin-top:12px}
.quick-action-row .btn{margin:0}
.triples-hint{margin-top:7px}
@media(max-width:560px){.quick-action-row{grid-template-columns:1fr 0.42fr;gap:8px}.quick-action-row .btn{padding-left:10px;padding-right:10px}.triples-hint{font-size:11px}}
