/* =========================================================
   EXTENSIONS — styles voor de nieuwe modules
   (medicatie, activiteiten, kalender, notificaties, payments,
   video, assistent, quick-grid, welzijnsgrafiek).
   ========================================================= */

/* ===== Quick-grid (kortere weg tegels op home) ===== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.quick-tile {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--c-ink);
  min-height: var(--tap);
  transition: background .15s, transform .1s;
}
.quick-tile:hover { background: var(--c-surface-2); }
.quick-tile:active { transform: scale(.97); }
.quick-tile .qico { font-size: 26px; line-height: 1; }
@media (max-width: 360px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Medicatie ===== */
.med-day-list { display: flex; flex-direction: column; gap: 10px; }
.med-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--c-surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  transition: background .15s;
}
.med-row.taken { background: var(--c-primary-soft); border-color: var(--c-primary); }
.med-row.missed { background: var(--c-danger-soft); border-color: var(--c-danger); }
.med-time {
  font-weight: var(--fw-bold);
  font-size: var(--fs-h3);
  color: var(--c-ink);
  text-align: center;
}
.med-name { font-weight: var(--fw-semibold); font-size: var(--fs-body); }
.med-check {
  width: var(--tap);
  height: var(--tap);
  min-width: var(--tap);
  border-radius: 50%;
  border: 3px solid var(--c-line-2);
  background: var(--c-surface);
  font-size: 28px;
  color: var(--c-primary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .15s;
}
.med-check.on {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-ink-inv);
  box-shadow: var(--shadow-2);
}
.med-check:hover { transform: scale(1.05); }

/* Compliance bars */
.bar {
  width: 100%;
  height: 12px;
  background: var(--c-surface-3);
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill { height: 100%; transition: width .35s ease; }
.bar-fill.good { background: var(--c-primary); }
.bar-fill.mid  { background: var(--c-warn); }
.bar-fill.low  { background: var(--c-danger); }

.status-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: var(--fw-bold);
  color: var(--c-ink-inv);
}
.status-dot.on { background: var(--c-primary); }
.status-dot.late { background: var(--c-danger); }
.status-dot.pending { background: var(--c-line-2); }

/* ===== Activiteiten ===== */
.activity-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.activity-emoji {
  font-size: 40px;
  width: 60px;
  height: 60px;
  background: var(--c-accent-soft);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* ===== Kalender ===== */
.cal-nav { display: flex; gap: 6px; justify-content: space-between; margin-bottom: 14px; }
.cal-nav .btn { flex: 1; }
.cal-day {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.cal-day.today {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}
.cal-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.cal-day-head strong { font-size: var(--fs-h3); text-transform: capitalize; }
.cal-events { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cal-event {
  display: grid;
  grid-template-columns: 56px 24px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  background: var(--c-surface-2);
  font-size: var(--fs-small);
  text-align: left;
  font-family: inherit;
  color: var(--c-ink);
  cursor: pointer;
}
.cal-event:hover { background: var(--c-surface-3); }
.cal-event.medication { background: var(--c-accent-soft); border-color: var(--c-accent); cursor: default; }
.cal-event.activity { background: var(--c-info-soft); border-color: var(--c-info); }
.cal-event.request { background: var(--c-primary-soft); border-color: var(--c-primary); }
.cal-time { font-weight: var(--fw-bold); color: var(--c-ink-2); }
.cal-dot { font-size: 16px; }

/* ===== Notificaties ===== */
.notif-groups { display: flex; flex-direction: column; gap: 18px; }
.notif-day {
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--c-ink-3);
  margin: 0 0 8px;
  font-weight: var(--fw-semibold);
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  color: var(--c-ink);
}
.notif-item:hover { background: var(--c-surface-2); }
.notif-item.unread {
  border-left: 4px solid var(--c-primary);
  background: var(--c-primary-soft);
}
.notif-icon {
  font-size: 28px;
  width: 44px; height: 44px;
  background: var(--c-surface-2);
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.notif-item.unread .notif-icon { background: var(--c-surface); }

/* ===== Payments — kolommen chart ===== */
.chart-bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  height: 160px;
  align-items: end;
}
.bar-col {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  height: 100%; justify-content: flex-end;
}
.bar-val { font-size: 11px; color: var(--c-ink-3); }
.bar-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--c-surface-3);
  border-radius: 6px;
  overflow: hidden;
}
.bar-col .bar-fill { width: 100%; }
.bar-label { font-size: 11px; color: var(--c-ink-2); font-weight: var(--fw-semibold); text-transform: capitalize; }

/* ===== Welzijnstrend ===== */
.trend-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 16px;
}
.trend-graph {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 4px;
  height: 60px;
  align-items: end;
}
.trend-bar {
  background: var(--c-primary);
  border-radius: 3px;
  min-height: 4px;
  transition: height .25s;
}
.trend-bar.good { background: var(--c-primary); }
.trend-bar.mid { background: var(--c-warn); }
.trend-bar.low { background: var(--c-danger); }
.trend-bar.none { background: var(--c-surface-3); }
.trend-axis {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-small);
  color: var(--c-ink-3);
  margin-top: 8px;
}

/* ===== Video call ===== */
.video-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1a2733 0%, #0a1018 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.video-remote {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.video-remote .avatar {
  width: 160px; height: 160px;
  font-size: 70px;
  border: 6px solid rgba(255,255,255,.15);
  box-shadow: 0 0 0 12px rgba(255,255,255,.04);
}
.video-name {
  font-size: 24px;
  margin-top: 24px;
  font-weight: var(--fw-bold);
}
.video-status, .video-timer {
  margin-top: 8px;
  font-size: 16px;
  color: rgba(255,255,255,.7);
  font-variant-numeric: tabular-nums;
}
.video-anim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(95, 166, 124, .12), transparent 60%);
  animation: pulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}
.video-local {
  position: absolute;
  bottom: 130px; right: 16px;
  background: rgba(0,0,0,.5);
  border: 2px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(8px);
}
.video-local .avatar { width: 56px; height: 56px; font-size: 24px; }
.video-controls {
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(12px);
  padding: 16px 8px 24px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.vc-btn {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  border-radius: 16px;
  padding: 14px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  transition: background .15s, transform .1s;
}
.vc-btn:hover { background: rgba(255,255,255,.2); }
.vc-btn:active { transform: scale(.95); }
.vc-btn.off { background: rgba(255,255,255,.04); color: rgba(255,255,255,.55); }
.vc-btn.vc-end { background: var(--c-danger); }
.vc-btn.vc-end:hover { background: #d04a30; }
.vc-icon { font-size: 22px; }
.vc-label { font-weight: var(--fw-semibold); }

/* ===== Assistent ===== */
.ai-screen .chat-head {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: var(--c-ink-inv);
}
.ai-screen .chat-head .avatar { background: var(--c-ink-inv); color: var(--c-primary-dark); }
.ai-screen .chat-head h4, .ai-screen .chat-head .meta { color: var(--c-ink-inv); opacity: .92; }
.ai-msg {
  background: var(--c-primary-soft);
  border: 1px solid var(--c-line);
}
.ai-msg.me {
  background: var(--c-primary);
  color: var(--c-ink-inv);
  border-color: var(--c-primary-dark);
}
.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
}
.ai-action {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: var(--fs-small);
  cursor: pointer;
  font-family: inherit;
  color: var(--c-primary);
  font-weight: var(--fw-medium);
  transition: background .15s;
}
.ai-action:hover { background: var(--c-primary-soft); }

/* ===== Slider (beschikbaarheid) ===== */
.slider {
  width: 100%;
  margin-top: 12px;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--c-surface-3);
  border-radius: 4px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px; height: 28px;
  background: var(--c-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-1);
}
.slider::-moz-range-thumb {
  width: 28px; height: 28px;
  background: var(--c-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* ===== Skeleton loading ===== */
.skeleton {
  background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-surface-3) 50%, var(--c-surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Forgot password ===== */
.code-input {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.code-input input {
  width: 48px; height: 64px;
  text-align: center;
  font-size: 28px;
  font-weight: var(--fw-bold);
  border: 2px solid var(--c-line);
  border-radius: 12px;
  background: var(--c-surface);
  color: var(--c-ink);
}
.code-input input:focus {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

/* ===== Chat — afspraak-bevestigen kaart inline ===== */
.appointment-confirm {
  background: var(--c-info-soft);
  border: 1px solid var(--c-info);
  border-radius: 14px;
  padding: 12px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.appointment-confirm strong { color: var(--c-info); }
.appointment-confirm .row { gap: 8px; }
.appointment-confirm .meta { color: var(--c-ink-2); }

/* ===== Voor mobile: nav balk spacing ===== */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .cat-grid { gap: 10px; }
}

/* ===== Focus styles ===== */
button:focus-visible, .pick:focus-visible, .item:focus-visible,
.quick-tile:focus-visible, .cat-tile:focus-visible, .ai-action:focus-visible,
.med-check:focus-visible, .input:focus-visible, .textarea:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

/* ===== Better link style ===== */
.link {
  background: none;
  border: none;
  color: var(--c-primary);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 0;
  font-size: inherit;
}
.link:hover { color: var(--c-primary-dark); }
