:root {
  --bg: #f3efe6;
  --surface: #fcfaf5;
  --ink: #19202d;
  --muted: #5b6378;
  --line: #d8cfbc;
  --shadow: 0 12px 32px rgba(19, 24, 39, 0.1);

  --vt: #0a67d8;
  --vt-soft: #e6f0ff;
  --cta: #eb5e28;
  --cta-soft: #ffe9df;

  --beeld: #0353a4;
  --oordeel: #8a3ffc;
  --besluit: #1b7f5a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(950px 560px at -6% 4%, #fff8d5 0%, rgba(255, 248, 213, 0) 65%),
    radial-gradient(900px 560px at 103% 8%, #dce9ff 0%, rgba(220, 233, 255, 0) 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0;
}

.ambient {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
}

.ambient-a {
  background: #ff8c66;
  right: -80px;
  top: 20%;
}

.ambient-b {
  background: #6599ff;
  left: -120px;
  bottom: 6%;
}

.app-header,
.layout,
.app-footer {
  width: min(1300px, calc(100% - 2rem));
  margin-inline: auto;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  align-items: flex-end;
  padding: 1.2rem 0 0.8rem;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
}

.app-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
}

.subtitle {
  color: var(--muted);
  margin-top: 0.35rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.user-chip {
  font-size: 0.82rem;
  color: #27477a;
  background: #eaf2ff;
  border: 1px solid #b8cbed;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.save-status {
  font-size: 0.85rem;
  color: #2b7658;
  background: #e8fbf3;
  border: 1px solid #b6e7d2;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1rem;
  margin-top: 0.8rem;
  padding-bottom: 2rem;
}

.manage-layout {
  grid-template-columns: 1fr;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.dashboard {
  padding: 1rem;
  display: grid;
  gap: 1rem;
  align-content: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard section {
  display: grid;
  gap: 0.55rem;
}

.dashboard h3 {
  font-size: 0.98rem;
}

.stack {
  display: grid;
  gap: 0.6rem;
}

.meeting-card {
  border: 1px solid var(--line);
  border-left: 6px solid var(--vt);
  border-radius: 14px;
  padding: 0.75rem;
  background: #fffefb;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.meeting-card-wrap {
  display: grid;
  gap: 0.45rem;
}

.meeting-card-wrap .meeting-card {
  width: 100%;
  text-align: left;
}

.meeting-delete-btn {
  justify-self: end;
}

.meeting-card[data-type="CTA"] {
  border-left-color: var(--cta);
}

.meeting-card.active {
  outline: 2px solid #1f4f94;
}

.meeting-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-weight: 700;
  font-size: 0.78rem;
}

.badge-vt {
  background: var(--vt-soft);
  color: var(--vt);
}

.badge-cta {
  background: var(--cta-soft);
  color: var(--cta);
}

.tiny {
  font-size: 0.84rem;
  color: var(--muted);
}

.workspace {
  padding: 1rem;
}

.empty-block {
  border: 1px dashed #bbb097;
  border-radius: 12px;
  padding: 1rem;
  color: var(--muted);
  background: #fffcf4;
}

.meeting-shell {
  display: grid;
  gap: 1rem;
}

.workspace-tab-bar {
  padding: 0.6rem;
}

.workspace-tabs {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.workspace-tab-btn {
  border: 1px solid #d3c9b6;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  background: #f7f3ea;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.workspace-tab-btn.active {
  background: #e4edff;
  border-color: #9eb8ea;
  color: #184185;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #1a56cf 0%, #0b76ff 100%);
}

.btn-secondary {
  color: #132;
  background: #dbeafc;
}

.btn-ghost {
  color: var(--ink);
  background: #ece6d9;
}

.btn-danger {
  color: #fff;
  background: #bb3f36;
}

.section-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: #fffefb;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c8bda6;
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  font: inherit;
  background: #fff;
}

input[type="checkbox"] {
  width: auto;
}

textarea {
  resize: none;
  overflow: hidden;
}

.participants-table {
  width: 100%;
  border-collapse: collapse;
}

.participants-table th,
.participants-table td {
  border-bottom: 1px solid #e0d7c5;
  padding: 0.4rem;
  text-align: left;
}

.participants-template-wrap {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px dashed #d8cfbc;
  display: grid;
  gap: 0.6rem;
}

.participants-template-table th:nth-child(4),
.participants-template-table th:nth-child(5),
.participants-template-table td:nth-child(4),
.participants-template-table td:nth-child(5),
.participants-template-table td:last-child {
  text-align: center;
}

.library-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem;
}

.library-card-item {
  border: 1px solid #d8cfbc;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: grid;
}

.library-card-item.active {
  outline: 2px solid #245fb5;
}

.library-card-meta {
  padding: 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.topic-list {
  display: grid;
  gap: 0.4rem;
}

.topic-item {
  border: 1px solid #d4cab6;
  border-radius: 12px;
  padding: 0.65rem;
  background: #fff;
  display: grid;
  gap: 0.35rem;
}

.topic-item.selected {
  outline: 2px solid #245fb5;
}

.topic-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid #c6d5f3;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.78rem;
}

.p1 { background: #ffd8d2; border-color: #f2a89f; }
.p2 { background: #ffeec8; border-color: #e8c88a; }
.p3 { background: #e8f7de; border-color: #add498; }

.phase-tabs {
  display: flex;
  gap: 0.55rem;
  flex-wrap: nowrap;
  width: 100%;
}

.phase-btn {
  flex: 1;
  border: 1px solid #d3c9b6;
  border-radius: 12px;
  padding: 0.8rem 0.7rem;
  background: #f7f3ea;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.phase-btn.active[data-phase="BEELD"] { background: #dcecff; border-color: #9ec2f5; color: var(--beeld); }
.phase-btn.active[data-phase="OORDEEL"] { background: #efe3ff; border-color: #caa9ff; color: var(--oordeel); }
.phase-btn.active[data-phase="BESLUIT"] { background: #dff7ec; border-color: #9fddbf; color: var(--besluit); }

.auto-grow {
  min-height: 3.2rem;
}

.priority-wrap {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 0.8rem;
}

.phase-topic-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.phase-topic-card {
  background: #fffdfa;
}

.phase-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.phase-main.whiteboard-mode {
  grid-template-columns: 1fr;
}

.phase-main-left,
.phase-main-right {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.phase-main-text {
  min-height: 540px;
  font-size: 1rem;
  line-height: 1.5;
}

.priority-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.priority-item {
  border: 1px solid #d5cab6;
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem;
  display: grid;
  gap: 0.4rem;
}

.priority-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.55rem;
}

.priority-table th,
.priority-table td {
  border: 1px solid #ddd1bc;
  padding: 0.5rem;
  text-align: left;
  vertical-align: middle;
}

.priority-table th {
  background: #f4ecdd;
  font-size: 0.84rem;
}

.priority-table td:first-child {
  width: 28px;
  text-align: center;
}

.priority-table td:nth-child(2) {
  width: 26px;
  text-align: center;
}

.priority-table td:last-child {
  width: 64px;
  text-align: center;
}

.priority-table td:nth-child(3) {
  min-width: 220px;
}

.priority-table .keypoint-textarea {
  width: 100%;
  min-height: 3.2rem;
  font-size: 1rem;
  line-height: 1.35;
  padding: 0.55rem 0.7rem;
}

.drag-handle {
  color: #867b66;
  font-weight: 700;
  cursor: move;
  user-select: none;
}

.priority-table tr.dragging {
  opacity: 0.55;
}

.matrix {
  border: 1px solid #cabda5;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 58px);
  position: relative;
  background: #fff;
}

.matrix-cell {
  border-right: 1px solid #e2d8c5;
  border-bottom: 1px solid #e2d8c5;
}

.matrix-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #121b2e;
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.whiteboard-wrap {
  border: 1px solid #cabda5;
  border-radius: 12px;
  overflow: hidden;
}

.whiteboard-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem;
  background: #f7f3ea;
  border-bottom: 1px solid #ddd2bd;
}

.wb-view-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.25rem;
}

.wb-zoom-label {
  min-width: 3rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #273248;
}

.tool-btn,
.color-btn {
  border: 1px solid #c6baa2;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  padding: 0.28rem 0.45rem;
  cursor: pointer;
}

.tool-btn.active {
  background: #dde8ff;
  border-color: #86aaf1;
}

.color-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.color-btn {
  width: 24px;
  height: 24px;
  padding: 0;
}

.color-btn.active {
  outline: 2px solid #0e2037;
}

.whiteboard-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 560;
  display: block;
  background: #fff;
}

.history-list {
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding-left: 1rem;
}

.history-list li {
  margin: 0.2rem 0;
}

.dialog {
  border: 0;
  border-radius: 18px;
  width: min(700px, calc(100% - 1rem));
  padding: 0;
}

.dialog::backdrop {
  background: rgba(12, 19, 31, 0.45);
}

.dialog-card {
  margin: 0;
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.type-card {
  border: 1px solid #cabea8;
  border-radius: 12px;
  padding: 0.7rem;
  display: grid;
  gap: 0.2rem;
  cursor: pointer;
}

.type-card input {
  width: auto;
}

.type-title {
  font-weight: 800;
  font-size: 1.06rem;
}

.type-vt {
  background: linear-gradient(150deg, #f5faff 0%, #f0f4fb 100%);
}

.type-cta {
  background: linear-gradient(150deg, #fff8f2 0%, #fff0e7 100%);
}

.muted {
  color: var(--muted);
}

.live-banner {
  background: #101d34;
  color: #ecf3ff;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  font-weight: 700;
}

.live-mode .layout {
  grid-template-columns: 1fr;
}

.live-mode .dashboard {
  display: none;
}

.live-mode .workspace {
  min-height: calc(100vh - 120px);
}

.live-mode .meeting-shell {
  gap: 1.2rem;
}

.live-mode .phase-btn {
  font-size: 1.12rem;
  padding: 0.65rem 1rem;
}

.app-footer {
  color: var(--muted);
  padding: 0 0 1.2rem;
}

.countdown-widget {
  position: fixed;
  right: 1rem;
  top: 5.2rem;
  z-index: 40;
  width: 220px;
  border: 1px solid #cfc4af;
  background: rgba(255, 252, 245, 0.96);
  backdrop-filter: blur(4px);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(18, 28, 46, 0.18);
  padding: 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.countdown-head {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
}

.countdown-display {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  border: 1px solid #d9cdb6;
  border-radius: 10px;
  padding: 0.2rem 0.4rem;
  background: #fff;
}

.countdown-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.countdown-inputs label {
  font-size: 0.78rem;
  font-weight: 700;
}

.countdown-inputs input {
  margin-top: 0.2rem;
}

.countdown-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-wrap {
  width: min(460px, calc(100% - 1rem));
}

.login-card {
  padding: 1.1rem;
  display: grid;
  gap: 0.9rem;
}

.login-form {
  display: grid;
  gap: 0.8rem;
}

.login-error {
  background: #ffe7e4;
  border: 1px solid #f0aba2;
  color: #8a2f25;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .dashboard {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .app-header,
  .layout,
  .app-footer {
    width: min(1300px, calc(100% - 1rem));
  }

  .priority-wrap {
    grid-template-columns: 1fr;
  }

  .type-grid {
    grid-template-columns: 1fr;
  }

  .phase-main {
    grid-template-columns: 1fr;
  }

  .phase-tabs {
    flex-wrap: wrap;
  }

  .countdown-widget {
    right: 0.5rem;
    top: 4.8rem;
    width: 200px;
  }
}
