:root {
  /* Winkels design tokens (nkb-winkels/admin-ui + public site) */
  --background: #f9fafb;
  --foreground: #111827;
  --card: #ffffff;
  --muted: #6b7280;
  --muted-strong: #4b5563;
  --border: #e5e7eb;
  --border-soft: #f3f4f6;
  --primary: #18a11a;
  --primary-hover: #136b13;
  --primary-dark: #0f4d11;
  --primary-foreground: #ffffff;
  --primary-soft: rgba(24, 161, 26, 0.12);
  --accent: var(--primary);
  --accent-fg: var(--primary-foreground);
  --hover: #f9fafb;
  --active: #f3f4f6;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --ok-border: #abefc6;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --info-border: #dbeafe;
  --radius: 0.625rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* —— Auth (winkels login card) —— */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--background);
}

.auth-card {
  width: min(100%, 28rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.auth-brand-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-card-wide {
  width: min(100%, 34rem);
}

.auth-switch {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.auth-hint {
  margin: -0.35rem 0 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.store-search {
  position: relative;
  margin-bottom: 1rem;
}

.store-search input {
  margin-bottom: 0;
}

.store-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 14rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

.store-result {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.store-result:hover,
.store-result.is-active {
  background: var(--active);
}

.store-result strong {
  display: block;
  font-size: 0.875rem;
}

.store-result span {
  font-size: 0.75rem;
  color: var(--muted);
}

.store-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f9fafb;
}

.store-selected strong {
  display: block;
  font-size: 0.875rem;
}

.store-selected span {
  font-size: 0.75rem;
  color: var(--muted);
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--muted-strong);
}

.auth-check input {
  width: auto;
  margin: 0.15rem 0 0;
}

.geo-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.geo-status {
  font-size: 0.75rem;
  color: var(--muted);
}

.auth-card-head {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card-head h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--foreground);
}

.auth-card-head p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-strong);
}

.auth-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.auth-form input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  margin-bottom: 1rem;
}

.auth-form input:focus {
  outline: 2px solid rgba(24, 161, 26, 0.25);
  border-color: var(--primary);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.auth-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.auth-icon-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.auth-icon-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.home-feed-section {
  margin: 0 0 2rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.15rem;
}

.news-filter {
  border: 1px solid var(--border);
  background: #fff;
  color: #4b5563;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.news-filter:hover,
.news-filter.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.checklist {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  color: var(--muted-strong);
}

.checklist li {
  margin: 0.35rem 0;
}

.signup-status {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
}

.signup-status-pending_review {
  background: var(--warn-bg);
  color: var(--warn);
}

.signup-status-pending_email {
  background: var(--info-bg);
  color: var(--info);
}

.signup-status-active {
  background: var(--ok-bg);
  color: var(--ok);
}

.alert {
  font-size: 0.875rem;
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.btn-secondary {
  background: #fff;
  color: var(--foreground);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--hover);
  filter: none;
}

.btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--active);
  filter: none;
}

/* —— App shell (winkels admin pattern) —— */
.shell {
  min-height: 100vh;
}

@media (min-width: 768px) {
  .shell {
    display: flex;
  }
}

.sidebar {
  display: flex;
  width: 14rem;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
  padding: 1rem;
  text-decoration: none;
}

.sidebar-brand:hover {
  background: var(--hover);
}

.brand-mark {
  display: flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
}

.brand-sub {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.nav-btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.625rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: #4b5563;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
}

.nav-btn + .nav-btn {
  margin-top: 0.25rem;
}

.nav-btn:hover {
  background: var(--hover);
  color: #111827;
}

.nav-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 500;
}

.nav-btn.active:hover {
  background: var(--primary-hover);
  color: var(--primary-foreground);
}

.nav-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.nav-divider {
  margin: 1rem 0;
  border-top: 1px solid var(--border-soft);
}

.sidebar-user {
  border-top: 1px solid var(--border-soft);
  padding: 0.75rem;
}

.sidebar-user-name {
  padding: 0 0.75rem 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-desktop {
  display: none;
}

@media (min-width: 768px) {
  .sidebar-desktop {
    display: flex;
    position: sticky;
    top: 0;
    height: 100vh;
  }
}

.mobile-overlay {
  display: none;
}

.mobile-overlay.is-open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 40;
}

@media (min-width: 768px) {
  .mobile-overlay.is-open {
    display: none;
  }
}

.mobile-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  padding: 0;
}

.mobile-overlay .sidebar {
  position: relative;
  z-index: 50;
  height: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.shell-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  opacity: 1;
  transition: opacity 0.12s ease;
}

html.portal-booting .shell-main {
  opacity: 0;
}

.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 0.75rem 1rem;
}

@media (min-width: 768px) {
  .mobile-topbar {
    display: none;
  }
}

.mobile-topbar-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  color: var(--foreground);
}

.icon-btn:hover {
  background: var(--active);
}

.page {
  flex: 1;
}

.page-inner {
  margin: 0 auto;
  max-width: 72rem;
  padding: 1rem;
}

@media (min-width: 640px) {
  .page-inner {
    padding: 2rem;
  }
}

.view {
  display: none;
}

.view.active {
  display: block;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.subtitle {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 42rem;
}

.card-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
}

.card-head-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon {
  display: flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.card-icon svg {
  width: 1rem;
  height: 1rem;
}

.card h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}

.card-link:hover {
  color: var(--primary);
}

.card-body {
  flex: 1;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--muted-strong);
}

.card-body p {
  margin: 0 0 0.75rem;
}

.card-body p:last-child {
  margin-bottom: 0;
}

.card-foot {
  border-top: 1px solid var(--border);
  background: #f9fafb;
  padding: 0.75rem 1.25rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.stat-pill {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.5rem 0.75rem;
}

.stat-pill p {
  margin: 0;
}

.stat-pill .label {
  font-size: 0.75rem;
  color: #6b7280;
}

.stat-pill .value {
  font-size: 1.125rem;
  font-weight: 600;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem;
  max-width: 44rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.panel p {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 44rem;
}

.news-empty,
.news-loading {
  border: 1px dashed var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  background: #fff;
  min-height: 4.5rem;
}

.news-empty-error {
  border-color: var(--danger-border);
  color: var(--danger);
}

.news-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.1rem 1.25rem;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.news-card-meta time {
  font-size: 0.78rem;
  color: var(--muted);
}

.news-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.news-body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
}

.news-author {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.news-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.news-badge-update {
  background: #ecfdf5;
  color: #15803d;
}

.news-badge-feature {
  background: var(--info-bg);
  color: var(--info);
}

.news-badge-announcement {
  background: var(--warn-bg);
  color: var(--warn);
}

.news-badge-maintenance {
  background: #f3f4f6;
  color: #4b5563;
}

.news-admin-panel {
  margin-bottom: 1rem;
}

.news-admin-heading {
  margin: 1.1rem 0 0.55rem;
  font-size: 0.92rem;
}

.news-form label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.news-form input,
.news-form select,
.news-form textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0.85rem;
}

.news-form textarea {
  resize: vertical;
  min-height: 7rem;
}

.news-checkbox {
  display: flex !important;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem !important;
  color: var(--foreground) !important;
  margin-bottom: 0.85rem !important;
}

.news-checkbox input {
  width: auto;
  margin: 0;
}

.news-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.news-admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #f9fafb;
}

.news-admin-item-main strong {
  display: block;
  font-size: 0.875rem;
}

.news-admin-item-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.news-admin-item-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.news-admin-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.news-delete-btn {
  color: var(--danger);
}

.settings-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.settings-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.settings-list li:last-child {
  border-bottom: none;
}

.settings-list span {
  color: var(--muted);
  font-size: 0.78rem;
  display: block;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-card-name {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0 0 0.15rem;
}

.profile-card-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.user-menu-wrap {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.55rem 0.28rem 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.user-menu-trigger:hover,
.user-menu-wrap.is-open .user-menu-trigger {
  background: var(--hover);
}

.user-menu-name {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 600;
}

.user-menu-chevron {
  color: var(--muted);
  font-size: 0.65rem;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 14rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 12px 36px rgba(17, 24, 39, 0.14);
  padding: 0.35rem;
  z-index: 30;
}

.user-menu-panel[hidden] {
  display: none !important;
}

.user-menu-head {
  padding: 0.45rem 0.65rem 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.user-menu-head strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--foreground);
  margin-top: 0.15rem;
}

.user-menu-email {
  display: block;
  font-size: 0.72rem;
  word-break: break-all;
}

.user-menu-item {
  display: flex;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.8125rem;
  cursor: pointer;
  text-align: left;
}

.user-menu-item:hover {
  background: var(--hover);
}

.user-menu-item-logout {
  color: var(--danger);
}

.desktop-topbar {
  display: none;
  justify-content: flex-end;
  padding: 1rem 2rem 0;
}

@media (min-width: 768px) {
  .desktop-topbar {
    display: flex;
  }
}
