/*
Bezoekmoment v1.5.8
Rustige mobiele interface.
*/

:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #687385;
  --line: #e4e0d8;
  --primary: #2563eb;
  --success: #047857;
  --warning: #b45309;
  --danger: #b91c1c;
  --neutral: #6b7280;
  --shadow: 0 10px 30px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.page {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.login-card {
  margin-top: 12vh;
}

h1, h2, h3 {
  margin: 0 0 8px;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1rem;
  margin-top: 16px;
}

.muted {
  color: var(--muted);
  margin: 0 0 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin: 12px 0 18px;
}

.small-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.stack {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 650;
}

input, button {
  width: 100%;
  font: inherit;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 13px 14px;
}

button {
  cursor: pointer;
  border: 0;
  font-weight: 750;
  background: #edf2f7;
}

.primary {
  background: var(--primary);
  color: white;
}

.secondary {
  background: #e0ecff;
  color: #123d80;
}

.warning {
  background: #fff1d6;
  color: var(--warning);
}

.danger-button {
  background: #fee2e2;
  color: var(--danger);
}

.big-danger {
  background: var(--danger);
  color: white;
  font-size: 1.3rem;
  padding: 18px;
}

.alert {
  padding: 13px 16px;
  border-radius: 16px;
  margin: 12px 0;
  font-weight: 650;
}

.success {
  background: #dcfce7;
  color: #166534;
}

.error {
  background: #fee2e2;
  color: #991b1b;
}

.date-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
}

.date-nav a {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  color: var(--text);
  text-decoration: none;
}

.date-nav a:last-child {
  text-align: center;
}

.slots {
  display: grid;
  gap: 14px;
}

.slot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 0.9rem;
}

.badge.ok {
  background: #dcfce7;
  color: var(--success);
}

.badge.danger {
  background: #fee2e2;
  color: var(--danger);
}

.badge.neutral {
  background: #e5e7eb;
  color: var(--neutral);
}

.closed {
  opacity: 0.78;
}

.full {
  opacity: 0.82;
}

.notice {
  background: #fff7ed;
  color: #9a3412;
  padding: 10px 12px;
  border-radius: 14px;
}

.names {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: grid;
  gap: 8px;
}

.names li {
  background: #f3f4f6;
  padding: 10px 12px;
  border-radius: 13px;
}

.reserve-box {
  margin-top: 12px;
}

.reserve-box summary {
  cursor: pointer;
  background: #eef2ff;
  color: #3730a3;
  padding: 13px;
  border-radius: 14px;
  font-weight: 800;
}

.inline-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: end;
}

.grid-form.compact {
  grid-template-columns: repeat(4, 1fr);
  margin: 12px 0;
}

.grid-form label {
  display: grid;
  gap: 6px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.button-row form {
  flex: 1 1 180px;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.admin-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #f9fafb;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 14px;
}

.admin-list form {
  width: auto;
}

button.small {
  width: auto;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.audit {
  display: grid;
  gap: 10px;
}

.audit-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fafafa;
}

.audit-row span {
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
}

.audit-row p {
  margin: 6px 0 0;
}

.footer {
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
  padding: 26px 0 10px;
}

@media (max-width: 680px) {
  .page {
    padding: 12px;
  }

  .topbar {
    display: block;
  }

  .date-nav {
    grid-template-columns: 1fr;
  }

  .grid-form,
  .grid-form.compact {
    grid-template-columns: 1fr;
  }

  .admin-list li {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-list form,
  .admin-list button {
    width: 100%;
  }
}


/* Bezoekmoment v1.5.8 additions */

.default-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.default-row {
  margin-top: 8px;
}

.default-list form + form {
  margin-bottom: 14px;
}

input[type="text"]::placeholder {
  color: #9ca3af;
}


/* Bezoekmoment v1.5.8 additions */

.date-picker-form {
  margin: 0;
}

.date-picker-form input[type="date"] {
  text-align: center;
  font-weight: 800;
  background: var(--card);
}


/* Bezoekmoment v1.5.8 additions */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tool-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fafafa;
}

.button-link {
  display: inline-block;
  width: 100%;
  text-align: center;
  border-radius: 14px;
  padding: 13px 14px;
  font-weight: 800;
  text-decoration: none;
}

.button-link.primary {
  background: var(--primary);
  color: white;
}

.button-link.secondary {
  background: #e0ecff;
  color: #123d80;
}

.danger-details {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.danger-details summary {
  cursor: pointer;
  font-weight: 850;
}

@media (max-width: 680px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}


/* Bezoekmoment v1.5.8 additions */

.info-box {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  padding: 12px;
  margin: 12px 0;
}


/* Bezoekmoment v1.5.8 additions */

.day-note-public {
  background: #fff7ed;
  border-color: #fed7aa;
}

.day-note-public h2 {
  color: #9a3412;
}

.day-note-public p {
  white-space: pre-wrap;
  margin-bottom: 0;
}

textarea {
  width: 100%;
  font: inherit;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 13px 14px;
  resize: vertical;
}

.staff-add-form {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin: 10px 0 14px;
}


/* Bezoekmoment v1.5.8 additions */

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.checkbox-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.pinned-note-info {
  margin-bottom: 14px;
}


/* Bezoekmoment v1.5.8 additions */

.today-button {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  font-weight: 900;
}

@media (min-width: 681px) {
  .date-nav {
    grid-template-columns: 1fr auto 1fr auto;
  }
}

/* v2.0.0: POST logout form styled like old link */
.logout-form { margin: 0; }
.logout-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* Bezoekmoment v2.1.0 additions */
:root[data-theme="dark"] {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: #374151;
  --primary: #60a5fa;
  --success: #34d399;
  --warning: #f59e0b;
  --danger: #f87171;
  --neutral: #9ca3af;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] button { background: #1f2937; color: var(--text); }
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea { background: #0b1220; color: var(--text); border-color: var(--line); }
:root[data-theme="dark"] .primary { background: #2563eb; color: white; }
:root[data-theme="dark"] .secondary,
:root[data-theme="dark"] .button-link.secondary { background: #1e3a8a; color: #dbeafe; }
:root[data-theme="dark"] .danger-button { background: #7f1d1d; color: #fee2e2; }
:root[data-theme="dark"] .warning { background: #78350f; color: #fde68a; }
:root[data-theme="dark"] .success { background: #064e3b; color: #d1fae5; }
:root[data-theme="dark"] .error { background: #7f1d1d; color: #fee2e2; }
:root[data-theme="dark"] .notice,
:root[data-theme="dark"] .day-note-public { background: #431407; border-color: #7c2d12; color: #fed7aa; }
:root[data-theme="dark"] .day-note-public h2 { color: #fdba74; }
:root[data-theme="dark"] .names li,
:root[data-theme="dark"] .admin-list li,
:root[data-theme="dark"] .audit-row,
:root[data-theme="dark"] .tool-box,
:root[data-theme="dark"] .staff-add-form,
:root[data-theme="dark"] .checkbox-row,
:root[data-theme="dark"] .danger-details { background: #0b1220; }
:root[data-theme="dark"] .date-nav a,
:root[data-theme="dark"] .date-picker-form input[type="date"] { background: var(--card); color: var(--text); }
:root[data-theme="dark"] .today-button { background: #064e3b !important; color: #d1fae5 !important; }

.theme-toggle-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 0;
}

.theme-toggle {
  width: auto;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.expired {
  opacity: 0.62;
  filter: grayscale(0.25);
}

.expired-text {
  margin-top: 12px;
  font-weight: 750;
}

.name-warning {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  padding: 10px 12px;
  border-radius: 14px;
  margin: 0;
  font-weight: 650;
}

:root[data-theme="dark"] .name-warning {
  background: #431407;
  color: #fed7aa;
  border-color: #7c2d12;
}

.own-delete-form {
  margin-top: 8px;
}

.names li {
  display: grid;
  gap: 6px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0f172a;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --line: #374151;
    --primary: #60a5fa;
    --success: #34d399;
    --warning: #f59e0b;
    --danger: #f87171;
    --neutral: #9ca3af;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

/* v2.1.5 - dag-specifieke max bezoekers */
.max-override-box {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  margin: 0.8rem 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
}
.max-override-box.active {
  border-color: var(--primary);
}
.max-override-box.active::before {
  content: "Afwijkend maximum actief";
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}
.max-override-form {
  align-items: end;
}
.max-override-form input[type="number"] {
  max-width: 7rem;
}
.advanced-slot-edit {
  margin: 0.75rem 0;
}
.advanced-slot-edit summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

/* Bezoekmoment v2.1.7 additions */
.site-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
  opacity: 0.82;
}

.site-logo {
  height: auto;
  max-height: none;
  object-fit: contain;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.check-row input[type="checkbox"] {
  width: auto;
}

.logo-preview-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft);
}

.logo-preview-box img {
  height: auto;
  max-height: none;
  object-fit: contain;
}

.small-top {
  margin-top: 10px;
}

.visitor-info-public {
  display: inline-block;
  width: auto;
  max-width: 100%;
  padding: 14px 16px;
  background: var(--soft);
}

.visitor-info-public p {
  margin: 0;
  white-space: normal;
}


/* Bezoekmoment v2.1.14 additions */
.public-link-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.public-link-value {
  flex: 1 1 260px;
  min-width: 0;
  display: inline-block;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
}


/* Bezoekmoment v2.1.14 setup wizard and logo sizing */
.site-logo {
  display: block;
  max-width: 90vw;
}
.setup-card {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.setup-header {
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.terms-box {
  max-height: 42vh;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft);
  line-height: 1.55;
  margin-bottom: 16px;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Bezoekmoment v2.1.15 branding header, fixed logo frame and about modal */
.brand-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  margin: 0 0 18px;
}

.site-logo-frame {
  width: min(92vw, 420px);
  height: clamp(72px, 16vw, 118px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.site-logo-frame .site-logo,
.site-logo {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.about-app {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
}

.about-app > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
}

.about-app > summary::-webkit-details-marker {
  display: none;
}

.about-app[open] > summary {
  color: var(--text);
}

.about-app-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(88vw, 430px);
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  color: var(--text);
  line-height: 1.55;
  white-space: normal;
}

@media (max-width: 720px) {
  .brand-header {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .about-app {
    position: static;
    transform: none;
    align-self: center;
  }

  .about-app-panel {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 82px;
    width: auto;
    max-height: calc(100vh - 120px);
  }
}


/* Bezoekmoment v2.1.16 - nette headeracties en transparant schaalbaar logokader */
.app-header {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin: 0 0 18px;
}

.header-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 0;
}

.header-action,
.theme-toggle.header-action,
.about-app > summary.header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 72%, transparent);
  color: var(--muted);
  box-shadow: none;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
}

.header-action:hover,
.theme-toggle.header-action:hover,
.about-app > summary.header-action:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--line) 60%, var(--text));
}

.theme-toggle-wrap {
  display: contents;
  margin: 0;
}

.brand-header {
  display: contents;
  margin: 0;
}

.site-logo-frame {
  width: min(92vw, var(--logo-frame-width, 260px)) !important;
  height: clamp(72px, calc(var(--logo-frame-width, 260px) * 0.36), 170px) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent) !important;
  border-radius: 18px;
  background: transparent !important;
  overflow: hidden;
  box-shadow: none !important;
}

.site-logo-frame .site-logo {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.about-app {
  position: relative !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  z-index: 30;
}

.about-app-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(88vw, 430px);
  max-height: min(70vh, 520px);
}

@media (max-width: 720px) {
  .header-actions {
    justify-content: center;
  }

  .header-action,
  .theme-toggle.header-action,
  .about-app > summary.header-action {
    font-size: 0.82rem;
    padding: 7px 10px;
  }

  .site-logo-frame {
    width: min(94vw, var(--logo-frame-width, 260px)) !important;
  }

  .about-app-panel {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 68px;
    width: auto;
    max-height: calc(100vh - 100px);
  }
}
