/* =============================================
   WEEKMENU — Stylesheet
   Licht, snel, groen subtiel accent
   ============================================= */

:root {
  --green-50:  #f2f7f2;
  --green-100: #e4efe4;
  --green-200: #c4dcc4;
  --green-400: #7ab57a;
  --green-600: #4a8a4a;
  --green-800: #2d5a2d;

  --text-primary:   #1a2b1a;
  --text-secondary: #4a5c4a;
  --text-muted:     #8a9d8a;

  --bg:        #fafcfa;
  --bg-card:   #ffffff;
  --border:    #dce8dc;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(40,80,40,.07);
  --shadow-md: 0 4px 16px rgba(40,80,40,.10);

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Header ─────────────────────────────────── */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.leaf {
  color: var(--green-400);
  font-size: 1.1rem;
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--green-800);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.week-badge {
  appearance: none;
  -webkit-appearance: none;
  background: var(--green-100);
  color: var(--green-600);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 1.6rem 0.2rem 0.55rem;
  border-radius: 99px;
  border: 1px solid var(--green-200);
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%234a8a4a' d='M0 0l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 10px 6px;
  transition: border-color 0.15s, background-color 0.15s;
}

.week-badge:hover {
  background-color: var(--green-200);
  border-color: var(--green-400);
}

.week-badge:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 2px rgba(122, 181, 122, 0.4);
}

.header-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.alert-error {
  background: #fff5f5;
  border-top: 1px solid #fcc;
  color: #c53030;
  font-size: 0.85rem;
  padding: 0.5rem 1.5rem;
  text-align: center;
}

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--green-600);
  color: #fff;
  border-color: var(--green-600);
}
.btn-primary:hover { background: var(--green-800); border-color: var(--green-800); }

.btn-secondary {
  background: var(--green-50);
  color: var(--green-800);
  border-color: var(--green-200);
}
.btn-secondary:hover { background: var(--green-100); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); }

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

/* ── Main / Week Grid ────────────────────────── */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

.week-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.grid-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.grid-row + .grid-row {
  border-top: 1px solid var(--border);
}

.grid-cell {
  padding: 0.75rem 0.6rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.grid-cell:last-child { border-right: none; }

/* Rij 1 – Dag */
.row-days { background: var(--green-50); }

.cell-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.day-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--green-800);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.day-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Rij 2 – Afbeelding placeholder */
.row-images { background: var(--bg-card); }

.cell-image { padding: 0.6rem; }

.image-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--green-50);
  border: 1px dashed var(--green-200);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
}

.placeholder-icon {
  color: var(--green-200);
  font-size: 1.2rem;
}

/* Rij 3 – Receptnaam */
.row-recipes { background: var(--bg-card); }

.cell-recipe {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.recipe-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.clickable-recipe {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--green-200);
  text-underline-offset: 3px;
  color: var(--green-800);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.clickable-recipe:hover {
  color: var(--green-600);
  text-decoration-color: var(--green-400);
}

.ingredients-table tr:last-child td {
  border-bottom: none !important;
}

.recipe-empty {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Rij 4 – Bron */
.row-sources { background: var(--green-50); }

.cell-source {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.source-link {
  font-size: 0.75rem;
  color: var(--green-600);
  text-decoration: none;
  word-break: break-all;
}
.source-link:hover { text-decoration: underline; color: var(--green-800); }

.source-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ── Modals ──────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,40,20,.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 420px;
  animation: modalIn .18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--green-800);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal-footer {
  padding: 0.9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* ── Forms ───────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  transition: border-color .15s;
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 2px rgba(122,181,122,.15);
}

.field-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.required { color: #c53030; }

.form-msg {
  font-size: 0.8rem;
  min-height: 1.2em;
  border-radius: var(--radius-sm);
  padding: 0;
  transition: all .2s;
}

.form-msg.success {
  color: var(--green-600);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  padding: 0.4rem 0.7rem;
}

.form-msg.error {
  color: #c53030;
  background: #fff5f5;
  border: 1px solid #fcc;
  padding: 0.4rem 0.7rem;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .week-grid { overflow-x: auto; }
  .grid-row  { min-width: 560px; }
  .main-content { padding: 1rem 0.75rem 2rem; }
  .header-inner { padding: 0.75rem 0.75rem; }
}

@media (max-width: 500px) {
  .header-title h1 { font-size: 1.15rem; }
  .btn { font-size: 0.78rem; padding: 0.4rem 0.75rem; }
  .week-badge {
    font-size: 0.68rem;
    padding: 0.15rem 1.4rem 0.15rem 0.45rem;
    background-position: right 0.45rem center;
  }
}

/* ── Login pagina ────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--green-50);
}

.login-wrap {
  width: 100%;
  max-width: 360px;
  padding: 1rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.75rem;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.login-leaf {
  color: var(--green-400);
  font-size: 1.1rem;
}

.login-logo h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--green-800);
  font-weight: 400;
}

.login-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.login-error {
  background: #fff5f5;
  border: 1px solid #fcc;
  color: #c53030;
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-full { width: 100%; justify-content: center; }

/* ── Uitlogknop in header ─────────────────────── */
.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
}
.btn-logout:hover { background: var(--green-50); color: var(--text-secondary); }
