: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); }

.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; }

/* ---------- 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; }
.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; }
.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; }
}

/* ---------- Receipt ---------- */
.receipt-host { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .receipt-host {
    display: block !important;
    position: absolute;
    inset: 0;
    padding: 24px;
  }
  .receipt {
    width: 80mm;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    color: #000;
  }
  .receipt h2 { margin: 0 0 4px; text-align: center; font-size: 14px; }
  .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 .nums { font-size: 14px; font-weight: 700; letter-spacing: 1px; }
  .receipt .barcode { text-align: center; margin: 8px 0; font-family: monospace; }
}

/* ---------- 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); }
  .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; }
}
