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

:root {
  --primary: #0ca5c6;
  --primary-dark: #0a8da8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 16px;
}

h1 { font-size: 1.5rem; margin-bottom: 8px; }
h2 { font-size: 1.25rem; margin-bottom: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

input, select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus { border-color: var(--primary); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.875rem; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 500;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eff6ff; color: #1e40af; }

.scan-result {
  text-align: center;
  padding: 32px 16px;
  border-radius: var(--radius);
  animation: fadeIn 0.2s ease;
}

.scan-result.success { background: #dcfce7; }
.scan-result.duplicate { background: #fffbeb; }
.scan-result.error { background: #fef2f2; }

.scan-result .name { font-size: 1.5rem; font-weight: 700; margin: 8px 0; }
.scan-result .status { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }

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

.nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.nav a {
  padding: 8px 16px;
  background: var(--card-bg);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.nav a.active { background: var(--primary); color: white; }

.lang-switcher {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 16px;
}

.lang-switcher button {
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.lang-switcher button.active { background: var(--primary); color: white; border-color: var(--primary); }

.recent-list { list-style: none; }
.recent-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recent-list li:last-child { border-bottom: none; }
.recent-list .time { color: var(--text-muted); font-size: 0.8rem; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card .value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }

#qr-reader { width: 100%; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
#qr-reader video { width: 100% !important; border-radius: var(--radius); }

.hidden { display: none !important; }

.brand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.brand-logo {
  width: 36px;
  object-fit: contain;
}
.brand-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

.logo { text-align: center; margin-bottom: 16px; }
.logo img { height: 48px; }

.offline-banner {
  background: var(--danger);
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.search-results { margin-top: 16px; }
.guest-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.guest-item .guest-info { flex: 1; }
.guest-item .guest-name { font-weight: 600; }
.guest-item .guest-detail { font-size: 0.8rem; color: var(--text-muted); }
.guest-item .btn { width: auto; padding: 8px 16px; font-size: 0.8rem; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fffbeb; color: #92400e; }

.build-footer {
  text-align: center;
  padding: 16px 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.5;
}
