@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders:wght@600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --linen: #F6F3EC;
  --ink: #1E2B33;
  --teal: #2F6B63;
  --brass: #C68A3D;
  --mist: #E2EAE6;
  --clay: #B14B36;
  --font-display: 'Big Shoulders', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--linen);
  font-family: var(--font-body);
  color: var(--ink);
}

a { text-decoration: none; color: inherit; }

/* Header */
.wd-header {
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  flex-wrap: wrap;
}
.wd-brand { display: flex; align-items: center; gap: 12px; }
.wd-brand-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brass);
  display: flex; align-items: center; justify-content: center;
}
.wd-brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: 0.03em; color: var(--linen); line-height: 1;
}
.wd-brand-tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--linen); opacity: 0.55;
}
.wd-nav { display: flex; gap: 4px; background: rgba(255,255,255,0.1); border-radius: 999px; padding: 4px; }
.wd-nav a { font-size: 14px; font-weight: 500; padding: 7px 16px; border-radius: 999px; color: var(--linen); transition: 0.15s; }
.wd-nav a.active { background: var(--linen); color: var(--ink); }

.wd-main { max-width: 1080px; margin: 0 auto; padding: 28px 24px 60px; }

.wd-page-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0; }

/* Flash messages */
.wd-flash {
  background: rgba(47,107,99,0.1); color: var(--teal);
  padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 18px;
}
.wd-flash-error { background: rgba(177,75,54,0.1); color: var(--clay); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; padding: 9px 16px;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  background: none; font-family: var(--font-body); color: var(--ink);
  line-height: 1;
}
.btn-primary { background: var(--teal); color: white; }
.btn-outline { border-color: var(--mist); color: var(--ink); background: white; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn .rotating { animation: wd-spin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .btn .rotating { animation: none; }
}
@keyframes wd-spin { to { transform: rotate(360deg); } }

/* Stats */
.wd-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.wd-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.wd-plate { background: white; border: 1px solid var(--mist); border-radius: 12px; padding: 10px 18px; min-width: 90px; }
.wd-plate .num { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.wd-plate .lbl { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.55; margin-top: 3px; }

/* Day groups */
.wd-day { margin-bottom: 32px; }
.wd-day-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wd-day-head h3 { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin: 0; font-weight: 500; }
.wd-day-line { flex: 1; height: 1px; background: var(--mist); }
.wd-tags { display: flex; flex-wrap: wrap; gap: 16px; }

/* Door-hanger taakkaartje */
.wd-tag {
  position: relative; background: white; border: 1px solid var(--mist);
  border-radius: 16px; padding: 26px 16px 16px; width: 230px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04); transition: 0.15s;
}
.wd-tag:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.08); transform: rotate(-1deg); }
@media (prefers-reduced-motion: reduce) {
  .wd-tag:hover { transform: none; }
}
.wd-tag .string { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 36px; height: 6px; border-radius: 999px; opacity: 0.4; }
.wd-tag .hole { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--linen); border: 2px solid var(--mist); }
.wd-tag .stamp {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: 4px; border: 1.5px solid currentColor;
  transform: rotate(-6deg); background: none; cursor: pointer;
}
.wd-tag .stamp:hover { transform: rotate(-6deg) scale(1.06); }
.wd-tag .pname { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.wd-tag .pdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wd-tag .pdate { font-family: var(--font-mono); font-size: 12px; opacity: 0.6; margin-bottom: 12px; }
.wd-tag select {
  width: 100%; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--mist);
  font-size: 13px; font-family: var(--font-body); background: white; color: var(--ink);
}

/* Empty state */
.wd-empty { text-align: center; padding: 80px 20px; }
.wd-empty .icon { width: 56px; height: 56px; border-radius: 16px; background: var(--mist); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.wd-empty h2 { font-family: var(--font-display); font-size: 26px; margin: 0 0 8px; }
.wd-empty p { max-width: 420px; margin: 0 auto 22px; opacity: 0.65; font-size: 14px; line-height: 1.5; }

/* Huizen & Schoonmakers grids */
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.wd-card { background: white; border: 1px solid var(--mist); border-radius: 16px; padding: 16px; }
.wd-cleaner-card { display: flex; align-items: center; justify-content: space-between; }
.wd-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.wd-card-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.wd-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.wd-card-actions { display: flex; gap: 2px; flex-shrink: 0; }
.wd-icon-btn { background: none; border: none; padding: 6px; border-radius: 8px; cursor: pointer; display: flex; color: var(--ink); opacity: 0.65; }
.wd-icon-btn:hover { background: var(--linen); opacity: 1; }
.wd-address { font-size: 12px; opacity: 0.55; margin: 0 0 10px; }
.wd-ical-row { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 5px; color: var(--ink); opacity: 0.85; }
.wd-ical-row .ical-label { font-weight: 500; }
.wd-ical-row .ok { color: var(--teal); display: inline-flex; align-items: center; gap: 3px; }
.wd-ical-row .err { color: var(--clay); display: inline-flex; align-items: center; gap: 3px; cursor: help; }
.wd-ical-row .muted { opacity: 0.5; }
.wd-ical-row.muted { opacity: 0.45; font-style: italic; }
.wd-add-card {
  border: 2px dashed var(--mist); border-radius: 16px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; padding: 30px; color: var(--ink); opacity: 0.55; font-size: 14px; font-weight: 500;
}
.wd-add-card:hover { opacity: 0.85; }

.wd-cleaner-avatar {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: white; font-family: var(--font-display); font-weight: 700; font-size: 14px; flex-shrink: 0;
}

/* Formulieren */
.wd-form { max-width: 560px; background: white; border: 1px solid var(--mist); border-radius: 16px; padding: 26px; margin-top: 18px; }
.wd-form label { display: block; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.6; margin-bottom: 6px; }
.wd-form input[type="text"], .wd-form input[type="url"] {
  width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--mist);
  font-size: 14px; font-family: var(--font-body); margin-bottom: 18px; color: var(--ink);
  box-sizing: border-box;
}
/* Inside flex rows (iCal list) the width:100% is handled by flex:1 */
.wd-ical-edit-row input[type="text"],
.wd-ical-edit-row input[type="url"] {
  width: auto;
}
.wd-swatches { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.wd-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.wd-swatch.selected { border-color: var(--ink); box-shadow: 0 0 0 2px var(--linen); }
.wd-ical-edit-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.wd-ical-edit-row input { margin-bottom: 0 !important; }
.wd-ical-edit-row .label-input { width: 110px; flex-shrink: 0; }
.wd-ical-edit-row .url-input { flex: 1; font-family: var(--font-mono); font-size: 12.5px; }
.wd-add-ical-btn {
  color: var(--teal); background: none; border: none; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; margin: 4px 0 18px; padding: 0;
}
.wd-help { font-size: 12px; opacity: 0.55; line-height: 1.55; margin-bottom: 22px; }
.wd-form-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 640px) {
  .wd-header { padding: 14px 16px; }
  .wd-main { padding: 20px 14px 50px; }
  .wd-tag { width: 100%; }
  .wd-ical-edit-row { flex-wrap: wrap; }
  .wd-ical-edit-row .label-input { width: 100%; }
}

/* ── Login-systeem toevoegingen ─────────────────────────────────── */

/* Userbar in de header */
.wd-userbar {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
  flex-shrink: 0;
}
.wd-username {
  font-size: 13px; font-weight: 500; color: var(--linen); opacity: 0.85;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wd-logout {
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: var(--linen); opacity: 0.65;
  background: rgba(255,255,255,0.1);
}
.wd-logout:hover { opacity: 1; background: rgba(255,255,255,0.2); }

/* Rol-badges */
.wd-role-badge {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.05em; color: white; padding: 3px 8px; border-radius: 999px;
  font-weight: 500; flex-shrink: 0;
}

/* Gebruikers-tabel (admin) */
.wd-user-table {
  background: white; border: 1px solid var(--mist); border-radius: 14px; overflow: hidden;
}
.wd-user-head, .wd-user-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 120px 80px;
  gap: 12px; align-items: center; padding: 13px 18px;
}
.wd-user-head {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.04em; opacity: 0.5; background: var(--linen);
  border-bottom: 1px solid var(--mist);
}
.wd-user-row { border-bottom: 1px solid var(--mist); }
.wd-user-row:last-child { border-bottom: none; }

/* Beheerder-checklijst in property_form */
.wd-beheerder-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.wd-check-row {
  display: flex; align-items: center; gap: 8px; background: var(--linen);
  border: 1px solid var(--mist); border-radius: 8px; padding: 7px 12px;
  font-size: 13px; cursor: pointer;
}
.wd-check-row input[type="checkbox"] { accent-color: var(--teal); }

/* Toewijzingslabel voor beheerders (read-only) */
.wd-assigned-name {
  font-size: 12px; opacity: 0.65; font-style: italic; padding: 2px 0;
}

@media (max-width: 640px) {
  .wd-user-head { display: none; }
  .wd-user-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .wd-userbar .wd-username { display: none; }
}

/* ── Schoonmaakster-rol toevoegingen ─────────────────────────────── */

/* Gebruikerstabel: 5 kolommen nu */
.wd-user-head, .wd-user-row {
  grid-template-columns: 2fr 1.5fr 130px 140px 70px;
}

/* Schoonmaaknaam-pill in gebruikerstabel */
.wd-cleaner-pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: white; padding: 3px 9px; border-radius: 999px;
  font-family: var(--font-body); white-space: nowrap;
}

@media (max-width: 640px) {
  .wd-user-head, .wd-user-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Geannuleerde taakkaarten ─────────────────────────────────────── */
.wd-tag-cancelled {
  opacity: 0.45;
  filter: grayscale(0.6);
}
.wd-tag-cancelled .string { background: #bbb !important; }

/* ── Bevestiging e-mail knop ─────────────────────────────────────── */
.wd-confirm-btn {
  margin-top: 6px; padding: 5px 11px; border-radius: 7px;
  font-size: 11px; font-family: var(--font-body); font-weight: 600;
  border: 1px solid var(--brass); color: var(--brass); background: transparent;
  cursor: pointer; transition: background .15s, color .15s;
  white-space: nowrap;
}
.wd-confirm-btn:hover:not(:disabled) { background: var(--brass); color: white; }
.wd-confirm-btn:disabled { opacity: 0.45; cursor: default; }
.wd-confirm-btn[data-notified] { background: rgba(47,107,99,.1); color: var(--teal); border-color: var(--teal); }

/* ── Sectielabel ─────────────────────────────────────────────────── */
.wd-section-label {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; opacity: .6;
}

/* ── Opmerkingen op taken ─────────────────────────────────────────── */
.wd-comments-btn {
  margin-top: 6px; padding: 4px 10px; border-radius: 7px;
  font-size: 11px; font-family: var(--font-body); font-weight: 500;
  border: 1px solid var(--mist); color: var(--ink); background: transparent;
  cursor: pointer; transition: background .15s; opacity: .7;
  white-space: nowrap; display: block; text-align: left;
}
.wd-comments-btn:hover { background: var(--mist); opacity: 1; }
.wd-comments-btn.has-comments { opacity: 1; border-color: var(--teal); color: var(--teal); }

.wd-comments-panel {
  margin-top: 8px; padding: 10px 12px;
  background: rgba(0,0,0,.03); border-radius: 10px;
  font-size: 13px;
}
.wd-comment-item {
  padding: 5px 0; border-bottom: 1px solid rgba(0,0,0,.06);
}
.wd-comment-item:last-of-type { border-bottom: none; }
.wd-comment-meta {
  font-family: var(--font-mono); font-size: 10px; opacity: .5;
  margin-bottom: 3px;
}
.wd-comment-text { line-height: 1.45; }

.wd-comment-form {
  display: flex; gap: 6px; margin-top: 10px;
}
.wd-comment-form textarea {
  flex: 1; padding: 7px 10px; border-radius: 7px;
  border: 1px solid var(--mist); font-size: 12px;
  font-family: var(--font-body); resize: none; min-height: 34px;
  color: var(--ink); background: white;
}
.wd-comment-form button {
  padding: 0 12px; border-radius: 7px;
  background: var(--teal); color: white; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.wd-comment-form button:disabled { opacity: .5; cursor: default; }
.wd-comments-empty { opacity: .5; font-style: italic; font-size: 12px; padding: 4px 0; }
