body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  margin: 0;
  background: linear-gradient(135deg, #f4f8ff 0%, #eef4ff 100%);
  color: #14213d;
  -webkit-tap-highlight-color: transparent;
}
nav {
  background: linear-gradient(90deg, #0f172a 0%, #1d4ed8 100%);
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}
nav a {
  color: white;
  margin-left: 12px;
  text-decoration: none;
  font-weight: 600;
}
.container { max-width: 1180px; margin: 16px auto 24px; padding: 0 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  border: 1px solid #1d4ed8;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.3em; color: #7dd3fc; font-size: 0.78rem; font-weight: 700; margin: 0 0 8px; }
.hero-card h1 { margin: 0 0 8px; font-size: 1.9rem; font-weight: 800; line-height: 1.2; color: #ffffff; }
.hero-card p { margin: 0; color: #dbeafe; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mobile-link-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
.mobile-link-bar a {
  color: #1d4ed8;
  font-weight: 700;
  word-break: break-all;
}
.mobile-cta {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  border: 1px solid #bfdbfe;
}
.mobile-open-btn {
  background: linear-gradient(90deg, #2563eb 0%, #0f766e 100%);
  font-size: 1rem;
  padding: 12px 14px;
  margin-top: 0;
}
.mobile-cta p {
  margin: 0;
  color: #334155;
  font-size: 0.95rem;
}
.hero-pill, .badge {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}
.hero-pill.secondary { background: #ecfeff; color: #0f766e; }
.card, .auth-box {
  background: white;
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  border: 1px solid #e2e8f0;
}
.card-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-title-row.sub-title { margin-top: 18px; }
.scanner-panel { display: grid; gap: 12px; }
.scanner-video-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}
#qrVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111827;
}
.scanner-frame {
  position: absolute;
  inset: 12%;
  border: 3px solid rgba(255,255,255,0.95);
  border-radius: 20px;
  box-shadow: inset 0 0 0 999px rgba(15, 23, 42, 0.25);
}
.scanner-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.scanner-actions button,
.scanner-actions .upload-btn { border-radius: 999px; }
.scanner-actions .upload-btn { border: none; background: #e2e8f0; color: #0f172a; }
.secondary-btn {
  background: #e2e8f0;
  color: #0f172a;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  color: #334155;
  cursor: pointer;
  font-weight: 600;
  flex: 1;
  min-width: 140px;
}
.upload-btn input { display: none; }
.scanner-status {
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.summary-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.summary-chip { background: #f8fafc; border: 1px solid #e2e8f0; color: #334155; padding: 6px 10px; border-radius: 999px; font-size: 0.85rem; }
.compact-strip { margin: 6px 0 2px; }
label { display: block; margin-top: 10px; font-weight: 600; color: #334155; }
input, select, textarea, button {
  width: 100%;
  padding: 11px 12px;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
}
textarea { min-height: 100px; resize: vertical; }
button {
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 700;
  margin-top: 12px;
  min-height: 46px;
}
button:hover { filter: brightness(1.04); }
.result-box { margin-top: 10px; color: #0f766e; font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: white;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}
.stat-label { font-size: 0.85rem; color: #64748b; margin-bottom: 8px; }
.stat-value { font-size: 1.55rem; font-weight: 800; color: #0f172a; }
.stat-value.warning { color: #b45309; }
.stat-value.success { color: #15803d; }
.progress-panel { display: grid; gap: 10px; margin: 10px 0 16px; }
.progress-item { display: grid; gap: 6px; }
.progress-track { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; }
.progress-bar.green { width: 70%; background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-bar.amber { width: 35%; background: linear-gradient(90deg, #f59e0b, #d97706); }
.chart-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; align-items: center; margin-bottom: 12px; }
.chart-visual { display: flex; align-items: flex-end; gap: 14px; background: linear-gradient(135deg, #f8fbff, #eef4ff); padding: 16px; border-radius: 16px; min-height: 180px; }
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.bar-track { width: 100%; max-width: 44px; height: 110px; border-radius: 999px; background: #e2e8f0; display: flex; align-items: flex-end; padding: 4px; }
.bar-fill { width: 100%; border-radius: 999px; }
.bar-fill.green { background: linear-gradient(180deg, #4ade80, #16a34a); }
.bar-fill.amber { background: linear-gradient(180deg, #fbbf24, #d97706); }
.bar-fill.red { background: linear-gradient(180deg, #f87171, #dc2626); }
.bar-label, .bar-value { font-size: 0.8rem; color: #475569; font-weight: 600; }
.illustration-box, .mini-illustration { background: linear-gradient(135deg, #eff6ff, #f8fbff); border: 1px solid #dbeafe; border-radius: 16px; padding: 14px; display: flex; align-items: center; gap: 10px; color: #334155; }
.illustration-icon { font-size: 2rem; }
.illustration-icon.small { font-size: 1.3rem; }
.mini-illustration { margin-bottom: 10px; }
.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.status-pill.good { background: #dcfce7; color: #166534; }
.status-pill.warn { background: #fef3c7; color: #92400e; }
.status-pill.danger { background: #fee2e2; color: #b91c1c; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 10px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.checklist-list { display: grid; gap: 10px; margin-top: 8px; }
.checklist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.checklist-label { font-weight: 600; color: #334155; flex: 1; }
.checklist-toggle { display: flex; gap: 6px; flex-shrink: 0; }
.chk-btn {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 0;
}
.chk-btn.ok.active { background: #dcfce7; border-color: #86efac; color: #166534; }
.chk-btn.notok.active { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.inline-form { display: inline-flex; gap: 6px; margin: 0 6px 6px 0; flex-wrap: wrap; align-items: center; }
.inline-form input[type="text"],
.inline-form input[type="password"],
.inline-form select { width: auto; margin: 0; padding: 6px 8px; }
.inline-form button { width: auto; margin: 0; padding: 6px 10px; min-height: 34px; font-size: 0.85rem; }
.danger-btn { background: #fee2e2; color: #b91c1c; }
.flash-messages { display: grid; gap: 8px; margin-bottom: 16px; }
.flash-msg { padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.flash-msg.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-msg.error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; margin: 0; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #cbd5e1; transition: 0.2s; border-radius: 999px; }
.slider::before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.2s; border-radius: 50%; }
.switch input:checked + .slider { background-color: #16a34a; }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }
.qr-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qr-holder { border-radius: 8px; overflow: hidden; line-height: 0; }
.qr-actions { display: flex; gap: 6px; }
.qr-actions button { width: auto; margin: 0; padding: 6px 10px; min-height: 34px; font-size: 0.8rem; }
.auth-page { background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%); min-height: 100vh; }
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { max-width: 420px; width: 100%; background: rgba(255,255,255,0.96); border-radius: 24px; padding: 28px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, #2563eb, #38bdf8); font-size: 1.3rem; }
.auth-copy { color: #475569; margin: 10px 0 12px; }
.demo-box { margin-top: 12px; padding: 10px 12px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; color: #1d4ed8; font-size: 0.95rem; }
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .hero-card { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  nav { flex-direction: column; gap: 10px; }
  nav a { margin-left: 0; margin-right: 10px; }
  .container { padding: 0 10px; }
  .hero-card, .card, .auth-card { padding: 14px; border-radius: 14px; }
  .scanner-video-wrap { min-height: 180px; aspect-ratio: 4 / 3; }
  .scanner-actions { flex-direction: column; }
  .upload-btn, .secondary-btn, button { width: 100%; }
  .mobile-link-bar { flex-direction: column; align-items: flex-start; padding: 10px 12px; }
  .mobile-open-btn { width: 100%; min-height: 48px; }
  .hero-card h1 { font-size: 1.35rem; }
  .hero-card p { font-size: 0.95rem; }
  .summary-chip { font-size: 0.8rem; }
  table { font-size: 0.9rem; }
  .checklist-row { flex-direction: column; align-items: flex-start; }
  .checklist-toggle { width: 100%; }
  .chk-btn { flex: 1; }
}
