/* --- Email wijzig modal voor admin --- */
.email-edit-modal {
  position: fixed;
  z-index: 10000;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.email-edit-modal .modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.25);
}
.email-edit-modal .modal-content {
  position: relative;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  z-index: 1;
  min-width: 320px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.email-edit-modal h3 {
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-size: 1.2rem;
  font-weight: bold;
}
.email-edit-modal input[type="email"] {
  font-size: 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 1.2rem;
}
.email-edit-modal .modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}
.email-edit-modal button {
  font-size: 1rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.email-edit-modal button.modal-cancel {
  background: var(--muted);
}
.email-edit-modal button:hover {
  background: var(--accent-dark);
}
.email-edit-modal button.modal-cancel:hover {
  background: #a8a29e;
}
/* --- Mooie dropdowns voor admin --- */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fff url('data:image/svg+xml;utf8,<svg fill="%231d1a16" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 7.293a1 1 0 011.414 0L10 8.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>') no-repeat right 1rem center/1.2em;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 2.5rem 0.85rem 1rem;
  font-size: 1rem;
  color: var(--ink);
  transition: border 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(73, 57, 33, 0.04);
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

select option {
  color: var(--ink);
}
:root {
  --bg: #f4efe6;
  --panel: #fffdf9;
  --line: #d9c9b0;
  --ink: #1d1a16;
  --muted: #6b6257;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --error: #b42318;
  --success: #0f766e;
  --shadow: 0 18px 40px rgba(73, 57, 33, 0.12);
  --shell-max-width: clamp(1100px, 92vw, 1680px);
  --viewport-width: 100vw;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(248, 242, 232, 0.34) 0%, rgba(244, 239, 230, 0.48) 100%),
    url('/images/background.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #fff;
}

.page-shell {
  width: min(var(--shell-max-width), calc(var(--viewport-width) - clamp(1rem, 2vw, 3rem)));
  margin: 0 auto;
  padding: clamp(0.75rem, 0.8vw, 1.25rem) 0 clamp(2rem, 2.6vw, 3.5rem);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.2rem;
  border-radius: 18px;
  background: rgba(186, 192, 200, 0.92);
  border: 1px solid rgba(164, 171, 180, 0.95);
  box-shadow: 0 10px 24px rgba(25, 33, 41, 0.18);
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  color: #f7f9fc;
}

.group-label {
  margin-left: 0.8rem;
  color: #eef2f7;
}

.topnav {
  display: flex;
  gap: 1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.15rem;
  background: rgba(245, 248, 252, 0.2);
  border: 1px solid rgba(245, 248, 252, 0.35);
  color: #f8fbff;
}

.icon-button:hover {
  background: rgba(245, 248, 252, 0.3);
}

.topnav a {
  text-decoration: none;
  color: #f7f9fc;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(245, 248, 252, 0.14);
  border: 1px solid rgba(245, 248, 252, 0.28);
}

.topnav a:hover {
  background: rgba(245, 248, 252, 0.24);
}

.flash,
.panel,
.hero-card {
  border: 1px solid rgba(217, 201, 176, 0.9);
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow);
}

.flash {
  margin-bottom: 1rem;
  border-radius: 18px;
  padding: 1rem 1.2rem;
}

.flash-error {
  color: var(--error);
}

.flash-success {
  color: var(--success);
}

.hero-card,
.panel {
  border-radius: 28px;
  padding: clamp(1.2rem, 1.1vw + 0.7rem, 2rem);
  margin-bottom: 1.25rem;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.summary-card {
  border: 1px solid rgba(217, 201, 176, 0.9);
  border-radius: 24px;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow);
}

.narrow {
  max-width: 560px;
  margin: 3rem auto;
}

.eyebrow {
  margin: 0 0 0.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.stack-form label,
.inline-form {
  display: grid;
  gap: 0.4rem;
}

.inline-check {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.split-panel {
  display: grid;
  gap: 1rem;
}

.inline-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--line);
  text-decoration: none;
}

.section-heading {
  margin-bottom: 1rem;
}

.group-admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.group-admin-toolbar__actions {
  margin-left: auto;
}

.group-admin-create-button {
  white-space: nowrap;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem;
  background: #fff;
}

.item-card__media {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 0.8rem;
  border: 1px solid var(--line);
}

.item-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.item-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.badge {
  align-self: start;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-dark);
  font-size: 0.9rem;
}

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

.stats div {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem;
}

.stats dt {
  font-size: 0.8rem;
  color: var(--muted);
}

.stats dd {
  margin: 0.3rem 0 0;
  font-size: 1.2rem;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0.75rem;
  text-align: center;
}

th:first-child,
td:first-child {
  text-align: left;
}

th small {
  display: block;
  color: var(--muted);
}

.item-header-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.item-settings-trigger {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  padding: 0;
}

.member-cell-header {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.link-button {
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.15rem 0.35rem;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.link-button:hover {
  background: rgba(15, 118, 110, 0.12);
  color: var(--ink);
}

.member-admin-form {
  display: inline;
}

.member-admin-button {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  line-height: 1;
}

.member-admin-button--promote {
  background: #2563eb;
}

.member-admin-button--promote:hover {
  background: #1d4ed8;
}

.member-admin-button--demote {
  background: #fca5a5;
  color: #7f1d1d;
}

.member-admin-button--demote:hover {
  background: #f87171;
  color: #7f1d1d;
}

.danger-button {
  background: #b42318;
}

.danger-button:hover {
  background: #912018;
}

.transactions-state {
  margin-top: 0.75rem;
}

.is-hidden {
  display: none !important;
}

.counter-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.counter-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  font-weight: 700;
}

.shared-value {
  display: block;
  margin-top: 0.3rem;
  min-height: 1.1rem;
}

.square-button {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 12px;
}

.item-note {
  margin-top: 0.85rem;
  font-size: 0.95rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 26, 0.5);
}

.modal__content {
  position: relative;
  width: min(620px, calc(100% - 2rem));
  margin: 8vh auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  max-height: 84vh;
  overflow-y: auto;
}

.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border-radius: 10px;
  width: 2rem;
  height: 2rem;
  padding: 0;
}

.modal__stack {
  display: grid;
  gap: 1rem;
}

.modal__section-title {
  margin: 0;
}

.modal__divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.35rem 0;
}

.modal select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #fff;
}

@media (max-width: 760px) {
  .topbar,
  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .topnav,
  .inline-form {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .group-admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .group-admin-toolbar__actions {
    margin-left: 0;
    width: 100%;
  }

  .group-admin-create-button {
    width: 100%;
  }
}