:root {
  color-scheme: dark;
  color: #f7f7f7;
  background: #0f1724;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(74, 144, 226, 0.16), transparent 35%),
    radial-gradient(circle at bottom, rgba(78, 205, 196, 0.08), transparent 28%),
    #0f1724;
}

.app-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem;
}

.topbar {
  padding: 1rem 0 1.5rem;
}

.brand h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.04em;
}

.brand p {
  margin: 0.35rem 0 0;
  color: #94a3b8;
}

main {
  display: grid;
  gap: 1rem;
}

.card {
  background: rgba(15, 23, 36, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.hidden {
  display: none;
}

h2 {
  margin-top: 0;
  color: #e2e8f0;
}

label {
  display: block;
  margin-bottom: 0.6rem;
  color: #cbd5e1;
  font-weight: 600;
}

input[type='email'] {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 36, 0.9);
  color: #f8fafc;
  font-size: 1rem;
}

button {
  margin-top: 1rem;
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  opacity: 0.96;
}

.home-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.muted-text {
  color: #94a3b8;
  margin: 0.45rem 0 0;
}

.grid-form {
  display: grid;
  gap: 1rem;
}

textarea,
input[type='text'],
input[type='datetime-local'],
input[type='email'] {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 36, 0.9);
  color: #f8fafc;
  font-size: 1rem;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.event-item {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 1rem;
  padding: 1rem;
}

.event-item strong {
  display: block;
  margin-bottom: 0.45rem;
  color: #eef2ff;
}

.event-item span {
  display: block;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.event-item p {
  margin: 0.85rem 0 0;
  color: #cbd5e1;
  line-height: 1.55;
}

.card h3,
.card h4 {
  margin-top: 0;
  color: #e2e8f0;
}

.status {
  margin-top: 1rem;
  min-height: 1.4rem;
  color: #a5b4fc;
}

.calendar-placeholder {
  min-height: 220px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 1.25rem;
  display: grid;
  place-items: center;
  color: #94a3b8;
  text-align: center;
  padding: 2rem;
}

.secondary {
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
}

.secondary.danger {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

/* Weekoverzicht */

.week-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.week-toolbar-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.week-toolbar-title h3 {
  margin: 0;
  font-size: 1rem;
  color: #e2e8f0;
}

.week-nav-btn {
  margin: 0;
  width: 2.5rem;
  padding: 0.5rem;
  flex-shrink: 0;
}

.week-today-btn {
  margin: 0;
  width: auto;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.week-view {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.week-grid {
  min-width: 640px;
}

.week-header-row {
  display: grid;
  grid-template-columns: 3.25rem repeat(7, 1fr);
  position: sticky;
  top: 0;
  background: #0f1724;
  z-index: 2;
}

.week-gutter-cell {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.week-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  border-left: 1px solid rgba(148, 163, 184, 0.08);
}

.week-day-header.is-today .week-day-num {
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  color: white;
}

.week-day-name {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #94a3b8;
}

.week-day-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.week-body {
  display: grid;
  grid-template-columns: 3.25rem repeat(7, 1fr);
  max-height: 60vh;
  overflow-y: auto;
}

.week-gutter {
  display: flex;
  flex-direction: column;
}

.week-hour-label {
  height: var(--hour-height);
  font-size: 0.7rem;
  color: #64748b;
  text-align: right;
  padding-right: 0.4rem;
  transform: translateY(-0.5em);
}

.week-day-column {
  position: relative;
  border-left: 1px solid rgba(148, 163, 184, 0.08);
  height: calc(var(--hour-height) * var(--hour-count));
}

.week-day-column.is-today {
  background: rgba(79, 70, 229, 0.06);
}

.week-hour-slot {
  height: var(--hour-height);
  border-bottom: 1px dashed rgba(148, 163, 184, 0.08);
  cursor: pointer;
}

.week-hour-slot:hover {
  background: rgba(148, 163, 184, 0.08);
}

.week-event-block {
  position: absolute;
  left: 2px;
  right: 2px;
  margin: 0;
  padding: 0.25rem 0.4rem;
  border: none;
  border-left: 3px solid #4f46e5;
  border-radius: 0.4rem;
  background: rgba(79, 70, 229, 0.28);
  color: #f8fafc;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
}

.week-event-block strong {
  display: block;
  font-size: 0.75rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-event-block span {
  display: block;
  font-size: 0.65rem;
  color: #cbd5e1;
}

/* Event-dialog */

dialog#event-dialog {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: #16202f;
  color: #f7f7f7;
  width: min(420px, 92vw);
}

dialog#event-dialog::backdrop {
  background: rgba(2, 6, 15, 0.6);
}

dialog#event-dialog h3 {
  margin-top: 0;
}

.dialog-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.dialog-actions button {
  margin-top: 0;
  flex: 1;
}

@media (min-width: 640px) {
  .app-shell {
    padding: 2rem;
  }
}
