:root {
  --bg: #f5f2ec;
  --panel: #ffffff;
  --text: #2f2f2f;
  --muted: #6b6b6b;
  --accent: #8c7c62;
  --accent-dark: #6f624d;
  --success: #4a7c59;
  --danger: #a24747;
  --border: #e0d7ca;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  margin: 0;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

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

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--accent);
  color: #fff;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(80, 66, 45, 0.08);
}

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

.status-badge {
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
}

.scanner-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

#qr-reader {
  width: 100%;
  min-height: 360px;
}

#qr-reader video,
#qr-reader canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  inset: 12%;
  border: 3px solid rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  pointer-events: none;
}

.panel-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.stat {
  background: #fbf8f2;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat strong {
  font-size: 1.4rem;
}

.status-card {
  border-radius: 18px;
  padding: 20px;
  margin-top: 16px;
  border: 2px solid transparent;
  text-align: center;
  background: #fbf8f2;
}

.status-card.valid {
  border-color: var(--success);
  background: rgba(74, 124, 89, 0.1);
}

.status-card.invalid {
  border-color: var(--danger);
  background: rgba(162, 71, 71, 0.1);
}

.status-title {
  font-size: 2rem;
  margin-bottom: 8px;
}

.status-text {
  color: var(--muted);
  margin-bottom: 12px;
}

.status-qr {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  word-break: break-all;
}

.scan-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 12px;
}

.scan-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.text-muted {
  color: var(--muted) !important;
}

@media (max-width: 991px) {
  .panel-footer {
    grid-template-columns: 1fr;
  }
}
