:root {
  --bg: #FAF7F1;
  --surface: #FFFFFF;
  --field: #FAF8F2;
  --ink: #26333B;
  --ink-2: #3B474E;
  --ink-3: #4A575E;
  --ink-soft: #5A676E;
  --muted: #8B979D;
  --muted-2: #99A5AB;
  --border: #EEE9DD;
  --border-2: #E4DFD2;
  --orange: #EB8C23;
  --orange-hover: #D97C13;
  --orange-ink: #A85E08;
  --orange-link-hover: #C56F10;
  --teal: #22797B;
  --teal-ink: #155E60;
  --teal-bg: #F2FAFA;
  --teal-border: #CDE9E9;
  --heading: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(38,51,59,0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  font-family: var(--body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
a { text-decoration: none; color: inherit; }
h1, h2, h3 { font-family: var(--heading); }

/* ---------- Blazor boot loader (shown until the WASM runtime replaces #app) ---------- */
.app-loading {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: var(--bg); font-family: var(--body);
  animation: app-loading-in 0.4s ease both;
}
.app-loading-badge { position: relative; width: 92px; height: 92px; display: grid; place-items: center; }
.app-loading-badge img {
  width: 52px; height: 52px; object-fit: contain;
  animation: app-loading-pulse 1.8s ease-in-out infinite;
}
.app-loading-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--teal); border-right-color: var(--orange);
  animation: app-loading-spin 0.9s linear infinite;
}
.app-loading-bar {
  width: 180px; height: 4px; border-radius: 999px; background: var(--border); overflow: hidden;
}
.app-loading-bar::after {
  content: ""; display: block; width: 40%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--orange));
  animation: app-loading-slide 1.3s ease-in-out infinite;
}
.app-loading-text { font-size: 14.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
@keyframes app-loading-spin { to { transform: rotate(360deg); } }
@keyframes app-loading-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.88); opacity: 0.68; } }
@keyframes app-loading-slide { 0% { transform: translateX(-130%); } 100% { transform: translateX(330%); } }
@keyframes app-loading-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .app-loading, .app-loading-badge img, .app-loading-ring, .app-loading-bar::after { animation: none; }
}

#blazor-error-ui {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #FBEBD8; color: #A85E08; padding: 12px 20px; box-shadow: 0 -1px 2px rgba(0,0,0,0.08);
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ---------- Header ---------- */
.app-header {
  display: flex; align-items: center; gap: 22px; padding: 14px 32px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand img { height: 34px; display: block; }
.brand-name { font-family: var(--heading); font-weight: 700; font-size: 19px; color: var(--ink); }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.nav-link {
  padding: 8px 15px; border-radius: 999px; background: transparent;
  color: #6B7A82; font-weight: 500; font-size: 14px; cursor: pointer;
}
.nav-link:hover { background: #F6F4EC; }
.nav-link.active { background: #F1F6D2; color: #5F700D; font-weight: 600; }
.header-spacer { flex: 1; }

/* Hamburger toggle + mobile drawer: hidden on desktop, shown at <= 640px. */
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.nav-toggle:hover { background: var(--field); }
.mobile-nav { display: none; }

.nav-dropdown { position: relative; }
.nav-dropdown .nav-link { display: inline-flex; align-items: center; border: none; font-family: inherit; }

/* Profile dropdown menu */
.profile-menu { position: relative; }
.profile-trigger { background: none; border: none; padding: 0; cursor: pointer; display: block; border-radius: 50%; }
.profile-trigger:hover { box-shadow: 0 0 0 3px var(--field); }
.menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.menu-pop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 50; width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.14); padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.menu-header { display: flex; align-items: center; gap: 11px; padding: 8px 8px 10px; }
.menu-name { font-weight: 700; font-size: 14.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-sub { font-size: 12.5px; color: #8B979D; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.menu-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 10px; border: none; background: none; border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.menu-item:hover { background: var(--field); }
.menu-item.danger { color: #C0392B; }
.menu-item.danger:hover { background: #FBEDEA; }

/* ---------- Modal dialog ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(38,51,59,0.42); padding: 20px;
}
.modal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.22); padding: 26px 28px; width: 100%; max-width: 430px;
  display: flex; flex-direction: column; gap: 14px;
}

.pill-link {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-2);
  color: var(--teal); font-weight: 600; font-size: 13px;
}
.pill-link:hover { background: var(--teal-bg); }

.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 11px; }
.search input {
  width: 100%; max-width: 250px; padding: 10px 16px 10px 40px; border: 1px solid var(--border-2);
  border-radius: 999px; font-family: inherit; font-size: 14px; background: var(--field);
  color: var(--ink); outline: none;
}

.btn { font-family: inherit; cursor: pointer; border: none; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px; background: var(--orange); color: #FFF;
  border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 700;
}
.btn-primary:hover { background: var(--orange-hover); }
.btn-ghost {
  padding: 12px 20px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--ink-soft); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { background: var(--field); }

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; letter-spacing: 0.02em; flex-shrink: 0; overflow: hidden;
}

/* ---------- Layout containers ---------- */
.screen { max-width: 1260px; margin: 0 auto; padding: 28px 32px 48px; }
.screen-narrow { max-width: 820px; margin: 0 auto; padding: 32px 32px 56px; display: flex; flex-direction: column; gap: 22px; }
.screen-mid { max-width: 900px; margin: 0 auto; padding: 32px 32px 56px; display: flex; flex-direction: column; gap: 22px; }
.screen-compose { max-width: 720px; margin: 0 auto; padding: 32px 32px 56px; display: flex; flex-direction: column; gap: 20px; }
.prikbord-grid { display: grid; grid-template-columns: 1fr 350px; gap: 28px; align-items: start; }
.feed { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 18px; }
/* Segmented control shown only when the Prikbord grid stacks (mobile/tablet). */
.mobile-tabs { display: none; }

.page-title { margin: 0; font-family: var(--heading); font-size: 34px; font-weight: 800; color: var(--ink); }
.page-sub { margin: 0; font-size: 15px; color: var(--muted); }
.page-head { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.card-lg { border-radius: 18px; }

/* ---------- Chips ---------- */
.cat-chip { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; width: fit-content; }
.cat-Algemeen { background: #E9EDF5; color: #3F5375; }
.cat-Oproep { background: #FBEBD8; color: #A85E08; }

.filter-row { display: flex; align-items: center; gap: 8px; }
.filter-chip {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; border: 1px solid transparent; background: #F1EEE3; color: var(--ink-soft);
}
.filter-chip.active { border-color: var(--orange); background: #FDF3E7; color: var(--orange-ink); }

/* ---------- Birthday banner (jarig vandaag) ---------- */
.bday-banner {
  display: flex; align-items: center; gap: 16px; padding: 16px 22px; margin-bottom: 16px;
  background: linear-gradient(120deg, #FDF3E7 0%, #F7F0DE 45%, #F1F6D2 100%);
  border: 1px solid #F1E1C6;
}
.bday-banner-icon { font-size: 30px; line-height: 1; flex-shrink: 0; }
.bday-banner-people { display: flex; flex-shrink: 0; }
.bday-banner-people .avatar { border: 2px solid var(--surface); margin-left: -12px; }
.bday-banner-people .avatar:first-child { margin-left: 0; }
.bday-banner-title { font-family: var(--heading); font-weight: 700; font-size: 16.5px; color: var(--ink); text-wrap: pretty; }
.bday-banner-sub { font-size: 13px; color: var(--ink-soft); }

/* ---------- Post card ---------- */
.post { padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-author { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.post-time { font-size: 12.5px; color: #8B979D; }
.post-title {
  margin: 0; font-family: var(--heading); font-size: 23px; font-weight: 700; line-height: 1.25;
  color: var(--ink); cursor: pointer; text-wrap: pretty;
}
.post-title:hover { color: var(--orange-link-hover); }
.post-excerpt { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-3); text-wrap: pretty; }
.edited { color: #8B979D; font-size: 12px; }
.post-actions { display: flex; gap: 8px; }
.post-actions .btn-ghost { padding: 7px 13px; font-size: 13px; }
.confirm-bar { display: flex; align-items: center; gap: 12px; background: #FBE3E0; border: 1px solid #E7C6C0; border-radius: 12px; padding: 12px 16px; font-size: 14px; color: #B23A2C; font-weight: 600; }
.confirm-bar .btn-ghost { padding: 8px 14px; }
.post-image { width: 100%; height: 250px; object-fit: cover; border-radius: 12px; display: block; background: #F1EEE3; }
.post-foot { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.comment-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--teal-border); background: var(--teal-bg); color: var(--teal);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.comment-btn:hover { background: #E0F4F4; }
.attach-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: #8B979D; }

.attach-downloads { display: flex; flex-direction: column; gap: 8px; }
.attach-dl { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); }
.attach-dl:hover { border-color: var(--orange); background: #FFFCF7; }
.attach-dl-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.reactions { display: flex; gap: 8px; }
.reaction {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid #E3E7E4; background: #FFF; color: var(--ink-soft);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; line-height: 1.4;
}
.reaction.on { border-color: var(--orange); background: #FDF3E7; color: var(--orange-ink); }

.reaction-wrap { position: relative; display: inline-flex; }
.reaction-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #FFF; font-size: 12.5px; font-weight: 500; line-height: 1.45;
  padding: 7px 11px; border-radius: 9px; white-space: normal; width: max-content; max-width: 230px;
  text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,0.18); z-index: 30;
  opacity: 0; visibility: hidden; transition: opacity 0.12s ease; pointer-events: none;
}
.reaction-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink);
}
.reaction-wrap:hover .reaction-tip { opacity: 1; visibility: visible; }

/* ---------- Post detail ---------- */
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-weight: 600; font-size: 14px; cursor: pointer; width: fit-content; }
.back-link:hover { color: var(--teal-ink); }
.detail { padding: 30px 34px; display: flex; flex-direction: column; gap: 16px; }
.detail-title { margin: 0; font-family: var(--heading); font-size: 31px; font-weight: 700; line-height: 1.2; color: var(--ink); text-wrap: pretty; }
.detail-image { width: 100%; height: 300px; object-fit: cover; border-radius: 12px; display: block; background: #F1EEE3; }
/* User-authored rich text (Quill output): render as normal block flow so lists,
   headings, quotes and spacer paragraphs keep their natural rhythm. */
.detail-body { font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.detail-body > *:first-child { margin-top: 0; }
.detail-body > *:last-child { margin-bottom: 0; }
/* Quill emits one <p> per line and blank lines as empty <p><br></p>. Keep paragraph
   margins at 0 so consecutive lines sit tight (as in the editor) and the empty
   paragraphs alone provide the spacing between sections. */
.detail-body p { margin: 0; text-wrap: pretty; }
.detail-body h1, .detail-body h2, .detail-body h3 {
    font-family: var(--heading); color: var(--ink); font-weight: 700;
    line-height: 1.25; margin: 22px 0 8px;
}
.detail-body h1 { font-size: 24px; }
.detail-body h2 { font-size: 20px; }
.detail-body h3 { font-size: 17px; }
.detail-body ul, .detail-body ol { margin: 0 0 13px; padding-left: 24px; }
.detail-body li { margin: 2px 0; }
.detail-body a { color: var(--orange-ink); text-decoration: underline; }
.detail-body a:hover { color: var(--orange-link-hover); }
.detail-body strong, .detail-body b { font-weight: 700; color: var(--ink); }
.detail-body blockquote {
    margin: 0 0 13px; padding: 4px 16px; border-left: 3px solid var(--orange);
    color: var(--ink-3);
}
.detail-body hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
/* User-authored content (Quill) can embed images with intrinsic dimensions wider than the
   column; clamp them to the container so they never overflow. */
.detail-body img { max-width: 100%; height: auto; display: block; border-radius: 8px; margin: 4px 0 13px; }
/* Quill alignment classes */
.detail-body .ql-align-center { text-align: center; }
.detail-body .ql-align-right { text-align: right; }
.detail-body .ql-align-justify { text-align: justify; }
.divider { height: 1px; background: var(--border); margin: 6px 0; }
.comments-title { margin: 0; font-family: var(--heading); font-size: 18px; font-weight: 700; color: var(--ink); }
.comment { display: flex; gap: 12px; align-items: flex-start; }
.comment-bubble { flex: 1; background: var(--field); border-radius: 4px 14px 14px 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.comment-meta { display: flex; align-items: baseline; gap: 10px; }
.comment-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.comment-time { font-size: 12px; color: var(--muted-2); }
.comment-text { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-3); }
.comment-form { display: flex; gap: 12px; align-items: center; padding-top: 4px; }
.comment-input { flex: 1; padding: 12px 18px; border: 1px solid var(--border-2); border-radius: 999px; font-family: inherit; font-size: 14.5px; background: var(--field); color: var(--ink); outline: none; }
.comment-action { background: none; border: none; padding: 0; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--muted-2); cursor: pointer; }
.comment-action:hover { color: var(--ink); text-decoration: underline; }
.comment-action.danger { color: #C0392B; }
.comment-edit { display: flex; gap: 8px; align-items: center; margin-top: 4px; }

.empty { background: var(--surface); border: 1px dashed #DDD6C6; border-radius: 16px; padding: 36px; text-align: center; color: var(--muted); font-size: 15px; }
.feed-sentinel { height: 1px; width: 100%; }

/* ---------- Sidebar widgets ---------- */
.widget { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.widget-head { display: flex; align-items: center; gap: 10px; }
.widget-title { margin: 0; font-family: var(--heading); font-size: 17px; font-weight: 700; color: var(--ink); }
.widget-icon { width: 32px; height: 32px; border-radius: 10px; background: #F1F6D2; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.row { display: flex; align-items: center; gap: 11px; }
.row-title { font-weight: 600; font-size: 14px; color: var(--ink); }
.row-sub { font-size: 12.5px; color: #8B979D; }
.stack1 { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.date-badge { width: 46px; height: 46px; border-radius: 12px; background: var(--field); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.date-badge .d { font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.1; }
.date-badge .m { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: #B3701E; }
.link-teal { color: var(--teal); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.link-teal:hover { color: var(--teal-ink); }

.congrats-btn {
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  font-family: inherit; white-space: nowrap; border: 1px solid var(--orange); background: #FFF; color: var(--orange-link-hover);
}
.congrats-btn.done { border-color: transparent; background: #F1F6D2; color: #66780C; cursor: default; }

.brief-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; cursor: pointer; }
.brief-link:hover { background: var(--field); }
.brief-label { font-weight: 600; font-size: 14px; color: var(--ink-2); flex: 1; }

/* ---------- Loading skeletons ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--field); border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- Agenda page ---------- */
.dienst-row { display: flex; align-items: center; gap: 14px; padding: 4px 0; }
.dienst-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.activity-card { padding: 16px 20px; display: flex; align-items: center; gap: 18px; }
.date-badge-lg { width: 60px; height: 60px; border-radius: 14px; background: #FDF3E7; border: 1px solid #F3E2CB; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.date-badge-lg .d { font-weight: 800; font-size: 22px; color: var(--ink); line-height: 1; }
.date-badge-lg .m { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: #B3701E; margin-top: 2px; }
.section-title { margin: 0; font-family: var(--heading); font-size: 19px; font-weight: 700; color: var(--ink); }
.card-pad { padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Gemeente ---------- */
.bday-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.bday-card { background: var(--field); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.members-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.members-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; }
.member-dir { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.member-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--field); border: 1px solid var(--border); border-radius: 14px; }
.member-card .member-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.member-detail { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.member-detail svg { color: #A8B0B5; flex-shrink: 0; }
a.member-detail:hover { color: var(--teal); }
@media (max-width: 720px) { .member-dir { grid-template-columns: 1fr; } }
.member-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.member-name { font-weight: 600; font-size: 15px; color: var(--ink); }

/* ---------- Weekbrieven ---------- */
.brief-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.brief-card { padding: 20px 22px; display: flex; align-items: center; gap: 16px; cursor: pointer; }
.brief-card:hover { border-color: var(--orange); background: #FFFCF7; }
.brief-icon { width: 44px; height: 44px; border-radius: 12px; background: #FDF3E7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brief-title { font-weight: 700; font-size: 15.5px; color: var(--ink); }

/* ---------- Compose ---------- */
.compose-card { padding: 28px 30px; display: flex; flex-direction: column; gap: 22px; }
.field-group { display: flex; flex-direction: column; gap: 8px; }
.label { font-weight: 700; font-size: 14px; color: var(--ink); }
.text-input, .textarea, .select {
  width: 100%; padding: 13px 16px; border: 1px solid var(--border-2); border-radius: 12px;
  font-family: inherit; font-size: 15.5px; background: var(--field); color: var(--ink); outline: none;
}
.textarea { font-size: 15px; line-height: 1.6; resize: vertical; }
.select { font-size: 15px; cursor: pointer; }
.hint { font-size: 13px; color: var(--muted); }
.birthdate-picker { display: flex; gap: 10px; }
.birthdate-picker .birthdate-day { flex: 0 0 80px; }
.birthdate-picker .birthdate-month { flex: 1 1 auto; }
.birthdate-picker .birthdate-year { flex: 0 0 96px; }
.cat-chip-btn { padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit; border: 1px solid var(--border-2); background: #FFF; color: var(--ink-soft); }
.cat-chip-btn.active-Algemeen { border-color: #7B93C4; background: #E9EDF5; color: #3F5375; }
.cat-chip-btn.active-Oproep { border-color: #EB8C23; background: #FBEBD8; color: #A85E08; }

/* "Plaatsen" landing chooser */
.plaatsen-choices { display: flex; flex-direction: column; gap: 14px; }
.plaatsen-choice { display: flex; align-items: center; gap: 18px; padding: 20px 22px; text-align: left; cursor: pointer; font-family: inherit; border: 1px solid var(--border-2); background: #FFF; transition: border-color .15s, box-shadow .15s, transform .05s; }
.plaatsen-choice:hover { border-color: var(--teal, #58C5C7); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.plaatsen-choice:active { transform: translateY(1px); }
.plaatsen-choice-icon { flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.plaatsen-choice-title { font-size: 17px; font-weight: 700; color: var(--ink); }

/* Rich-text editor (Quill) */
.rte .ql-toolbar { border: 1px solid var(--border-2); border-top-left-radius: 12px; border-top-right-radius: 12px; background: var(--field); }
.rte .ql-container { border: 1px solid var(--border-2); border-top: none; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; background: var(--field); font-family: inherit; font-size: 15px; }
.rte .ql-editor { min-height: 160px; line-height: 1.6; color: var(--ink); }
.rte .ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }

/* Attachments + Activiteit date fields */
.attach-list { display: flex; flex-direction: column; gap: 6px; }
.attach-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); background: var(--field); border: 1px solid var(--border-2); border-radius: 10px; padding: 7px 12px; width: fit-content; }
.attach-name { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-remove { margin-left: 2px; border: none; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.attach-remove:hover { color: #C0392B; }
.date-row { display: flex; gap: 14px; flex-wrap: wrap; }
.date-row .field-group { flex: 1; min-width: 150px; }
.toggle-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.file-zone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px; border: 1.5px dashed #D8D3C4; border-radius: 14px; background: var(--field); cursor: pointer; text-align: center; }
.file-zone:hover { border-color: var(--orange); background: #FFFCF7; }
.file-zone.has-file { border-color: var(--orange); background: #FFFCF7; }
.compose-foot { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--border); padding-top: 20px; }
.error-text { font-size: 13.5px; color: #C0392B; font-weight: 600; }

/* Blazor form validation (ValidationMessage / ValidationSummary) */
.validation-message { display: block; font-size: 13px; color: #C0392B; font-weight: 600; margin-top: 4px; }
.validation-errors { margin: 0 0 4px; padding-left: 18px; }
.validation-errors .validation-message { margin-top: 0; }
/* Highlight the offending field */
.text-input.invalid, .textarea.invalid, .select.invalid,
.text-input.modified.invalid, .textarea.modified.invalid, .select.modified.invalid { border-color: #C0392B; }

/* ---------- Profile page ---------- */
.profile-photo-row { display: flex; align-items: center; gap: 20px; }
.danger-zone { border-color: #E7C6C0; }
.danger-btn { background: #C0392B; color: #FFF; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 700; }
.danger-btn:hover:not(:disabled) { background: #A93226; }
.danger-btn:disabled { opacity: 0.55; cursor: default; }

/* ---------- Mijn berichten ---------- */
.mypost { padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.mypost.clickable { cursor: pointer; }
.mypost.clickable:hover { border-color: var(--orange); background: #FFFCF7; }
.mypost-head { display: flex; align-items: flex-start; gap: 12px; }
.mypost-title { margin: 0; font-family: var(--heading); font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--ink); flex: 1; text-wrap: pretty; }
.mypost-foot { display: flex; align-items: center; gap: 8px; }
.status-badge { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.status-badge.ok { background: #DFF3E4; color: #1E7A3E; }
.status-badge.pending { background: #FBF0D8; color: #9A6A11; }
.status-badge.rejected { background: #FBE3E0; color: #B23A2C; }
.status-badge.neutral { background: #ECEFF1; color: #566369; }
.reject-note { font-size: 13.5px; color: #B23A2C; background: #FBE3E0; border-radius: 10px; padding: 10px 12px; line-height: 1.5; }

/* ---------- Admin / Beheer ---------- */
.tab-row { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: 4px 0 20px; }
.tab {
  padding: 10px 16px; border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 14.5px; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--orange-ink); border-bottom-color: var(--orange); }
.tab-count { background: var(--orange); color: #FFF; border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
.notice { border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.notice.ok { background: #DFF3E4; color: #1E7A3E; }
.notice.err { background: #FBE3E0; color: #B23A2C; }

.admin-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.admin-row:last-child { border-bottom: none; }

.admin-split { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 20px; align-items: start; }
.admin-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.admin-list-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid transparent; background: none; border-radius: 10px; padding: 8px 10px; font-family: inherit;
}
.admin-list-item:hover { background: var(--field); }
.admin-list-item.active { background: #FDF3E7; border-color: var(--orange); }
.admin-detail { min-height: 200px; }

.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin-top: 8px; }
.role-check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.role-check.disabled { opacity: 0.55; cursor: default; }

.danger-ghost { color: #C0392B; border-color: #E7C6C0; }
.danger-ghost:hover { background: #FBEDEA; }

/* ---------- Searchable combo (member picker) ---------- */
.combo { position: relative; }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.12); max-height: 300px; overflow-y: auto; padding: 6px;
}
.combo-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none;
  background: none; border-radius: 9px; padding: 8px 10px; cursor: pointer;
  font-family: inherit; font-size: 14px; color: var(--ink-2);
}
.combo-item:hover { background: var(--field); }
.combo-empty { padding: 10px; color: var(--muted); font-size: 13.5px; }

@media (max-width: 780px) {
  .admin-split { grid-template-columns: 1fr; }
}

/* ---------- Lezen (Bijbel / Liedboek) ---------- */
.bible-text { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.bible-verse { margin: 0; font-size: 16px; line-height: 1.75; color: var(--ink-2); text-wrap: pretty; }
.verse-nr { font-size: 11px; font-weight: 700; color: var(--orange-ink); vertical-align: super; margin-right: 4px; }
.lied-text { font-size: 16px; line-height: 1.7; color: var(--ink-2); overflow-x: auto; }
.lied-text h3 { font-family: var(--heading); font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.lied-text table { border-collapse: collapse; margin-bottom: 14px; }
.lied-text td { padding: 1px 6px 1px 0; vertical-align: top; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-brand img { height: 44px; }
.login-title { font-family: var(--heading); font-weight: 700; font-size: 20px; color: var(--ink); text-align: center; }
.btn-block { width: 100%; justify-content: center; padding: 13px; }
.login-card.wide { max-width: 460px; }
.login-alt { text-align: center; font-size: 13.5px; color: var(--ink-soft); }
.login-alt .link-teal { margin-left: 4px; }
.register-done { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.register-done-icon { width: 52px; height: 52px; border-radius: 50%; background: #DFF3F3; display: flex; align-items: center; justify-content: center; }

/* ==========================================================================
   Responsive / mobile
   The layout is a fixed desktop design by default. These queries collapse the
   multi-column grids, wrap the header, and tighten spacing so it works on
   phones and small tablets.
   ========================================================================== */

/* Tablet & phone: the Prikbord feed + 350px sidebar no longer fit side by
   side, so they stack. To stop the infinite-scrolling feed from burying the
   agenda/birthday widgets, a segmented control switches between the two panes
   instead of stacking them. */
@media (max-width: 860px) {
  .prikbord-grid { grid-template-columns: 1fr; gap: 22px; }

  .mobile-tabs {
    display: flex; gap: 4px; margin-bottom: 18px; padding: 4px;
    background: var(--field); border: 1px solid var(--border); border-radius: 999px;
  }
  .mobile-tab {
    flex: 1; padding: 9px 14px; border: none; background: transparent; border-radius: 999px;
    font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  }
  .mobile-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

  .prikbord-grid.mobile-feed .sidebar { display: none; }
  .prikbord-grid.mobile-info .feed { display: none; }

  /* ----- Header: the inline nav no longer fits, so collapse it into a
     hamburger drawer. The header-spacer keeps the brand left and the
     actions (Plaatsen / avatar / hamburger) to the right. ----- */
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; }
  /* Keep the profile dropdown inside the viewport. */
  .menu-pop { max-width: calc(100vw - 24px); }

  /* Mobile nav drawer: a card dropping down from under the header. */
  .mobile-nav {
    display: flex; flex-direction: column; gap: 2px;
    position: absolute; top: calc(100% + 8px); left: 16px; right: 16px; z-index: 50;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14); padding: 8px;
  }
  .mobile-nav-link {
    display: block; padding: 12px 14px; border-radius: 9px;
    font-weight: 600; font-size: 15px; color: var(--ink-2);
  }
  .mobile-nav-link:hover { background: var(--field); }
  .mobile-nav-link.active { background: #F1F6D2; color: #5F700D; }
  .mobile-nav-sep { height: 1px; background: var(--border); margin: 6px 4px; }
  .mobile-nav-label {
    padding: 4px 14px 2px; font-size: 12px; font-weight: 700;
    letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
  }
}

@media (max-width: 640px) {
  /* Phones: tighten the header spacing. */
  .app-header { gap: 10px; padding: 12px 16px; }
  .brand-name { font-size: 17px; }

  /* ----- Page containers: less horizontal padding ----- */
  .screen, .screen-narrow, .screen-mid, .screen-compose { padding: 20px 16px 40px; }
  .screen-narrow, .screen-mid, .screen-compose { gap: 18px; }
  .page-title { font-size: 26px; }

  /* ----- Collapse every multi-column grid ----- */
  .bday-grid { grid-template-columns: repeat(2, 1fr); }
  .members-grid, .member-dir, .brief-grid, .role-grid { grid-template-columns: 1fr; }
  .admin-split { grid-template-columns: 1fr; }

  /* ----- Filter row + search stack ----- */
  .filter-row { flex-wrap: wrap; }
  .filter-row > .header-spacer { display: none; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; max-width: none; }
  .members-head { gap: 12px; }

  /* ----- Cards, posts, detail: tighter padding & smaller media ----- */
  .post { padding: 18px 18px; }
  .post-title { font-size: 20px; }
  .post-image { height: 200px; }
  .detail { padding: 22px 18px; }
  .detail-title { font-size: 24px; }
  .detail-image { height: 210px; }
  .widget { padding: 18px 18px; }
  .card-pad { padding: 20px 18px; }
  .compose-card { padding: 20px 18px; gap: 18px; }
  .mypost { padding: 18px 18px; }

  /* Comment composer wraps its send action under the input. */
  .comment-form { flex-wrap: wrap; }
  .comment-input { flex-basis: 100%; }

  /* Admin tab bar scrolls horizontally instead of overflowing. */
  .tab-row { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tab-row::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; }

  .attach-name { max-width: 200px; }
}

/* Very small phones: drop the brand wordmark, keep the logo icon. */
@media (max-width: 400px) {
  .brand-name { display: none; }
}
