/* Unified staff PIN gate — fullscreen shell with header + centered form (cashier template) */

body[class*="staff-page-"] .staff-pin-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

body[class*="staff-page-"] .staff-pin-gate.hidden {
  display: none !important;
}

body[class*="staff-page-"] .staff-pin-gate-sticky {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: visible;
}

body[class*="staff-page-"] .staff-pin-gate-sticky > .header.staff-header-wrap {
  position: relative;
  z-index: 3;
  border-bottom: none;
  flex: 0 0 auto;
}

body[class*="staff-page-"] .staff-pin-gate-sticky > .header-venue-bridge,
body[class*="staff-page-"] .staff-pin-gate-venue-bridge {
  flex: 0 0 var(--header-chrome-venue-bridge-h);
  display: flex !important;
  pointer-events: none;
}

/* Toolbar/categories slot — keeps PIN gate sticky height identical to logged-in app */
body[class*="staff-page-"] .staff-pin-gate-toolbar-slot {
  flex: 0 0 var(--header-chrome-toolbar-h);
  min-height: var(--header-chrome-toolbar-h);
  padding: var(--header-chrome-toolbar-pad-top) var(--header-chrome-pad-x) var(--header-chrome-toolbar-pad-bottom);
  box-sizing: border-box;
  visibility: hidden;
  pointer-events: none;
}

body[class*="staff-page-"] .staff-pin-gate-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  min-height: 0;
}

body[class*="staff-page-"] .staff-pin-gate-body-inner {
  width: 100%;
  max-width: 360px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(100%, 420px);
}

body[class*="staff-page-"] .staff-pin-gate-form,
body[class*="staff-page-"] .staff-pin-gate-extra {
  width: 100%;
}

body[class*="staff-page-"] .staff-pin-gate-form.hidden,
body[class*="staff-page-"] .staff-pin-gate-extra.hidden {
  display: none !important;
}

body[class*="staff-page-"] .staff-pin-gate-form h2,
body[class*="staff-page-"] .staff-pin-gate-extra h2 {
  font-family: var(--font-brand);
  color: var(--accent);
  font-size: 1.2rem;
  text-align: center;
  font-weight: normal;
  margin: 0 0 8px;
}

body[class*="staff-page-"] .staff-pin-gate-form > p,
body[class*="staff-page-"] .staff-pin-gate-extra > p {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  margin: 0 0 20px;
}

body[class*="staff-page-"] .staff-pin-gate-form input[type="password"],
body[class*="staff-page-"] .staff-pin-gate-form input[type="text"] {
  width: 100%;
  padding: 14px;
  margin: 0 0 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.2rem;
  text-align: center;
  box-sizing: border-box;
}

/* Redesigned PIN gate — centered card + dots indicator */
body[class*="staff-page-"] .staff-pin-gate-card {
  width: 100%;
  background: var(--surface2, var(--surface-light));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

body[class*="staff-page-"] .staff-pin-gate-card h2 {
  margin: 0 0 4px;
}

body[class*="staff-page-"] .staff-pin-gate-card > p:not(.pin-error) {
  margin: 0 0 18px;
}

/* PIN dots indicator (primary display; the password input is hidden while mounted) */
.staff-pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 6px;
  min-height: 18px;
}

.staff-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong, var(--border));
  background: transparent;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.staff-pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}

body[class*="staff-page-"] .staff-pin-gate-form.has-pin-dots .staff-pin-input {
  display: none;
}

body[class*="staff-page-"] .staff-pin-gate-form .pin-error {
  min-height: 1.2em;
  margin: 0 0 2px;
}

body[class*="staff-page-"] .staff-pin-enter-btn {
  width: 100%;
  padding: 12px 20px;
  margin-top: 12px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
  touch-action: manipulation;
}

/* Touch numeric keypad — staff PIN gates + guest virtual-table PIN */
.staff-pin-keypad {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 0;
  user-select: none;
  -webkit-user-select: none;
}

.staff-pin-keypad-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.staff-pin-keypad-key {
  min-height: 52px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2, var(--surface-light));
  color: var(--text);
  font-size: 1.35rem;
  font-family: var(--font-ui, inherit);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.staff-pin-keypad-key:active {
  background: var(--border);
}

/* Compact 4-column calculator pad (price entry): smaller keys, wider cells. */
.staff-pin-keypad--compact {
  gap: 6px;
  margin: 6px 0 0;
}
.staff-pin-keypad--compact .staff-pin-keypad-row {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.staff-pin-keypad--compact .staff-pin-keypad-key {
  min-height: 42px;
  padding: 4px 2px;
  font-size: 1.05rem;
  border-radius: 7px;
}
.staff-pin-keypad--compact .staff-pin-keypad-key--accent {
  font-size: 1.15rem;
}

.staff-pin-keypad-key--wide { grid-column: 1 / -1; }
.staff-pin-keypad-key--accent {
  background: var(--accent, #C5A059);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
  font-size: 1.1rem;
}
.staff-pin-keypad-key--accent:active { filter: brightness(0.92); }

body[class*="staff-page-"] .staff-pin-gate-form .staff-pin-keypad {
  margin-top: 8px;
}

body[class*="staff-page-"] .staff-pin-gate-form .staff-pin-enter-btn {
  margin-top: 16px;
}

.table-prompt-entry-block.hidden { display: none; }

.table-prompt-entry-block {
  margin-bottom: 8px;
}

.table-prompt-entry-block .table-input {
  margin-bottom: 0;
}

.table-prompt-entry-block .staff-pin-keypad {
  margin-top: 8px;
  margin-bottom: 0;
}
