* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background-color: #fff;
  color: #000;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.header {
  height: 48px;
  background-color: #000;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 500;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.close, .help {
  font-size: 16px;
  font-weight: 400;
  user-select: none;
  cursor: pointer;
}

.title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: 500;
  font-size: 17px;
  white-space: nowrap;
}

.tab-row {
  display: flex;
  justify-content: space-around;
  background: #0074e4;
  color: white;
  font-weight: 500;
  font-size: 15px;
  position: sticky;
  top: 0;
  z-index: 999;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease, border-bottom 0.2s ease;
}

.tab.active {
  opacity: 1;
  border-bottom: 3px solid white;
}

.ticket-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 16px;
  padding: 20px 32px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-padding-left: 16px;
  justify-content: flex-start;
}

.ticket-carousel::-webkit-scrollbar {
  display: none;
}

.carousel-spacer {
  flex: 0 0 calc((100vw - 340px) / 2);
}

.ticket-card {
  flex: 0 0 340px;
  height: 520px;
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.ticket-top {
  background-color: #0074e4;
  color: white;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  height: 120px;
}

.ticket-top-tip {
  height: 90px;
  background-color: #0074e4;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

.ticket-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: white;
}

.ticket-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 80%;
  max-width: 300px;
  margin: 16px auto 0 auto;
  padding-bottom: 12px;
}

.info-block {
  flex: 1;
  text-align: center;
}

.info-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #cce4ff;
  text-transform: uppercase;
}

.info-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 2px;
}

.ticket-image {
  height: 280px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.ticket-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.0));
  z-index: 1;
}

.overlay {
  position: absolute;
  bottom: 4px;
  left: 16px;
  right: 16px;
  color: white;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.event-title {
  color: white;
  font-size: 17px;
  font-weight: 600;
  font-family: 'Helvetica Neue', sans-serif;
  text-align: center;
  padding: 12px 16px 0;
  margin: 0 auto;
  line-height: 1.3;
  max-width: 280px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: #d0d0d0;
}

.ticket-bottom {
  padding: 16px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  gap: 8px;
}

.floor {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
}

.view-ticket {
  background-color: #0074e4;
  color: white;
  border: none;
  padding: 12px 0;
  width: 90%;
  max-width: 280px;
  border-radius: 6px;
  font-weight: 400;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.view-ticket .icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  filter: brightness(0) invert(1);
}

.ticket-details {
  color: #0074e4;
  font-size: 14px;
  margin: 12px 0 0;
  cursor: pointer;
}

.ticket-bottom-line {
  height: 3px;
  background-color: #007aff;
  width: 100%;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.dots {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 8px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 6px;
  background-color: #ccc;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.dot.active {
  background-color: #0074e4;
}

.actions {
  position: fixed;
  bottom: 26px; 
  left: 0;
  right: 0;
  background: #fff;
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e0e0e0;
  z-index: 900;
  gap: 12px;
}

.actions.hidden {
  display: none;
}

.btn {
  flex: 1;
  padding: 12px 0;
  font-size: 14px;
  font-weight: bold;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  max-width: 160px;
  height: 45px;
  text-transform: uppercase;
}

.btn.transfer {
  background-color: #0074e4;
  color: white;
}

.btn.sell {
  background-color: #f1f1f1;
  color: #aaa;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Transfer Panel Styles */
.transfer-panel {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  height: 66%;
  max-height: 700px;
  background: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 0;
  z-index: 1000;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.15);
  transition: bottom 0.35s ease;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.transfer-panel.active {
  bottom: 0;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.transfer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  background-color: #fff;
}

.transfer-header .transfer-title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  text-transform: uppercase;
  flex: 1;
  text-align: center;
  margin: 0;
}

.transfer-header .close-transfer {
  font-size: 22px;
  color: #000;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FAFAFA;
  border: 1px solid #DADCE0;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 20px;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.info-box .icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ccc;
  color: white;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.info-box .message {
  flex: 1;
}

.seat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin: 16px 20px;
  padding: 0 4px;
}

.seat-row .ticket-count {
  font-size: 15px;
  color: #555;
}

.seats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 20px;
  margin-bottom: 0;
}

.seat-btn {
  width: 85px;
  height: 70px;
  border-radius: 12px;
  background: linear-gradient(to bottom, #007aff 40%, #ffffff 40%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'SF Pro Display', sans-serif;
  color: white;
  text-transform: uppercase;
  user-select: none;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
  box-shadow: 0 5px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
  position: relative;
  line-height: 1.1;
}

.seat-btn::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  background: white;
  display: block;
  margin-top: 12px;
  transition: all 0.25s ease;
}

.seat-btn.selected::after {
  border-color: #007aff;
  background-color: #007aff;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 10 17 4 12' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.seat-divider {
  height: 1px;
  background-color: #e0e0e0;
  width: 100%;
  margin: 12px 0 0 0;
}

.transfer-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f6f6f6;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-top: 1px solid #e0e0e0;
  z-index: 1001;
  display: none;
}

.transfer-footer .count {
  color: #444;
  font-weight: 500;
}

.transfer-footer button {
  background: #007aff;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

/* Transfer Action Button Styles */
.transfer-action-btn {
  border: 1.5px solid #007aff;
  color: #007aff;
  font-size: 15px;
  font-weight: 600;
  padding: 0 12px;
  border-radius: 0;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  width: 100%;
  margin-bottom: 6px;
  box-sizing: border-box;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.transfer-action-btn:hover {
  background-color: #f5f5f5;
}

.transfer-action-btn img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Admin Panel Styles */
.admin-slideup {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
  padding: 16px 24px;
  transition: bottom 0.4s ease;
  z-index: 9999;
  max-height: 90vh;
  overflow-y: auto;
  font-family: 'Helvetica Neue', sans-serif;
}

.admin-slideup.active {
  bottom: 0;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.close-btn {
  color: royalblue;
  cursor: pointer;
  font-size: 14px;
}

.instruction {
  font-size: 13px;
  color: #777;
  margin-top: 10px;
  margin-bottom: 20px;
}

.admin-form label {
  display: block;
  font-size: 13px;
  margin-top: 14px;
  color: #444;
}

.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 6px;
  box-sizing: border-box;
}

.admin-form button {
  width: 100%;
  margin-top: 24px;
  background: #111;
  color: white;
  border: none;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.admin-form button:hover {
  background: #000;
}

.hidden {
  display: none !important;
}

/* Animation classes */
.slide-container {
  transform: translateY(100%);
  opacity: 0;
  animation: slideInUp 0.3s ease-out forwards;
}

@keyframes slideInUp {
  to {
    transform: translateY(0%);
    opacity: 1;
  }
}

.ticket-card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInCard 0.5s ease-out 0.6s forwards;
}

@keyframes fadeInCard {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.button-row {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInButtons 0.4s ease-out 1.1s forwards;
}

@keyframes fadeInButtons {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ticket-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-clamp: 3;         /* standard property */
  -webkit-line-clamp: 3; /* WebKit */
}

/* Transfer Success Modal */
.transfer-success-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

.transfer-success-modal.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.transfer-success-content {
  background: white;
  border-radius: 16px;
  padding: 32px 28px 28px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease-out;
  position: relative;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.success-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.success-close-btn:hover {
  color: #1f2937;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: #9ca3af;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: white;
  margin: 12px auto 24px;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 16px;
  color: #1f2937;
}

.success-message {
  font-size: 15px;
  color: #374151;
  margin: 0 0 12px;
  line-height: 1.6;
}

.success-message strong {
  color: #1f2937;
  font-weight: 600;
}

.success-sub {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.5;
}

.success-ok-btn {
  width: 100%;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.success-ok-btn:hover {
  background: #0052a3;
}

.success-ok-btn:active {
  background: #003d7a;
}

/* Transfer / Form styles */
.form-row {
  display: flex;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  box-sizing: border-box;
}

.error-text {
  color: #c62828;
  font-size: 12px;
  min-height: 16px;
}

.btn.primary {
  background-color: #0070f3;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn.plain {
  background: none;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  color: #374151;
  cursor: pointer;
}

.hidden { display: none !important; }

#transferProgress { margin-top: 12px; font-size: 14px; }
.progress-step { padding: 10px; background: #f7fafc; border-radius: 8px; border: 1px solid #eef2f7; }
.transfer-success { padding: 12px; background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 8px; color: #064e3b; }

/* Manual form specific layout (match screenshot) */
/* Manual form specific layout (match screenshot) */
#manualFormPanel { padding-top: 12px; }
/* make form span edge-to-edge with small side padding to match screenshot */
#manualFormPanel .form-field { max-width: none; margin: 0 16px 6px; }
#manualFormPanel label { display:block; font-size:13px; margin-bottom:4px; color:#222; }
#manualFormPanel input, #manualFormPanel textarea { width: 100%; padding: 8px 10px; font-size: 14px; border-radius: 4px; border: 1px solid #bfbfbf; box-sizing: border-box; background:white; }
#manualFormPanel input { height:40px; }
#manualFormPanel textarea { min-height: 120px; resize: vertical; }
#manualFormPanel .buttons-row { width: calc(100% - 32px); margin: 6px 16px 0; display:flex; align-items:center; gap: 6px; }
#manualFormPanel .buttons-row .btn.plain { margin: 0 auto; background:none; color:#444; border:none; }
#manualFormPanel .buttons-row .btn.primary { margin-left: 0; margin-right: 0; flex:0 0 120px; height:40px; }

/* Mobile adjustments */
@media (max-width: 420px) {
  #manualFormPanel { padding-left: 16px; padding-right: 16px; }
  #manualFormPanel .form-field { max-width: 100%; }
  .ticket-card { flex: 0 0 300px; }
}

.ticket-carousel::-webkit-scrollbar {
  display: none;
}

.carousel-spacer {
  flex: 0 0 calc((100vw - 340px) / 2);
}

.ticket-card {
  flex: 0 0 340px;
  height: 520px;
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
#ticketFullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: black !important;
  color: white !important;
  z-index: 999999999 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#ticketFullscreen.hidden {
  display: none !important;
}

body.locked {
  overflow: hidden;
}
#fullscreenQR {
  width: 260px;
  height: 260px;
  background: white;
  padding: 10px;
  border-radius: 12px;
}
