/* 4Tickets Wireframe Styles */
:root {
  --primary: #6C3CE1;
  --primary-light: #E8E0FA;
  --primary-dark: #4A1FB8;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
}

/* Mobile frame */
.mobile-frame {
  width: 390px;
  min-height: 844px;
  margin: 0 auto;
  background: white;
  position: relative;
  overflow-x: hidden;
}

/* Desktop frame */
.desktop-frame {
  width: 100%;
  min-height: 100vh;
  background: var(--gray-50);
}

/* Status bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  font-size: 12px;
  font-weight: 600;
  background: white;
}

.status-bar .time { font-weight: 700; }
.status-bar .icons { display: flex; gap: 4px; align-items: center; }

/* Header */
.header {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: white;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}

.header-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gray-100);
  text-decoration: none;
  color: var(--gray-700);
  font-size: 18px;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}

.header-action {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

/* Content */
.content {
  padding: 20px;
  padding-bottom: 100px;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
}

.card-purple {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
}

.card-purple .card-label { color: rgba(255,255,255,0.8); }

.card-label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.card-value {
  font-size: 32px;
  font-weight: 800;
  margin-top: 4px;
}

.card-value-sm {
  font-size: 20px;
  font-weight: 700;
}

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.9; }

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 14px;
  width: auto;
  display: inline-block;
}

.btn-icon-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-icon {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--gray-200);
}

.btn-icon .icon {
  font-size: 24px;
}

/* Form elements */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  background: white;
}

.form-input:focus {
  border-color: var(--primary);
}

.form-input-pin {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

/* Lists */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.list-item:last-child { border-bottom: none; }

.list-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.list-icon-green { background: #DCFCE7; }
.list-icon-red { background: #FEE2E2; }
.list-icon-blue { background: #DBEAFE; }
.list-icon-purple { background: var(--primary-light); }
.list-icon-yellow { background: #FEF3C7; }

.list-body { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 14px; }
.list-subtitle { font-size: 12px; color: var(--gray-500); }
.list-right { text-align: right; flex-shrink: 0; }
.list-amount { font-weight: 700; font-size: 14px; }
.list-amount-green { color: var(--success); }
.list-amount-red { color: var(--danger); }

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 390px;
  display: flex;
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px;
  text-decoration: none;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item .nav-icon {
  font-size: 22px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-green { background: #DCFCE7; color: #166534; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-purple { background: var(--primary-light); color: var(--primary-dark); }
.badge-gray { background: var(--gray-200); color: var(--gray-600); }

/* QR Code placeholder */
.qr-placeholder {
  width: 200px;
  height: 200px;
  margin: 20px auto;
  background: white;
  border: 3px solid var(--gray-800);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  width: 150px;
  height: 150px;
}

.qr-cell {
  background: var(--gray-800);
  border-radius: 1px;
}

.qr-cell-empty { background: transparent; }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gray-400);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-400);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--gray-200);
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
}

.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.stat-change-up { color: var(--success); }
.stat-change-down { color: var(--danger); }

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 14px;
  background: var(--gray-50);
  font-weight: 700;
  color: var(--gray-600);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
}

tr:last-child td { border-bottom: none; }

/* Sidebar (Admin) */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--gray-900);
  color: white;
  padding: 20px 0;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 0 20px 20px;
  font-size: 20px;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-section {
  padding: 8px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-500);
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.sidebar-link.active {
  background: rgba(108, 60, 225, 0.2);
  color: white;
  border-right: 3px solid var(--primary);
}

.sidebar-link .link-icon { font-size: 18px; width: 24px; text-align: center; }

.admin-main {
  flex: 1;
  padding: 24px 32px;
  overflow-x: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-title {
  font-size: 24px;
  font-weight: 800;
}

.admin-subtitle {
  color: var(--gray-500);
  font-size: 14px;
}

/* Chart placeholder */
.chart-placeholder {
  height: 200px;
  background: linear-gradient(180deg, var(--primary-light) 0%, transparent 100%);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 0 8px;
  gap: 4px;
}

.chart-bar {
  flex: 1;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  opacity: 0.7;
  min-height: 20px;
}

/* Offline banner */
.offline-banner {
  background: var(--warning);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.toggle {
  width: 48px;
  height: 28px;
  background: var(--success);
  border-radius: 14px;
  position: relative;
}

.toggle::after {
  content: '';
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  right: 3px;
  box-shadow: var(--shadow);
}

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.search-bar .icon { color: var(--gray-400); }
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
}

/* Success screen */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #DCFCE7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 20px;
}

/* Wireframe label */
.wireframe-label {
  position: fixed;
  top: 0;
  right: 0;
  background: var(--gray-800);
  color: white;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 1000;
  border-radius: 0 0 0 8px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* Quantity control */
.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
}

.qty-value {
  font-size: 18px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-card {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.product-card:hover,
.product-card.selected {
  border-color: var(--primary);
}

.product-emoji { font-size: 32px; margin-bottom: 6px; }
.product-name { font-weight: 600; font-size: 13px; }
.product-price { color: var(--primary); font-weight: 700; font-size: 15px; margin-top: 2px; }

/* Cart */
.cart-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 390px;
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 100;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* Timer */
.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  color: var(--warning);
  font-weight: 700;
  margin-top: 8px;
}

/* Misc helpers */
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--gray-500); }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
