:root {
  --purple: #691098;
  --purple-dark: #4F145B;
  --purple-deep: #3B0A63;
  --white: #FFFFFF;
  --bg: #F6F2FA;
  --card-bg: #FFFFFF;
  --text: #241429;
  --text-muted: #6B5C74;
  --border: #E7DCF0;
  --shadow: 0 6px 20px rgba(105, 16, 152, 0.10);
  --shadow-hover: 0 12px 28px rgba(105, 16, 152, 0.22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  background: linear-gradient(180deg, #F6F2FA 0%, #EFE6F7 100%);
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 20px;
  flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.logo { height: 32px; cursor: pointer; }
.app-store-title {
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  letter-spacing: 1px;
  font-size: 22px;
  color: var(--purple);
  border-left: 2px solid var(--border);
  padding-left: 14px;
}
.topbar-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.search-input {
  padding: 9px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  min-width: 220px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.search-input:focus { border-color: var(--purple); }

.tier-toggle { display: flex; flex-direction: column; gap: 4px; background: var(--bg); padding: 4px; border-radius: 14px; }
.tier-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 16px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s ease;
}
.tier-btn:hover { color: var(--purple); }
.tier-btn.active { background: var(--purple); color: var(--white); }
.tier-btn.active[data-tier="basic"] { background: #CD7F32; color: white; }
.tier-btn.active[data-tier="full"] { background: #B8B8B8; color: #2B2530; }
.tier-btn.active[data-tier="partnership"] { background: #D4AF37; color: #2B2530; }

/* ===== DASHBOARD ===== */
.dashboard-view { flex: 1; padding: 28px 32px 60px; max-width: 1300px; margin: 0 auto; width: 100%; }

.hero { text-align: center; margin-bottom: 28px; }
.hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px;
  letter-spacing: 1px;
  margin: 0 0 8px;
  color: var(--purple-deep);
}
.hero p { color: var(--text-muted); max-width: 640px; margin: 0 auto; font-size: 15px; }

/* ===== DELTA COLUMN LAYOUT ===== */
.delta-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  align-items: start;
}

.delta-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(255,255,255,.45);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  min-height: 100%;
}

.delta-column-header {
  border-radius: 16px;
  padding: 16px 14px;
  color: var(--white);
  text-align: center;
  box-shadow: var(--shadow);
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}
.delta-column-header .letter {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  line-height: 1;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.delta-column-header .name { font-weight: 700; font-size: 14px; margin: 3px 0 6px; }
.delta-column-header .desc { font-size: 11px; opacity: .92; line-height: 1.4; }

.delta-column-apps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-tile {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 16px 12px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
}
.app-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.app-tile:hover .app-icon { transform: scale(1.05); }

.app-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: white;
  box-shadow: 0 6px 14px rgba(79, 20, 91, 0.35), inset 0 1px 0 rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.15);
  transition: transform .15s ease;
}
.app-name { font-weight: 700; font-size: 12.5px; line-height: 1.3; margin-bottom: 3px; }
.app-subtitle { font-size: 10.5px; color: var(--text-muted); margin-bottom: 8px; }
.tier-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  color: #2B2530;
}

.empty-state { text-align: center; color: var(--text-muted); padding: 20px 8px; font-size: 12px; }

@media (max-width: 900px) {
  .delta-columns { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .delta-columns { grid-template-columns: 1fr; }
}

/* ===== MODULE VIEW ===== */
.module-view { flex: 1; padding: 24px 32px 70px; max-width: 980px; margin: 0 auto; width: 100%; }
.back-btn {
  background: none;
  border: none;
  color: var(--purple);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0 18px;
}
.back-btn:hover { text-decoration: underline; }

.module-detail { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }

.module-header {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(120deg, var(--purple), var(--purple-dark));
  color: white;
  border-radius: 22px;
  padding: 26px 28px;
  margin-bottom: 22px;
}
.module-header .icon-lg {
  width: 76px; height: 76px;
  background: rgba(255,255,255,.20);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.3);
  border: 1px solid rgba(255,255,255,.25);
}
.module-header h2 { margin: 0 0 4px; font-family: 'Bebas Neue', sans-serif; font-size: 30px; letter-spacing: .5px; }
.module-header .sub { opacity: .9; font-size: 14px; margin-bottom: 8px; }
.module-header .meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.22);
}

.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.section-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--purple);
  display: flex; align-items: center; gap: 8px;
}
.section-card p { margin: 0; line-height: 1.6; font-size: 14px; }
.section-card ul { margin: 0; padding-left: 20px; line-height: 1.7; font-size: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

.who-block { display: flex; flex-direction: column; gap: 10px; }
.who-group span.label { font-weight: 700; font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 4px 10px; font-size: 12px; }

.template-list { list-style: none; margin: 0; padding: 0; }
.template-list li {
  font-size: 13px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.template-list li:before { content: "📄"; }

.general-note {
  background: #FBF7FE;
  border-left: 4px solid var(--purple);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 18px;
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* ===== CARLIJN CHATBOT ===== */
.carlijn-bubble-wrap {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}
.carlijn-label {
  background: white;
  color: var(--purple-deep);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(105, 16, 152, 0.18);
  white-space: nowrap;
  animation: carlijn-label-bounce 2.6s ease-in-out infinite;
}
.carlijn-bubble-wrap.chat-open .carlijn-label { display: none; }
@keyframes carlijn-label-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.carlijn-bubble {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(105, 16, 152, 0.35);
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease;
  flex-shrink: 0;
}
.carlijn-bubble:hover { transform: scale(1.06); }
.carlijn-bubble img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}
.carlijn-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2ECC71;
  border: 2px solid white;
}
.carlijn-bubble.hide-dot .carlijn-dot { display: none; }

.carlijn-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: all .2s ease;
  z-index: 100;
  border: 1px solid var(--border);
}
.carlijn-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.carlijn-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(120deg, var(--purple), var(--purple-dark));
  color: white;
}
.carlijn-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.6); }
.carlijn-header-text { flex: 1; }
.carlijn-name { font-weight: 800; font-size: 15px; }
.carlijn-status { font-size: 11px; opacity: .9; display: flex; align-items: center; gap: 5px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #2ECC71; display: inline-block; }
.carlijn-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
}
.carlijn-close:hover { background: rgba(255,255,255,.3); }

.carlijn-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}
.carlijn-msg { display: flex; gap: 8px; align-items: flex-end; }
.carlijn-msg.user { justify-content: flex-end; }
.msg-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.msg-bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.carlijn-msg.bot .msg-bubble { background: white; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.carlijn-msg.user .msg-bubble { background: var(--purple); color: white; border-bottom-right-radius: 4px; }

.carlijn-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.suggestion-chip {
  font-size: 11px;
  background: white;
  border: 1px solid var(--border);
  color: var(--purple);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.suggestion-chip:hover { background: var(--purple); color: white; }

.carlijn-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: white;
  border-top: 1px solid var(--border);
}
.carlijn-input-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.carlijn-input-row input:focus { border-color: var(--purple); }
.carlijn-input-row button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--purple);
  color: white;
  cursor: pointer;
  font-size: 15px;
}
.carlijn-input-row button:hover { background: var(--purple-dark); }

@media (max-width: 420px) {
  .carlijn-panel { right: 12px; bottom: 88px; width: calc(100vw - 24px); }
  .carlijn-bubble-wrap { right: 16px; bottom: 90px; }
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(120deg, var(--purple), var(--purple-dark));
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 20px;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 6px 14px rgba(105,16,152,.3);
}
.link-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(105,16,152,.4); }

.admin-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 20px;
  transition: all .15s ease;
  white-space: nowrap;
}
.admin-link:hover { background: var(--purple); color: white; }


.admin-btn {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 18px;
  cursor: pointer;
  transition: all .15s ease;
}
.admin-btn:hover { border-color: var(--purple); color: var(--purple); }
.admin-btn.primary { background: var(--purple); color: white; border-color: var(--purple); }
.admin-btn.primary:hover { background: var(--purple-dark); }
.admin-btn.danger { color: #C0392B; border-color: #E8B4AC; }
.admin-btn.danger:hover { background: #C0392B; color: white; border-color: #C0392B; }
.admin-btn.full-width { width: 100%; }

/* ===== MODULE-SELECTIE / AFREKENEN ===== */
.app-tile { position: relative; }
.app-tile.selected {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.app-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  cursor: pointer;
  width: 20px;
  height: 20px;
}
.app-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--purple);
}

.cart-toggle-btn {
  margin-top: 10px;
  border: none;
  background: rgba(255,255,255,.2);
  color: white;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 18px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  align-self: flex-start;
}
.cart-toggle-btn:hover { background: rgba(255,255,255,.32); }
.cart-toggle-btn.in-cart { background: #2ECC71; color: white; }

.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0,0,0,.10);
  z-index: 90;
  padding: 14px 24px;
}
.cart-bar-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cart-bar-info { font-size: 14px; color: var(--text); }
.cart-variable-note { color: var(--text-muted); font-size: 12px; }
.cart-bar-actions { display: flex; gap: 10px; }

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.checkout-modal[hidden] { display: none; }
.checkout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 20, 41, 0.55);
}
.checkout-panel {
  position: relative;
  background: white;
  border-radius: 22px;
  max-width: 540px;
  width: 92%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 32px 28px 28px;
  box-shadow: 0 30px 70px rgba(0,0,0,.35);
}
.checkout-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}
.checkout-close:hover { background: var(--border); }

.checkout-panel h2 { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: var(--purple-deep); margin: 0 0 4px; }
.checkout-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 18px; }

.checkout-axis-group { margin-bottom: 14px; }
.checkout-axis-label {
  display: inline-block;
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.checkout-module-list { list-style: none; margin: 0; padding: 0; }
.checkout-module-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 7px 10px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 4px;
}
.checkout-module-time { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

.checkout-total {
  background: #FBF7FE;
  border-left: 4px solid var(--purple);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 14px 0 18px;
}

.checkout-form { display: flex; flex-direction: column; gap: 10px; }
.checkout-form input, .checkout-form textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  resize: vertical;
}
.checkout-form input:focus, .checkout-form textarea:focus { border-color: var(--purple); }

.checkout-disclaimer { font-size: 11px; color: var(--text-muted); margin-top: 12px; text-align: center; }

.checkout-confirmation { text-align: center; padding: 10px 0; }
.confirmation-icon { font-size: 46px; margin-bottom: 8px; }
.checkout-confirmation h2 { margin-bottom: 6px; }
.checkout-confirmation p { font-size: 14px; color: var(--text-muted); margin: 6px 0; }
.checkout-confirmation .admin-btn { margin-top: 14px; }

/* Ruimte onderaan zodat de sticky cart-bar niets overlapt */
.dashboard-view, .module-view { padding-bottom: 90px; }

@media (max-width: 560px) {
  .cart-bar-inner { flex-direction: column; align-items: stretch; text-align: center; }
  .cart-bar-actions { justify-content: center; }
}

/* Strak, grijstinten-effect op alle emoji-iconen in de Appstore */
.icon-glyph {
  display: inline-block;
  filter: grayscale(1) contrast(1.05) brightness(1.02);
}
