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

:root {
  --purple:    #534AB7;
  --purple-lt: #EEEDFE;
  --purple-md: #AFA9EC;
  --teal:      #1D9E75;
  --teal-lt:   #E1F5EE;
  --red:       #e24b4a;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: #f2f2f7;
  color: #1c1c1e;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ── FORSIDE ─────────────────────────────────────────────── */
.center-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1.25rem;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem 1.75rem;
  width: 100%;
  max-width: 400px;
}

.logo {
  width: 56px; height: 56px;
  background: var(--purple-lt);
  color: var(--purple);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: .2rem;
}

.sub {
  font-size: 14px;
  color: #6e6e73;
  margin-bottom: 1.5rem;
}

.field-group { margin-bottom: .9rem; }
.field-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6e6e73;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .35rem;
}
.field-group input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid #e5e5ea;
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: #1c1c1e;
  background: #f9f9fb;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
}
.field-group input:focus {
  outline: none;
  border-color: var(--purple);
  background: #fff;
}

.btn-primary {
  width: 100%;
  padding: .85rem;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  -webkit-appearance: none;
}
.btn-primary:active { transform: scale(.97); opacity: .9; }

.btn-secondary {
  width: 100%;
  padding: .85rem;
  background: var(--purple-lt);
  color: var(--purple);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-secondary:active { opacity: .8; }

.btn-danger {
  width: 100%;
  padding: .85rem;
  background: #fff0f0;
  color: var(--red);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.25rem 0;
  color: #c7c7cc;
  font-size: 13px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: #e5e5ea;
}

.msg {
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 1rem;
}
.msg.error   { background: #fff0f0; color: #c0392b; }
.msg.success { background: var(--teal-lt); color: #0f6e56; }
.msg.hidden  { display: none; }

/* ── HEADER (liste + admin) ──────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid #e5e5ea;
  display: flex; align-items: center; gap: .5rem;
  padding: .8rem 1rem;
  padding-top: calc(.8rem + env(safe-area-inset-top));
}

.back-btn {
  font-size: 22px; color: var(--purple);
  text-decoration: none;
  display: flex; align-items: center;
  padding: 2px 6px 2px 0;
  font-weight: 300;
}

.header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  display: flex; align-items: center; gap: .45rem;
  letter-spacing: -.2px;
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #d1d1d6;
  flex-shrink: 0;
  transition: background .4s;
}
.live-dot.live { background: var(--teal); }

.icon-btn {
  background: none; border: none;
  color: #8e8e93; cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  -webkit-appearance: none;
}
.icon-btn:active { background: #f2f2f7; }

/* ── SHOP TABS ───────────────────────────────────────────── */
.shop-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: .65rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e5e5ea;
  scrollbar-width: none;
}
.shop-tabs::-webkit-scrollbar { display: none; }

.tab {
  white-space: nowrap;
  padding: .3rem .9rem;
  border-radius: 20px;
  border: 1.5px solid #e5e5ea;
  font-size: 14px;
  color: #6e6e73;
  background: #f2f2f7;
  cursor: pointer;
  flex-shrink: 0;
  font-weight: 500;
  transition: all .15s;
  -webkit-appearance: none;
}
.tab.active {
  background: var(--purple-lt);
  color: var(--purple);
  border-color: var(--purple-md);
  font-weight: 600;
}

/* ── VARELISTE ───────────────────────────────────────────── */
main { padding: .5rem 0 7rem; }

.item-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  background: #fff;
  border-bottom: 1px solid #f2f2f7;
}

.check-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid #d1d1d6;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
  -webkit-appearance: none;
}
.item-row.done .check-btn {
  background: var(--teal);
  border-color: var(--teal);
}

.item-text { flex: 1; min-width: 0; }
.item-name { display: block; font-size: 16px; }
.item-note { display: block; font-size: 12px; color: #8e8e93; margin-top: 1px; }

.item-row.done .item-name {
  text-decoration: line-through;
  color: #c7c7cc;
}
.item-row.done .item-note { color: #d1d1d6; }

.shop-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--shop-color) 14%, #fff);
  color: color-mix(in srgb, var(--shop-color) 75%, #000);
  white-space: nowrap;
  flex-shrink: 0;
}

.del-btn {
  background: none; border: none;
  color: #d1d1d6; cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex; align-items: center;
  flex-shrink: 0;
  -webkit-appearance: none;
}
.del-btn:active { color: var(--red); }

.empty {
  text-align: center;
  color: #c7c7cc;
  font-size: 15px;
  padding: 4rem 1rem;
}

/* ── FAB ─────────────────────────────────────────────────── */
.fab-wrap {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  right: 1.25rem;
  z-index: 20;
}
.fab {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(83,74,183,.45);
  transition: transform .15s;
  -webkit-appearance: none;
}
.fab:active { transform: scale(.9); }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow-y: auto;
}

.modal-handle {
  width: 36px; height: 4px;
  background: #d1d1d6;
  border-radius: 2px;
  margin: 0 auto .9rem;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.1rem;
}
.modal-header h2 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }

/* ── BUTIKSVÆLGER I MODAL ────────────────────────────────── */
.shop-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.shop-pick-btn {
  padding: .35rem .9rem;
  border-radius: 20px;
  border: 1.5px solid #e5e5ea;
  font-size: 14px;
  font-weight: 500;
  color: #6e6e73;
  background: #f2f2f7;
  cursor: pointer;
  transition: all .15s;
  -webkit-appearance: none;
}
.shop-pick-btn.active {
  background: color-mix(in srgb, var(--shop-color,#534AB7) 14%, #fff);
  color: color-mix(in srgb, var(--shop-color,#534AB7) 80%, #000);
  border-color: var(--shop-color,#534AB7);
  font-weight: 600;
}
.shop-pick-btn.add-shop {
  border-style: dashed;
  color: #aeaeb2;
}

/* ── ADMIN ───────────────────────────────────────────────── */
.admin-section {
  padding: 1rem;
}
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 .25rem;
  margin-bottom: .5rem;
}
.card-list {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.admin-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid #f2f2f7;
}
.admin-row:last-child { border-bottom: none; }
.admin-info { flex: 1; min-width: 0; }
.admin-name { display: block; font-size: 16px; font-weight: 600; }
.admin-meta { display: block; font-size: 12px; color: #8e8e93; margin-top: 2px; }
.admin-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.btn-go {
  padding: .3rem .85rem;
  background: var(--purple-lt);
  color: var(--purple);
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
}

.shop-admin-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid #f2f2f7;
}
.shop-admin-row:last-child { border-bottom: none; }

.color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.shop-admin-name { flex: 1; font-size: 15px; }

.add-shop-row {
  display: flex; gap: .5rem;
  padding: .75rem 1rem;
  border-top: 1px solid #f2f2f7;
}
.add-shop-row input {
  flex: 1;
  padding: .55rem .8rem;
  border: 1.5px solid #e5e5ea;
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: #f9f9fb;
  color: #1c1c1e;
  -webkit-appearance: none;
}
.add-shop-row input:focus { outline: none; border-color: var(--purple); }
.add-shop-row button {
  padding: .55rem 1rem;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
}
