:root {
  --sidebar-width: 240px;
  --sidebar-bg: #111827;
  --sidebar-fg: #cbd5e1;
  --sidebar-active: #2563eb;
}

body { background: #f5f6f8; }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  padding: 1rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.5rem;
  color: #fff; font-weight: 600; text-decoration: none;
  padding: 0.25rem 0.5rem 1rem;
}
.sidebar-brand .bi { font-size: 1.25rem; color: #60a5fa; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--sidebar-fg); border-radius: 0.375rem;
  padding: 0.5rem 0.65rem; margin-bottom: 2px;
}
.sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar .nav-link.active { background: var(--sidebar-active); color: #fff; }
.sidebar .nav-link.disabled { color: #64748b; }
.sidebar-section {
  text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em;
  color: #64748b; padding: 1rem 0.65rem 0.35rem;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 1.5rem;
}
.page { padding: 1.5rem; }

@media (max-width: 992px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
}

/* ---------- components ---------- */
.card { border-color: #e5e7eb; }
.stat-card .stat-label { color: #6b7280; font-size: 0.85rem; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 600; }
.audit-details { max-width: 360px; }
.code-input { letter-spacing: 0.3em; }
.qr-code { width: 220px; height: 220px; }

/* ---------- auth pages ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-wrap { width: 100%; max-width: 400px; padding: 1rem; }
.auth-logo { font-size: 2.25rem; color: var(--sidebar-active); }

/* ---------- data sources ---------- */
.run-log {
  background: #0f172a; color: #e2e8f0;
  font-size: 0.8rem; line-height: 1.45;
  padding: 1rem; max-height: 65vh; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
  border-bottom-left-radius: 0.375rem; border-bottom-right-radius: 0.375rem;
}
.state-json { max-height: 240px; overflow: auto; }

/* ---------- shops / analytics ---------- */
.shops-table .shop-cell { max-width: 280px; }
.contact-email { max-width: 220px; }
.keywords-cell { max-width: 420px; }
.contact-dl dd[title]:not([title=""]) { cursor: help; }
.bar-row { display: block; margin-bottom: 0.6rem; }
.bar-row:hover .bar-fill { background: #1d4ed8; }
.bar-track { background: #eef2f7; border-radius: 3px; height: 8px; overflow: hidden; margin-top: 2px; }
.bar-fill { background: #3b82f6; height: 100%; border-radius: 3px; }
.bar-w-1 { width: 1%; }
.bar-w-2 { width: 2%; }
.bar-w-3 { width: 3%; }
.bar-w-4 { width: 4%; }
.bar-w-5 { width: 5%; }
.bar-w-6 { width: 6%; }
.bar-w-7 { width: 7%; }
.bar-w-8 { width: 8%; }
.bar-w-9 { width: 9%; }
.bar-w-10 { width: 10%; }
.bar-w-11 { width: 11%; }
.bar-w-12 { width: 12%; }
.bar-w-13 { width: 13%; }
.bar-w-14 { width: 14%; }
.bar-w-15 { width: 15%; }
.bar-w-16 { width: 16%; }
.bar-w-17 { width: 17%; }
.bar-w-18 { width: 18%; }
.bar-w-19 { width: 19%; }
.bar-w-20 { width: 20%; }
.bar-w-21 { width: 21%; }
.bar-w-22 { width: 22%; }
.bar-w-23 { width: 23%; }
.bar-w-24 { width: 24%; }
.bar-w-25 { width: 25%; }
.bar-w-26 { width: 26%; }
.bar-w-27 { width: 27%; }
.bar-w-28 { width: 28%; }
.bar-w-29 { width: 29%; }
.bar-w-30 { width: 30%; }
.bar-w-31 { width: 31%; }
.bar-w-32 { width: 32%; }
.bar-w-33 { width: 33%; }
.bar-w-34 { width: 34%; }
.bar-w-35 { width: 35%; }
.bar-w-36 { width: 36%; }
.bar-w-37 { width: 37%; }
.bar-w-38 { width: 38%; }
.bar-w-39 { width: 39%; }
.bar-w-40 { width: 40%; }
.bar-w-41 { width: 41%; }
.bar-w-42 { width: 42%; }
.bar-w-43 { width: 43%; }
.bar-w-44 { width: 44%; }
.bar-w-45 { width: 45%; }
.bar-w-46 { width: 46%; }
.bar-w-47 { width: 47%; }
.bar-w-48 { width: 48%; }
.bar-w-49 { width: 49%; }
.bar-w-50 { width: 50%; }
.bar-w-51 { width: 51%; }
.bar-w-52 { width: 52%; }
.bar-w-53 { width: 53%; }
.bar-w-54 { width: 54%; }
.bar-w-55 { width: 55%; }
.bar-w-56 { width: 56%; }
.bar-w-57 { width: 57%; }
.bar-w-58 { width: 58%; }
.bar-w-59 { width: 59%; }
.bar-w-60 { width: 60%; }
.bar-w-61 { width: 61%; }
.bar-w-62 { width: 62%; }
.bar-w-63 { width: 63%; }
.bar-w-64 { width: 64%; }
.bar-w-65 { width: 65%; }
.bar-w-66 { width: 66%; }
.bar-w-67 { width: 67%; }
.bar-w-68 { width: 68%; }
.bar-w-69 { width: 69%; }
.bar-w-70 { width: 70%; }
.bar-w-71 { width: 71%; }
.bar-w-72 { width: 72%; }
.bar-w-73 { width: 73%; }
.bar-w-74 { width: 74%; }
.bar-w-75 { width: 75%; }
.bar-w-76 { width: 76%; }
.bar-w-77 { width: 77%; }
.bar-w-78 { width: 78%; }
.bar-w-79 { width: 79%; }
.bar-w-80 { width: 80%; }
.bar-w-81 { width: 81%; }
.bar-w-82 { width: 82%; }
.bar-w-83 { width: 83%; }
.bar-w-84 { width: 84%; }
.bar-w-85 { width: 85%; }
.bar-w-86 { width: 86%; }
.bar-w-87 { width: 87%; }
.bar-w-88 { width: 88%; }
.bar-w-89 { width: 89%; }
.bar-w-90 { width: 90%; }
.bar-w-91 { width: 91%; }
.bar-w-92 { width: 92%; }
.bar-w-93 { width: 93%; }
.bar-w-94 { width: 94%; }
.bar-w-95 { width: 95%; }
.bar-w-96 { width: 96%; }
.bar-w-97 { width: 97%; }
.bar-w-98 { width: 98%; }
.bar-w-99 { width: 99%; }
.bar-w-100 { width: 100%; }
