/* ========================
   PIN Overlay
   ======================== */
.pin-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #1a1a1a;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.pin-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.pin-logo {
  font-family: 'Georgia', serif;
  font-size: 48px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 8px;
  margin-bottom: 12px;
}

.pin-subtitle {
  color: #888;
  font-size: 14px;
  margin-bottom: 32px;
  letter-spacing: 1px;
}

.pin-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #555;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pin-dot.filled {
  background: #fff;
  border-color: #fff;
}

.pin-dot.error {
  border-color: #e74c3c;
  background: #e74c3c;
  animation: pin-shake 0.4s ease;
}

@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 16px;
}

.pin-key {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid #444;
  background: transparent;
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.pin-key:active {
  background: #333;
  border-color: #666;
}

.pin-key.key-backspace {
  font-size: 20px;
  border-color: transparent;
}

.pin-key.key-backspace:active {
  background: transparent;
  color: #aaa;
}

.pin-key.key-empty {
  visibility: hidden;
  pointer-events: none;
}

.pin-error-msg {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 16px;
  min-height: 20px;
}

.pin-staff-name {
  color: #4CAF50;
  font-size: 18px;
  font-weight: 500;
  margin-top: 16px;
  min-height: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pin-staff-name.visible {
  opacity: 1;
}

/* ========================
   Action Modal Base
   ======================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #1e1e1e;
  border-radius: 16px;
  padding: 28px 24px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  color: #fff;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

/* ========================
   Modal Form Elements
   ======================== */
.modal-field {
  margin-bottom: 16px;
}

.modal-field label {
  display: block;
  font-size: 13px;
  color: #aaa;
  margin-bottom: 6px;
}

.modal-field select,
.modal-field input,
.modal-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #2a2a2a;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
}

.modal-field select:focus,
.modal-field input:focus,
.modal-field textarea:focus {
  outline: none;
  border-color: #666;
}

.modal-field textarea {
  resize: vertical;
  min-height: 64px;
}

.modal-field-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4CAF50;
}

.modal-field-checkbox label {
  font-size: 14px;
  color: #ccc;
  margin: 0;
}

.modal-sale-info {
  background: #252525;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #bbb;
  line-height: 1.6;
}

.modal-sale-info strong {
  color: #fff;
}

/* ========================
   Modal Buttons
   ======================== */
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.modal-btn:active {
  opacity: 0.8;
}

.modal-btn-cancel {
  background: #333;
  color: #ccc;
}

.modal-btn-danger {
  background: #e74c3c;
  color: #fff;
}

.modal-btn-primary {
  background: #4CAF50;
  color: #fff;
}

.modal-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========================
   Apertura Modal Specific
   ======================== */
.apertura-amount-input {
  font-size: 32px !important;
  text-align: center;
  font-weight: 600;
  letter-spacing: 2px;
}
