/* ================================================================
   Estilo — paleta original del proyecto (referencia: pantalla de tickets)
   ================================================================ */
:root {
  --bar: #2f2f31;          /* barra superior negra */
  --bar-2: #4a4a4c;        /* barra de loterías */
  --purple: #8c8cf9;       /* barra de opciones */
  --purple-2: #6566f2;     /* degradado encabezados */
  --purple-3: #9d9efc;
  --active-lot: #2b2bf0;   /* lotería seleccionada */
  --panel: #ececec;        /* fondo columnas */
  --foot: #3c3e4c;         /* pie de columnas */
  --cyan: #4bbcd9;         /* botón login */
  --login-a: #b2343a;      /* degradado login */
  --login-b: #545a22;
  --ink: #1f1f24;
  --muted: #6b6b76;
  --line: #d6d6de;
  --white: #ffffff;
  --ok: #1f9d55;
  --warn: #d68a00;
  --err: #d43b3b;
  --radius: 6px;
  --shadow: 0 6px 24px rgba(0,0,0,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink); background: #f6f6f9; font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--purple-2); }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(160deg, var(--login-a), var(--login-b));
}
.login-wrap { width: 100%; max-width: 360px; text-align: center; }
.login-title { color: #fff; font-size: clamp(32px, 7vw, 46px); font-weight: 400; margin: 0 0 14px; letter-spacing: .5px; }
.login-card { background: #fff; border: 4px solid #3a3a3e; padding: 22px 28px 26px; box-shadow: var(--shadow); }
.login-card h2 { font-weight: 400; font-size: 26px; margin: 0 0 20px; }
.login-card input {
  width: 100%; border: 0; background: #e4e7ee; padding: 9px 12px; margin-bottom: 14px; text-align: center; border-radius: 2px;
}
.login-card input:focus { outline: 2px solid var(--cyan); background: #eef1f6; }
.login-err { color: var(--err); font-size: 13px; min-height: 18px; margin: -4px 0 8px; }
.btn-login { background: var(--cyan); color: #fff; border: 0; padding: 10px 22px; font-weight: 700; font-size: 13px; letter-spacing: .5px; cursor: pointer; }
.btn-login:disabled { opacity: .6; }
.login-foot { margin-top: 18px; display: flex; justify-content: center; }
.lang-select { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 4px; padding: 3px 6px; }
.login-page .lang-select { color: #fff; border-color: rgba(255,255,255,.6); }
.login-page .lang-select option { color: #000; }

/* ---------- Barra superior ---------- */
.topbar {
  background: var(--bar); color: #fff; height: 50px; display: flex; align-items: center; gap: 6px;
  padding: 0 12px; position: sticky; top: 0; z-index: 30;
}
.topbar .brand { font-weight: 700; font-size: 20px; letter-spacing: .5px; text-transform: uppercase; margin: 0 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .clock { font-size: 18px; white-space: nowrap; }
.topbar .lang-select { color: #fff; border-color: #666; }
.topbar .lang-select option { color: #000; }
.tb-btn { background: none; border: 0; color: #fff; padding: 8px 10px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; border-radius: 4px; font-size: 15px; }
.tb-btn:hover, .tb-btn[aria-expanded="true"] { background: rgba(255,255,255,.1); }
.menu { position: relative; }
.menu-list {
  position: absolute; top: 100%; left: 0; background: #fff; color: var(--ink); min-width: 220px; box-shadow: var(--shadow);
  border-radius: 0 0 var(--radius) var(--radius); padding: 6px 0; z-index: 40;
}
.menu-list button { display: flex; width: 100%; text-align: left; padding: 10px 16px; border: 0; background: none; cursor: pointer; gap: 10px; align-items: center; }
.menu-list button:hover, .menu-list button.on { background: #efefff; color: var(--purple-2); }
.who { font-size: 13px; opacity: .85; white-space: nowrap; }

/* ---------- Pestañas de loterías ---------- */
.lotbar { display: flex; background: var(--bar-2); height: 46px; position: sticky; top: 50px; z-index: 20; }
.lotbar .arrow { width: 48px; border: 0; background: var(--bar-2); color: #fff; cursor: pointer; font-size: 18px; flex: none; }
.lotbar .arrow:hover { background: #5a5a5c; }
.lot-tabs { display: flex; overflow-x: auto; scroll-behavior: smooth; flex: 1; scrollbar-width: none; }
.lot-tabs::-webkit-scrollbar { display: none; }
.lot-tab {
  flex: 0 0 auto; min-width: 150px; border: 0; cursor: pointer; font-weight: 700; font-size: 13px; text-transform: uppercase;
  padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 6px; position: relative;
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.lot-tab.on { background: var(--active-lot) !important; color: #fff !important; }
.lot-tab.closed { opacity: .45; }
.lot-tab .tm { font-weight: 400; font-size: 11px; opacity: .9; }
.lot-tab .chk { display: none; }
.mult .lot-tab .chk { display: inline; }

/* ---------- Barra de opciones (morada) ---------- */
.toolbar { background: var(--purple); padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.tool-btn {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.85); border-radius: 3px; height: 40px; min-width: 50px;
  padding: 0 18px; font-weight: 700; font-size: 12px; letter-spacing: .4px; cursor: pointer; text-transform: uppercase;
}
.tool-btn:hover { background: rgba(255,255,255,.15); }
.tool-btn:disabled { opacity: .5; cursor: default; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 60px; height: 28px; border-radius: 14px; background: #d9d9d9; position: relative; cursor: pointer; transition: .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked { background: #6fcf97; }
.switch input:checked::after { left: 35px; }
.toolbar input[type=date], .toolbar select { height: 40px; border: 0; border-radius: 3px; padding: 0 10px; background: #fff; }

/* ---------- Zona de captura ---------- */
.entry { display: grid; grid-template-columns: 236px 170px 236px 1fr; gap: 10px 30px; padding: 8px 16px 10px; align-items: start; }
.big-input {
  width: 100%; height: 50px; font-size: 34px; text-align: center; border: 1px solid #ccc; background: #fff; text-transform: uppercase;
}
.big-input:focus { outline: none; border: 2px solid #3d63c9; }
.big-input::placeholder { color: #9a9a9a; }
.big-input.na { background: #e6e6e6; border-color: #e6e6e6; color: #777; font-size: 30px; }
.big-input.err { border-color: var(--err); animation: shake .25s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.entry-row2 { display: flex; height: 48px; }
.entry-row2 select { flex: 1; min-width: 0; border: 1px solid #ccc; background: #fff; padding: 0 8px; }
.sq-btn { width: 42px; border: 0; background: #b5b5b5; color: #fff; cursor: pointer; font-size: 16px; }
.sq-btn:hover { background: #9c9c9c; }
.stat-inline { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-weight: 700; font-size: 14px; }
.stat-inline output { background: #e6e6e6; min-width: 42px; height: 48px; display: grid; place-items: center; font-size: 34px; font-weight: 400; padding: 0 10px; }
.stat-inline output.money { font-size: 32px; min-width: 120px; }

/* ---------- Columnas de jugadas ---------- */
.cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding: 6px 16px 20px; }
.col { display: flex; flex-direction: column; min-height: 360px; }
.col-head { background: linear-gradient(var(--purple-3), var(--purple-2)); color: #fff; border-radius: 10px 10px 0 0; text-align: center; font-weight: 700; font-size: 18px; padding: 12px 6px 8px; }
.col-sub { display: grid; grid-template-columns: 1fr 1.3fr .8fr 42px; background: var(--purple-2); color: #fff; font-size: 18px; text-align: center; }
.col-sub span { padding: 6px 0; border-right: 1px solid rgba(255,255,255,.25); }
.col-sub span:last-child { border: 0; }
.col-body { background: var(--panel); flex: 1; overflow-y: auto; max-height: 46vh; }
.play-row { display: grid; grid-template-columns: 1fr 1.3fr .8fr 42px; text-align: center; font-size: 15px; border-bottom: 1px solid #ddd; align-items: center; }
.play-row span { padding: 7px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-row .num { font-weight: 700; letter-spacing: .5px; }
.play-row small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.play-row button { border: 0; background: none; cursor: pointer; color: #888; font-size: 16px; }
.play-row button:hover { color: var(--err); }
.col-foot { background: var(--foot); color: #fff; text-align: center; font-size: 18px; padding: 8px 0; }

/* ---------- Páginas de gestión ---------- */
.page { padding: 18px 16px 40px; max-width: 1280px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 22px; margin: 0; flex: 1; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 14px 16px; }
.card .k { color: var(--muted); font-size: 13px; }
.card .v { font-size: 28px; font-weight: 700; margin-top: 4px; }
.card.accent { background: linear-gradient(var(--purple-3), var(--purple-2)); color: #fff; }
.card.accent .k { color: rgba(255,255,255,.85); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.panel h2 { font-size: 15px; margin: 0; padding: 12px 14px; background: var(--purple); color: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select, .form input, .form select, .form textarea {
  height: 40px; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px; background: #fff; min-width: 0;
}
.form textarea { height: auto; padding: 8px 10px; }
.filters input:focus, .filters select:focus, .form input:focus, .form select:focus { outline: 2px solid var(--purple); border-color: transparent; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--purple-2); color: #fff; text-align: left; font-weight: 700; padding: 10px; white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
tr:hover td { background: #fafaff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; font-size: 14px; }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 4px; height: 38px; padding: 0 14px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--purple-2); color: var(--purple-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--purple-2); border-color: var(--purple-2); color: #fff; }
.btn-primary:hover { background: #5253e0; color: #fff; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { background: #b92f2f; color: #fff; border-color: #b92f2f; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 18px; padding: 4px 8px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-active { background: #e7e7ff; color: #4142c9; }
.st-winner { background: #d9f6e4; color: #157a40; }
.st-loser { background: #eee; color: #666; }
.st-paid { background: #dff1fb; color: #1a6e93; }
.st-cancelled { background: #fde3e3; color: #b42727; }
.st-on { background: #d9f6e4; color: #157a40; }
.st-off { background: #fde3e3; color: #b42727; }
.st-draft { background: #fff2d6; color: #8a5a00; }
.res-balls { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ball { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 16px; padding: 0 8px; background: var(--active-lot); color: #fff; font-weight: 700; font-size: 14px; }
.ball.b2 { background: var(--purple-2); }
.ball.b3 { background: var(--purple-3); }
.ball.alt { background: var(--foot); }
.color-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(0,0,0,.15); }

/* ---------- Ventanas ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(20,20,30,.5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 460px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; padding: 12px 16px; background: var(--purple-2); color: #fff; border-radius: 8px 8px 0 0; }
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-head .icon-btn { color: #fff; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid #eee; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.form .check input { width: 18px; height: 18px; }
.days-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.days-pick label { display: inline-flex; align-items: center; gap: 2px; background: #f1f1f8; padding: 4px 8px; border-radius: 4px; color: var(--ink); }
.help-table td { padding: 6px 8px; }
.help-table td:first-child { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; width: min(92vw, 420px); }
.toast { background: var(--ok); color: #fff; padding: 12px 16px; border-radius: 6px; box-shadow: var(--shadow); transition: opacity .4s; font-weight: 600; }
.toast-err { background: var(--err); }
.toast-info { background: var(--purple-2); }
.toast.out { opacity: 0; }

.loading-screen { position: fixed; inset: 0; display: grid; place-items: center; background: #f6f6f9; z-index: 300; color: var(--muted); }

/* ---------- Ticket impreso ---------- */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; width: 72mm; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #000; }
  #print-area h3 { text-align: center; margin: 0 0 4px; font-size: 16px; }
  #print-area .c { text-align: center; }
  #print-area table { font-size: 12px; }
  #print-area th { background: none; color: #000; border-bottom: 1px dashed #000; padding: 2px; }
  #print-area td { border: 0; padding: 2px; }
  @page { margin: 4mm; }
}

/* ---------- Adaptación a pantallas ---------- */
@media (max-width: 1100px) {
  .entry { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cols { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .topbar .clock { font-size: 14px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { height: 48px; padding: 0 6px; }
  .topbar .brand { font-size: 15px; }
  .topbar .clock, .who { display: none; }
  .lotbar { top: 48px; height: 44px; }
  .lotbar .arrow { width: 34px; }
  .lot-tab { min-width: 118px; font-size: 11px; }
  .toolbar { padding: 8px; gap: 8px; }
  .tool-btn { height: 36px; padding: 0 10px; min-width: 40px; }
  .entry { padding: 8px; }
  .big-input { font-size: 26px; height: 46px; }
  .stat-inline output { font-size: 24px; height: 44px; }
  .stat-inline output.money { font-size: 22px; min-width: 90px; }
  .cols { grid-template-columns: 1fr; padding: 6px 8px 16px; }
  .col { min-height: 0; }
  .col-body { min-height: 60px; max-height: none; }
  .form .row { grid-template-columns: 1fr; }
  .page { padding: 14px 10px 30px; }
  .card .v { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 640px) {
  .topbar .quick, .topbar .lbl { display: none; }
  .topbar .brand { margin: 0 auto 0 4px; }
}

/* ---------- Pantalla de jugadas: admin / jugador ---------- */
.pos-user .adm, .pos-admin .usr { display: none !important; }
.balance-chip { background: #fff; color: var(--ink); border-radius: 3px; height: 40px; padding: 0 14px; display: flex; align-items: center; gap: 6px; font-size: 15px; }
.balance-chip b { font-size: 18px; }
.entry-hint { flex: 1; display: flex; align-items: center; padding: 0 10px; font-size: 13px; color: var(--muted); background: #fff; border: 1px solid #ccc; min-width: 0; }
.lot-tab[disabled] { cursor: not-allowed; }
.review-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.review-sum div { background: #f3f3fb; border-radius: 6px; padding: 10px 12px; display: grid; gap: 2px; }
.review-sum span { font-size: 12px; color: var(--muted); }
.review-sum b { font-size: 20px; font-variant-numeric: tabular-nums; }
.neg, td.neg { color: var(--err); }
.pos-amt { color: var(--ok); }
.warn-line { color: var(--err); font-weight: 700; margin: 10px 0 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; background: #fff; padding: 12px; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 12px; }
.inline-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.inline-form input, .inline-form select { height: 38px; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; background: #fff; }
.tbl-input { width: 100px; height: 34px; text-align: right; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.section-title { font-size: 17px; margin: 22px 0 10px; }
@media (max-width: 640px) { .review-sum { grid-template-columns: 1fr; } .balance-chip { height: 36px; } }
.inline-form label { white-space: nowrap; }

/* ---------- Ticket térmico ---------- */
@media print {
  #print-area.paper-58 { width: 48mm; font-size: 10px; }
  #print-area.paper-80 { width: 72mm; font-size: 12px; }
  .tk { font-family: ui-monospace, Menlo, Consolas, monospace; color: #000; }
  .tk-brand { text-align: center; font-weight: 700; font-size: 1.5em; text-transform: uppercase; margin-bottom: 2px; }
  .tk-c { text-align: center; line-height: 1.35; }
  .tk-small { font-size: .85em; }
  .tk-line { border-top: 1px dashed #000; margin: 4px 0; }
  .tk-t { width: 100%; border-collapse: collapse; font-size: 1em; }
  .tk-t th { text-align: left; font-weight: 700; border-bottom: 1px solid #000; padding: 1px 0; background: none; color: #000; }
  .tk-t td { padding: 1px 0; border: 0; vertical-align: top; }
  .tk-t .n { font-weight: 700; }
  .tk-t .r, .tk-t th.r { text-align: right; }
  .tk-total { display: flex; justify-content: space-between; font-size: 1.3em; font-weight: 700; margin: 2px 0 6px; }
  .tk-qr { width: 26mm; margin: 0 auto 2px; }
  .paper-58 .tk-qr { width: 22mm; }
  .tk-qr svg { width: 100%; height: auto; display: block; }
}

/* ---------- Confirmación de ticket creado ---------- */
.ticket-flash { display: flex; align-items: center; gap: 12px; background: #e3f7ea; border: 2px solid var(--ok); color: #135a31; border-radius: 6px; padding: 8px 12px; font-weight: 700; animation: flash-in .25s ease-out; }
.ticket-flash .serial { font-family: ui-monospace, Menlo, monospace; font-size: 18px; }
.ticket-flash small { font-weight: 600; color: #2b6a45; }
@keyframes flash-in { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.kbd-hint { font-size: 12px; color: rgba(255,255,255,.9); font-weight: 600; white-space: nowrap; }
.toolbar select.paper { height: 40px; border: 0; border-radius: 3px; padding: 0 8px; background: #fff; }
.bal-pos { color: var(--ok); }
.bal-neg { color: var(--err); }
.card .sub { font-size: 12px; margin-top: 2px; font-weight: 600; }
.card.accent .sub { color: rgba(255,255,255,.9); }
tr.sel td { background: #f3f3ff; }
@media (max-width: 640px) { .kbd-hint { display: none; } }

/* ---------- Acciones rápidas (antes: panel del balance) ---------- */
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.side-actions [data-r="banner"] { grid-column: 1 / -1; }
.big-action { display: flex; align-items: center; gap: 10px; min-height: 108px; padding: 12px 14px; border-radius: 8px; border: 0; cursor: pointer; text-align: left; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); transition: transform .08s, filter .15s; }
.big-action:hover { filter: brightness(1.06); }
.big-action:active { transform: scale(.98); }
.big-action:focus-visible { outline: 3px solid var(--active-lot); outline-offset: 2px; }
.big-action .ico { font-size: 28px; line-height: 1; }
.big-action b { display: block; font-size: 16px; letter-spacing: .4px; text-transform: uppercase; }
.big-action small { display: block; font-size: 12px; opacity: .85; margin-top: 4px; }
.big-action.cancel { background: linear-gradient(#e0605f, #c63d3d); }
.big-action.list { background: linear-gradient(var(--purple-3), var(--purple-2)); }
.tk-browser .filters { margin-bottom: 10px; }
.tk-row { cursor: pointer; }
.tk-row:focus-visible td { background: #ececff; outline: none; }
.tk-row.is-cancelled td { color: #9a9aa6; }
.tk-row.is-cancelled td .mono b { text-decoration: line-through; }
.tk-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 12px 0; }
.tk-head div { background: #f3f3fb; border-radius: 6px; padding: 8px 10px; display: grid; gap: 2px; }
.tk-head span { font-size: 12px; color: var(--muted); }
.tk-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.tk-total-big { font-size: 18px; }
@media (max-width: 1100px) { .side-actions { grid-column: 1 / -1; } .big-action { min-height: 70px; } }
@media (max-width: 640px) { .side-actions { grid-template-columns: 1fr 1fr; } .big-action { min-height: 60px; padding: 10px; } .big-action b { font-size: 13px; } .big-action .ico { font-size: 20px; } }
.review-sum small { font-size: 11px; color: var(--muted); }
@media (max-width: 640px) { .topbar .who.keep { display: inline; font-size: 12px; margin-left: auto; } .topbar:has(.who.keep) .brand { display: none; } }

/* ---------- Barra de selección de tickets ---------- */
.entry-row2 .ticket-select { flex: 1; min-width: 0; border: 1px solid #ccc; background: #fff; padding: 0 8px; font-size: 14px; }
.entry-row2 .ticket-select:focus { outline: 2px solid #3d63c9; border-color: transparent; }
.ticket-select option.opt-cancelled { color: #9a9aa6; }
.sq-btn.sq-cancel { background: #d06a6a; }
.sq-btn.sq-cancel:hover { background: #b94f4f; }
.toolbar .player-select { height: 40px; border: 0; border-radius: 3px; padding: 0 8px; background: #fff; max-width: 260px; }
@media (max-width: 640px) { .toolbar .player-select { max-width: 100%; flex: 1 1 100%; } }
@media (max-width: 1500px) { .pos-admin .kbd-hint { display: none; } .toolbar .player-select { max-width: 200px; } }
.side-actions { grid-template-columns: 1fr; align-content: center; }

/* ---------- Ticket: código de barras, PIN, copia y comprobante ---------- */
.st-cashed { background: #dff1fb; color: #0f5a7d; border: 1px solid #9fd2ea; }
@media print {
 .tk-serial { font-size: 1.15em; margin-top: 2px; }
 .tk-pin { font-size: 1.15em; }
 .tk-copy { text-align: center; font-weight: 700; letter-spacing: 1px; margin: 2px 0; }
 .tk-bar { margin: 4px auto 2px; width: 100%; }
 .tk-bar svg { display: block; width: 100%; height: 14mm; }
 .paper-58 .tk-bar svg { height: 12mm; }
 .tk-void { text-align: center; font-weight: 800; font-size: 1.6em; line-height: 1.15; border: 2px solid #000; padding: 4px; margin: 4px 0; }
 .tk-msg { font-weight: 700; margin-top: 4px; }
}

/* ---------- MONTO más a la derecha (mismo tamaño) ---------- */
@media (min-width: 1101px) {
 .entry { grid-template-columns: 236px 170px 1fr 236px; }
 .entry > div:nth-child(3) { grid-column: 4; grid-row: 1; }
 .entry > .side-actions { grid-column: 3; grid-row: 1; align-self: center; }
}
/* Premios: resultados del día */
.res-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.res-strip .card { padding: 10px 12px; }
.res-strip .card .k { font-weight: 700; color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 0 14px; height: 38px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--purple-2); color: #fff; }
.perm-notice { background: #fde3e3; color: #8f1f1f; border: 2px solid #e8a5a5; border-radius: 6px; padding: 8px 12px; font-weight: 700; }

/* ---------- Permisos ---------- */
.perm-form { display: grid; gap: 14px; padding: 14px; }
.perm-switches { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.perm-switches .check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.perm-switches input[type=checkbox] { width: 18px; height: 18px; }
.inline-num { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.inline-num input { width: 80px; height: 34px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.perm-list { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 0; }
.perm-list legend { font-weight: 700; padding: 0 6px; }
.seg-radio { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.seg-radio label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; }
.chk-grid label { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); }
.chk-grid.dim { opacity: .4; pointer-events: none; }
.perm-tri-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.perm-tri { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.perm-tri select, .perm-tri input { height: 38px; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; background: #fff; }
th.perm-col { font-size: 11px; white-space: normal; text-align: center; min-width: 64px; }
td.perm-cell { text-align: center; font-weight: 700; }
td.perm-cell.yes { color: var(--ok); }
td.perm-cell.no { color: var(--err); background: #fff5f5; }
td.perm-cell sup { color: var(--purple-2); font-size: 9px; margin-left: 2px; }
