* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --goud: #ffbc1f;
  --goud-licht: #fff8e1;
  --goud-rand: #ffe070;
  --donker: #2d2416;
  --bruin: #3a2800;
  --muted: #a09070;
  --bg: #fffbf0;
  --wit: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--donker);
}

/* ── VIEWS ── */
.view { display: none; height: 100vh; overflow: hidden; }
.view.active { display: flex; flex-direction: column; }

/* ── APP LAYOUT: sidebar + content op iPad ── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(170deg, #ffe599 0%, #ffd04d 50%, #ffbc1f 100%);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
}

.sidebar::after {
  content: '';
  position: absolute;
  bottom: -60px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  pointer-events: none;
}

.sidebar-logo {
  padding: 32px 28px 20px;
  font-family: 'Lora', serif;
  font-size: 42px;
  font-weight: 400;
  color: var(--bruin);
  letter-spacing: -1px;
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-logo .punt { color: var(--wit); }

.sidebar-clock {
  padding: 0 28px 24px;
  flex-shrink: 0;
}
.sidebar-time {
  font-family: 'Lora', serif;
  font-size: 56px;
  font-weight: 400;
  color: var(--bruin);
  line-height: 1;
  letter-spacing: -2px;
}
.sidebar-dag {
  font-family: 'Lora', serif;
  font-size: 18px;
  color: var(--bruin);
  margin-top: 4px;
}
.sidebar-datum {
  font-size: 13px;
  color: rgba(58,40,0,0.6);
  font-family: 'Lora', serif;
  font-style: italic;
  margin-top: 2px;
}

.sidebar-divider {
  margin: 0 28px;
  border: none;
  border-top: 1px solid rgba(58,40,0,0.12);
  flex-shrink: 0;
}

.sidebar-person {
  padding: 20px 28px;
  flex-shrink: 0;
}
.sidebar-person-name {
  font-family: 'Lora', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--bruin);
}
.sidebar-person-sub {
  font-size: 12px;
  color: rgba(58,40,0,0.55);
  font-family: 'Lora', serif;
  font-style: italic;
  margin-top: 3px;
}
.sidebar-tagline {
  display: inline-block;
  margin-top: 10px;
  background: rgba(255,255,255,0.45);
  color: var(--bruin);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 16px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  color: rgba(58,40,0,0.65);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Nunito', sans-serif;
}
.nav-item:hover { background: rgba(255,255,255,0.3); color: var(--bruin); }
.nav-item.active { background: rgba(255,255,255,0.55); color: var(--bruin); }
.nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }

/* Vandaag blok in sidebar */
.sidebar-vandaag {
  padding: 12px 16px 20px;
  flex-shrink: 0;
}
.sidebar-vandaag-label {
  font-size: 9px; font-weight: 700; color: rgba(58,40,0,0.45);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px;
}
.sidebar-vandaag-item {
  background: rgba(255,255,255,0.45);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  display: flex; gap: 10px; align-items: flex-start;
}
.sidebar-vandaag-tijd {
  font-family: 'Lora', serif;
  font-size: 15px; font-weight: 400;
  color: var(--bruin); min-width: 38px;
}
.sidebar-vandaag-tekst { font-size: 12px; font-weight: 700; color: var(--bruin); }
.sidebar-vandaag-leeg {
  font-family: 'Lora', serif; font-style: italic;
  font-size: 12px; color: rgba(58,40,0,0.45);
}

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.tab-content { display: none; height: 100%; overflow-y: auto; }
.tab-content.active { display: block; }

.section {
  padding: 32px 36px 40px;
  max-width: 900px;
}

.section-title {
  font-family: 'Lora', serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--donker);
  margin-bottom: 8px;
}

.sub-label {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  margin-top: 28px;
  padding-left: 2px;
}
.sub-label:first-child { margin-top: 0; }
.section-divider { border: none; border-top: 1.5px dashed var(--goud-rand); margin: 32px 0 0; }
.loading-msg {
  text-align: center; color: var(--muted);
  font-family: 'Lora', serif; font-style: italic; padding: 48px 0;
  font-size: 16px;
}

/* ── PERSON CARDS ── */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.person-card {
  background: var(--wit);
  border-radius: var(--radius);
  border: 1.5px solid var(--goud-rand);
  padding: 24px 16px 18px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.person-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(255,188,31,0.2);
}
.person-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: var(--wit);
}
.person-name {
  font-size: 17px; font-weight: 700;
  color: var(--donker); margin-bottom: 6px;
}
.person-desc {
  font-size: 13px; color: #7a6840;
  line-height: 1.5; font-family: 'Lora', serif; font-style: italic;
}
.person-tap-hint {
  font-size: 11px; color: #c4a060; margin-top: 10px;
}

/* ── SIBLINGS ── */
.siblings-grid { display: flex; flex-direction: column; gap: 12px; }
.pair-row {
  display: flex; align-items: stretch;
  background: var(--wit);
  border-radius: var(--radius);
  border: 1.5px solid var(--goud-rand);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.pair-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,188,31,0.15);
}
.pair-row.deceased { opacity: 0.55; background: #fafaf8; border-color: #e0d8cc; }
.pair-person { flex: 1; padding: 16px 12px; text-align: center; }
.pair-heart { display: flex; align-items: center; padding: 0 8px; color: var(--goud); font-size: 16px; }
.pair-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--wit);
}
.pair-name { font-size: 14px; font-weight: 700; color: var(--donker); }
.pair-name.muted { color: #999; }
.pair-desc { font-size: 12px; color: #7a6840; font-family: 'Lora', serif; font-style: italic; margin-top: 4px; }

/* ── PERSOONSPAGINA ── */
.person-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.person-page-inner {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 20px 36px;
  background: none; border: none;
  font-size: 15px; font-weight: 700; color: var(--goud);
  font-family: 'Nunito', sans-serif; cursor: pointer;
  flex-shrink: 0;
}
.person-hero {
  background: linear-gradient(170deg, #ffe599 0%, #ffbc1f 100%);
  padding: 32px 36px 40px;
  display: flex; align-items: center; gap: 28px;
}
.person-big-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; font-weight: 700; color: var(--wit);
  border: 4px solid rgba(255,255,255,0.5);
  flex-shrink: 0; overflow: hidden;
}
.person-hero-text {}
.person-big-name {
  font-family: 'Lora', serif; font-size: 36px; font-weight: 400; color: var(--bruin);
}
.person-big-sub {
  font-family: 'Lora', serif; font-style: italic;
  font-size: 16px; color: rgba(58,40,0,0.6); margin-top: 6px;
}
.person-body { padding: 32px 36px; flex: 1; max-width: 800px; }
.person-desc-block {
  font-family: 'Lora', serif; font-size: 17px; color: var(--donker);
  line-height: 1.75; margin-bottom: 28px;
}
.person-herinnering-label {
  font-size: 11px; font-weight: 700; color: var(--goud);
  text-transform: uppercase; letter-spacing: 0.9px; margin-bottom: 14px;
}
.person-herinnering-card {
  background: var(--wit); border-radius: var(--radius-sm); border: 1.5px solid var(--goud-rand);
  padding: 16px 20px; margin-bottom: 12px;
  font-family: 'Lora', serif; font-size: 15px;
  color: var(--donker); line-height: 1.65;
}

/* ── AGENDA ── */
.agenda-lijst { display: flex; flex-direction: column; gap: 12px; }
.agenda-card {
  background: var(--wit); border-radius: var(--radius-sm); border: 1.5px solid var(--goud-rand);
  padding: 16px 20px; display: flex; align-items: flex-start; gap: 18px;
}
.agenda-card.vandaag-card { border-color: var(--goud); background: #fffbee; }
.agenda-datum-blok {
  text-align: center; min-width: 52px;
  background: var(--goud-licht); border-radius: 10px; padding: 8px 10px;
}
.agenda-dag-num { font-size: 26px; font-weight: 700; color: var(--goud); line-height: 1; font-family: 'Lora', serif; }
.agenda-maand { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.agenda-info { flex: 1; }
.agenda-titel { font-size: 16px; font-weight: 700; color: var(--donker); }
.agenda-tijd-van { font-size: 13px; color: var(--muted); margin-top: 5px; font-style: italic; }
.agenda-leeg {
  font-family: 'Lora', serif; font-style: italic;
  font-size: 16px; color: var(--muted); text-align: center; padding: 32px 0;
}

/* ── DAGBOEK ── */
.dagboek-lijst { display: flex; flex-direction: column; gap: 16px; }
.dagboek-card {
  background: var(--wit); border-radius: var(--radius); border: 1.5px solid var(--goud-rand);
  padding: 22px 24px; border-left: 4px solid var(--goud);
}
.dagboek-datum { font-size: 11px; font-weight: 700; color: var(--goud); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.dagboek-titel { font-family: 'Lora', serif; font-size: 20px; font-weight: 400; color: var(--donker); margin-bottom: 10px; }
.dagboek-tekst { font-family: 'Lora', serif; font-size: 15px; color: #5a4830; line-height: 1.75; }
.dagboek-van { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ── MEMORY ── */
.memory-stream { display: flex; flex-direction: column; gap: 16px; }
.memory-card {
  background: var(--wit); border-radius: var(--radius); border: 1.5px solid var(--goud-rand);
  padding: 20px 24px; animation: fadeIn 0.3s ease;
}
.memory-card.highlight { background: #fffbee; border-color: var(--goud); }
@keyframes fadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.memory-label { font-size: 11px; color: var(--goud); font-weight: 700; text-transform: uppercase; letter-spacing: 0.9px; margin-bottom: 10px; }
.memory-text { font-size: 16px; color: var(--donker); line-height: 1.7; font-family: 'Lora', serif; }
.memory-from { font-size: 13px; color: var(--muted); margin-top: 12px; }
.memory-date { font-size: 12px; color: #c0aa80; margin-top: 4px; }

/* ── BUTTONS ── */
.add-btn {
  display: block; width: 100%;
  margin: 20px 0 0; padding: 16px;
  background: var(--goud); color: var(--bruin); border: none;
  border-radius: var(--radius-sm); font-size: 16px;
  font-family: 'Nunito', sans-serif; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.add-btn:hover { background: #e8a500; }

/* ── MODAL ── */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(45,36,22,0.5); z-index: 100;
  align-items: center; justify-content: center;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--bg); border-radius: 24px;
  padding: 36px 32px; width: 90%; max-width: 480px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.2);
  max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-family: 'Lora', serif; font-size: 24px; font-weight: 400; color: var(--donker); margin-bottom: 20px; }
.modal input, .modal textarea, .modal select {
  width: 100%; border: 1.5px solid var(--goud-rand); border-radius: 12px;
  padding: 12px 16px; font-size: 15px; font-family: 'Nunito', sans-serif;
  background: var(--wit); color: var(--donker); margin-bottom: 14px; resize: none; outline: none;
}
.modal input:focus, .modal textarea:focus, .modal select:focus { border-color: var(--goud); }
.modal-btns { display: flex; gap: 12px; margin-top: 6px; }
.btn-cancel {
  flex: 1; padding: 13px; border: 1.5px solid var(--goud-rand); background: var(--wit);
  border-radius: 12px; font-size: 15px; font-family: 'Nunito', sans-serif;
  color: #7a6840; cursor: pointer;
}
.btn-send {
  flex: 2; padding: 13px; border: none; background: var(--goud);
  border-radius: 12px; font-size: 15px; font-family: 'Nunito', sans-serif;
  color: var(--bruin); font-weight: 700; cursor: pointer;
}
.btn-send:hover { background: #e8a500; }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

.empty-friends {
  background: var(--wit); border-radius: var(--radius); border: 1.5px dashed var(--goud-rand);
  padding: 48px 24px; text-align: center; color: var(--muted);
  font-family: 'Lora', serif; font-style: italic; font-size: 16px;
}

/* ── TABLET PORTRAIT fallback ── */
@media (max-width: 768px) {
  html, body { overflow: auto; }
  .view { height: auto; overflow: visible; }
  .app-layout { flex-direction: column; height: auto; }
  .sidebar {
    width: 100%;
    padding-bottom: 0;
  }
  .sidebar-clock { padding-bottom: 16px; }
  .sidebar-nav { display: none; }
  .tabs-mobile {
    display: flex !important;
    overflow-x: auto; background: #fff7d6;
    border-bottom: 2px solid var(--goud-rand);
    padding: 0 12px; scrollbar-width: none;
  }
  .tabs-mobile::-webkit-scrollbar { display: none; }
  .tab-mobile {
    padding: 12px 14px; font-size: 13px; font-weight: 700;
    color: #a07800; cursor: pointer;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    white-space: nowrap; background: none;
    border-top: none; border-left: none; border-right: none;
    font-family: 'Nunito', sans-serif;
    transition: color 0.15s, border-color 0.15s;
  }
  .tab-mobile.active { color: var(--bruin); border-bottom-color: var(--goud); }
  .main-content { overflow: visible; }
  .tab-content { height: auto; overflow: visible; }
  .section { padding: 20px 16px 32px; }
  .person-hero { flex-direction: column; text-align: center; padding: 24px 20px 28px; }
  .person-body { padding: 20px 16px; }
  .person-big-name { font-size: 28px; }
}

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

/* ── STELLEN ── */
.stellen-grid { display: flex; flex-direction: column; gap: 14px; }

.stel-row {
  display: flex; align-items: stretch;
  background: var(--wit);
  border-radius: var(--radius);
  border: 1.5px solid var(--goud-rand);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.stel-person {
  flex: 1; padding: 20px 16px; text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.stel-person:hover { background: #fffbf0; }

.stel-hart {
  display: flex; align-items: center; justify-content: center;
  padding: 0 12px; color: var(--goud); font-size: 20px;
  flex-shrink: 0;
}

.stel-naam {
  font-size: 17px; font-weight: 700;
  color: var(--donker); margin-bottom: 6px;
}
.stel-desc {
  font-size: 13px; color: #7a6840;
  line-height: 1.5; font-family: 'Lora', serif; font-style: italic;
}

/* ── NAVIGATIE VERBETERINGEN ── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  color: rgba(58,40,0,0.6);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Nunito', sans-serif;
  -webkit-tap-highlight-color: rgba(255,255,255,0.3);
}
.nav-item:active { transform: scale(0.97); }
.nav-item:hover { background: rgba(255,255,255,0.35); color: var(--bruin); }
.nav-item.active {
  background: rgba(255,255,255,0.6);
  color: var(--bruin);
  box-shadow: 0 2px 12px rgba(58,40,0,0.08);
}
.nav-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-label { flex: 1; }

/* ── THUIS KNOP ── */
.sidebar-home-btn-wrap {
  padding: 12px 16px 24px;
  flex-shrink: 0;
}
.sidebar-home-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 14px 18px;
  background: rgba(255,255,255,0.55);
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  color: var(--bruin); cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: background 0.15s, transform 0.1s;
}
.sidebar-home-btn:hover { background: rgba(255,255,255,0.75); }
.sidebar-home-btn:active { transform: scale(0.97); }

/* ── PERSON CARDS GROTER ── */
.person-card {
  background: var(--wit);
  border-radius: var(--radius);
  border: 1.5px solid var(--goud-rand);
  padding: 28px 16px 22px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.person-card::after {
  content: 'Tik om meer te zien';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--goud);
  color: var(--bruin);
  font-size: 11px; font-weight: 700;
  padding: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  letter-spacing: 0.3px;
}
.person-card:hover::after { opacity: 1; }
.person-card:active { transform: scale(0.97); box-shadow: 0 4px 20px rgba(255,188,31,0.25); }

.person-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: var(--wit);
  border: 3px solid var(--goud-rand);
}
.person-name {
  font-size: 18px; font-weight: 700;
  color: var(--donker); margin-bottom: 6px;
}
.person-desc {
  font-size: 13px; color: #7a6840;
  line-height: 1.5; font-family: 'Lora', serif; font-style: italic;
}
.person-tap-hint { display: none; }

/* ── TERUGKNOP PERSOONSPAGINA ── */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 16px 24px;
  padding: 12px 22px;
  background: var(--goud);
  border: none;
  border-radius: 50px;
  font-size: 15px; font-weight: 700; color: var(--bruin);
  font-family: 'Nunito', sans-serif; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 12px rgba(255,188,31,0.3);
}
.back-btn:hover { background: #e8a500; }
.back-btn:active { transform: scale(0.97); }

/* ── TAP FEEDBACK ── */
.stel-person:active,
.person-card:active,
.nav-item:active,
.add-btn:active {
  opacity: 0.85;
}
