:root {
  /* AH-blauw ≈ #00ADE6 */
  --bg0: #eef6fb;
  --bg1: #f7fbfe;
  --ink: #0f1a24;
  --muted: #5a6b78;
  --line: rgba(15, 26, 36, 0.12);
  --accent: #00ade6;
  --accent-ink: #ffffff;
  --accent-deep: #008fc0;
  --warn: #8a5a12;
  --panel: rgba(247, 251, 254, 0.92);
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --header-h: auto;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, #c8e8f6 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 100%, #d6eaf5 0%, transparent 50%),
    linear-gradient(160deg, var(--bg0), #e3f2fa 45%, #eef6fb);
  padding-bottom: env(safe-area-inset-bottom);
}

.login-page {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  min-height: 100vh;
}

.login-panel {
  width: min(420px, 100%);
  padding: 2rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  backdrop-filter: blur(8px);
}

.brand {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 700;
}

.page-title,
h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-weight: 700;
}

.lede {
  margin: 0 0 1.1rem;
  line-height: 1.5;
  color: var(--muted);
}

.lede.tight { margin-bottom: 0.4rem; }
.lede a { color: var(--accent-deep); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.05rem;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--accent-deep); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: rgba(0, 173, 230, 0.1);
  border-color: rgba(0, 173, 230, 0.35);
}

.warn {
  color: var(--warn);
  font-size: 0.95rem;
}

.flash {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg1) 86%, transparent);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0 0;
}

.app-header-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 0 1rem 0.65rem;
}

.top-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.top-meta a { color: var(--accent-deep); font-weight: 600; }

.user-chip {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 0 0.65rem 0.55rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.tab.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.tab:not(.is-active):hover {
  background: rgba(0, 173, 230, 0.12);
  color: var(--ink);
}

.shell {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.shell-flash {
  width: min(820px, 100%);
  margin: 0.75rem auto 0;
}

.shell-foot {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stats div {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.55rem;
}

.stats span {
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  align-items: center;
}

.search-form {
  display: flex;
  flex: 1 1 220px;
  gap: 0.45rem;
  min-width: 0;
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  background: #fff;
}

.sync-status {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 173, 230, 0.28);
  background: rgba(0, 173, 230, 0.08);
}

.sync-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 26, 36, 0.08);
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.sync-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.muted-line {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.dim { opacity: 0.7; }

.empty {
  margin: 1rem 0;
  padding: 1.25rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

.bonus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.bonus-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.bonus-card img,
.bonus-ph {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.bonus-ph {
  border: 1px solid var(--line);
}

.bonus-body h2 {
  margin: 0.1rem 0 0.2rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.bonus-cat {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
  font-weight: 700;
}

.bonus-label {
  margin: 0 0 0.25rem;
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.92rem;
}

.bonus-price {
  margin: 0;
  font-size: 0.9rem;
}

.bonus-price .was {
  text-decoration: line-through;
  color: var(--muted);
  margin-left: 0.35rem;
}

.foot {
  color: var(--muted);
  font-size: 0.85rem;
}

.foot a { color: var(--accent-deep); }

code { font-size: 0.9em; }

@media (max-width: 520px) {
  .app-header-row {
    align-items: start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .top-meta {
    width: 100%;
    justify-content: space-between;
  }
}
