/* =====================================================
   EcoWare KVS — Design System v2
   ===================================================== */

:root {
  --ew-navy:        #1d3557;
  --ew-navy-light:  #2d4f7c;
  --ew-blue:        #457b9d;
  --ew-green:       #1a7a4a;
  --ew-orange:      #ea580c;
  --ew-red:         #e63946;
  --ew-bg:          #f0f2f5;
  --ew-surface:     #ffffff;
  --ew-border:      #dde3ec;
  --ew-text:        #1e293b;
  --ew-muted:       #64748b;
  --ew-shadow-xs:   0 1px 3px rgba(29,53,87,.06);
  --ew-shadow-sm:   0 2px 8px rgba(29,53,87,.08);
  --ew-shadow:      0 4px 16px rgba(29,53,87,.10);
  --ew-shadow-lg:   0 12px 40px rgba(29,53,87,.16);
  --ew-radius-sm:   8px;
  --ew-radius:      12px;
  --ew-radius-lg:   16px;
  --ew-radius-pill: 9999px;
  --ew-t:           0.18s ease;
}

/* =====================================================
   GLOBAL OVERRIDES
   ===================================================== */

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--ew-bg);
  color: var(--ew-text);
  -webkit-font-smoothing: antialiased;
}

.card {
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius-lg) !important;
  box-shadow: var(--ew-shadow-sm);
  transition: box-shadow var(--ew-t);
}

.card-header {
  border-bottom: 1px solid rgba(0,0,0,.07);
  padding: 14px 20px;
  font-weight: 600;
  font-size: .95rem;
}

.card-body { padding: 20px; }

.btn {
  font-weight: 500;
  font-size: .875rem;
  border-radius: var(--ew-radius-sm);
  transition: all var(--ew-t);
}

.btn-sm { font-size: .8rem; padding: 5px 12px; }

.form-control, .form-select {
  border-radius: var(--ew-radius-sm);
  border-color: #cbd5e1;
  font-size: .9rem;
  transition: border-color var(--ew-t), box-shadow var(--ew-t);
}

.form-control:focus, .form-select:focus {
  border-color: var(--ew-blue);
  box-shadow: 0 0 0 3px rgba(69,123,157,.15);
}

.table { font-size: .9rem; }
.table thead th {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ew-muted);
  border-bottom-width: 2px;
  border-color: var(--ew-border);
  padding: 12px 16px;
  background: #f8fafd;
}

.table tbody td { padding: 12px 16px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f0f6ff !important; cursor: pointer; }

.badge { font-weight: 500; font-size: .75rem; }

.modal-content { border-radius: var(--ew-radius-lg); border: none; box-shadow: var(--ew-shadow-lg); }
.modal-header { border-radius: var(--ew-radius-lg) var(--ew-radius-lg) 0 0; border-bottom: 1px solid var(--ew-border); padding: 18px 24px; }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--ew-border); padding: 16px 24px; }

/* =====================================================
   CALENDAR — Grid View (Dashboard)
   ===================================================== */

#calendar-wrapper {
  border-radius: var(--ew-radius-lg);
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  overflow: visible;
  padding: 0;
}

#calendar {
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, sans-serif;
}

.calendar-header,
.candidate-row {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.candidate-label {
  width: 220px;
  min-width: 140px;
  border-right: 1px solid rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
  color: #fff;
  border-bottom: 1px solid rgba(0,0,0,.06);
  flex-shrink: 0;
  padding: 8px 10px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
  letter-spacing: .01em;
  line-height: 1.3;
}

.calendar-header {
  height: 56px;
  background: #f8fafd;
  border-bottom: 2px solid var(--ew-border);
  border-radius: var(--ew-radius-lg) var(--ew-radius-lg) 0 0;
  font-size: .9rem;
  font-weight: 600;
}

.calendar-header .candidate-label {
  background: #f8fafd;
  color: var(--ew-muted);
  text-shadow: none;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.day-header {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8px 6px;
  border-right: 1px solid var(--ew-border);
  font-size: .875rem;
  font-weight: 700;
  color: var(--ew-navy);
}

.day-header small { color: var(--ew-muted); font-weight: 400; font-size: .78rem; }

.day-header.is-today { background: #eff6ff; }
.day-header.is-today .fw-semibold { color: #2563eb; }

.day-cell {
  position: relative;
  flex: 1 1 0;
  min-height: 58px;
  border-right: 1px solid #f0f3f8;
  border-bottom: 1px solid var(--ew-border);
  background: var(--ew-surface);
  min-width: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 3px 4px;
  gap: 3px;
  transition: background var(--ew-t);
}

.day-cell:hover { background: #f8faff; }
.day-cell.is-today { background: #f5f8ff; }

/* Event block */
.event-block {
  position: relative;
  font-size: .78rem;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
  width: 94%;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.14);
  font-weight: 500;
  letter-spacing: .01em;
}

.event-block:hover {
  transform: translateY(-2px) scale(1.025);
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
}

.availability         { background: linear-gradient(145deg, #2563eb, #3b82f6); }
.availability-attended { background: linear-gradient(145deg, #16a34a, #22c55e); }
.availability-absent  { background: linear-gradient(145deg, #ea580c, #f97316); }

/* Hover card */
.hover-card {
  position: absolute;
  background: var(--ew-surface);
  color: var(--ew-text);
  font-size: .84rem;
  padding: 14px 16px;
  border-radius: var(--ew-radius);
  box-shadow: var(--ew-shadow-lg);
  border: 1px solid var(--ew-border);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity .18s ease, transform .18s ease;
  min-width: 210px;
  white-space: nowrap;
  transform: translate(-50%, 12px);
}

.hover-card.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.hover-card::before {
  content: "";
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent var(--ew-border) transparent;
}

.hover-card::after {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  border-width: 0 7px 7px;
  border-style: solid;
  border-color: transparent transparent #fff transparent;
  z-index: 10000;
}

.time-label {
  font-size: .76rem;
  font-weight: 500;
  color: rgba(255,255,255,.92);
}

.afspraken-list { margin-top: 8px; }

.afspraak-item {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 4px;
  font-size: .76rem;
  color: #1d4ed8;
}

.hover-card .btn {
  font-size: .74rem;
  padding: 4px 10px;
  border-radius: var(--ew-radius-pill);
  font-weight: 500;
}

.hover-card .btn + .btn { margin-left: 4px; }

/* Candidate column department colors */
.candidate-label.afdeling-it      { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.candidate-label.afdeling-fietsen { background: linear-gradient(135deg, #b45309, #f59e0b); }
.candidate-label.afdeling-default { background: linear-gradient(135deg, #475569, #94a3b8); }

/* =====================================================
   LEGEND
   ===================================================== */

.legend-box-wrapper {
  background: rgba(255,255,255,.15);
  padding: 5px 14px;
  border-radius: var(--ew-radius-pill);
  display: flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.22);
}

.legend-box-wrapper span { color: #fff; font-size: .82rem; }

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
}

.afdeling-it      { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.afdeling-fietsen { background: linear-gradient(135deg, #b45309, #f59e0b); }

/* =====================================================
   CHOICES.JS OVERRIDES (in green/blue header)
   ===================================================== */

.card-header .choices__inner {
  background: rgba(255,255,255,.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--ew-radius-sm);
  min-height: 36px;
  padding: 4px 8px;
}

.card-header .choices__placeholder,
.card-header .choices__input { color: rgba(255,255,255,.8); background: transparent; }
.card-header .choices__list--dropdown { background: #fff; color: var(--ew-text); border-radius: var(--ew-radius-sm); box-shadow: var(--ew-shadow); }
.card-header .choices__list--dropdown .choices__item--selectable.is-highlighted { background: #eff6ff; color: #1d4ed8; }
.card-header .choices__item--selectable { background: rgba(255,255,255,.22); color: #fff; border-radius: 5px; }
.card-header .choices__button { border-left-color: rgba(255,255,255,.3); filter: invert(1); }

/* =====================================================
   CANDIDATE LIST — Avatars
   ===================================================== */

.candidate-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  flex-shrink: 0;
}

/* Department badges */
.badge-afdeling-it      { background: #dbeafe; color: #1d4ed8; }
.badge-afdeling-fietsen { background: #fef3c7; color: #92400e; }
.badge-afdeling-nvt     { background: #f1f5f9; color: #475569; }

/* =====================================================
   FORM SECTIONS
   ===================================================== */

.form-section {
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.form-section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ew-navy);
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--ew-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title .section-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.form-label {
  font-size: .84rem;
  font-weight: 600;
  color: var(--ew-text);
  margin-bottom: 6px;
}

/* =====================================================
   DETAIL PAGE — Info Sections
   ===================================================== */

.info-section {
  background: var(--ew-surface);
  border: 1px solid var(--ew-border);
  border-radius: var(--ew-radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow var(--ew-t);
}

.info-section:hover { box-shadow: var(--ew-shadow-sm); }

.info-section-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--ew-border);
}

.info-section-header .section-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}

.info-section-header h6 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 0;
}

.info-section-body { padding: 14px 16px; }

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: .875rem;
}

.info-row + .info-row { border-top: 1px solid #f1f5f9; }

.info-label {
  font-weight: 600;
  color: var(--ew-muted);
  min-width: 120px;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
  padding-top: 1px;
}

.info-value { color: var(--ew-text); }

/* =====================================================
   PROGRESS REPORT — Rating Buttons
   ===================================================== */

.rating-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
}

.rating-row:last-child { border-bottom: none; }

.rating-label {
  font-weight: 600;
  font-size: .875rem;
  color: var(--ew-text);
  flex: 0 0 220px;
  min-width: 0;
}

.rating-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-check + .rating-btn {
  min-width: 52px;
  padding: 5px 4px;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  background: #f8fafd;
  color: var(--ew-muted);
  cursor: pointer;
  transition: all .14s ease;
  text-align: center;
}

.btn-check:checked + .rating-btn { border-color: transparent; color: #fff; }
.btn-check:checked + .rating-btn-1 { background: #ef4444; }
.btn-check:checked + .rating-btn-2 { background: #f97316; }
.btn-check:checked + .rating-btn-3 { background: #eab308; }
.btn-check:checked + .rating-btn-4 { background: #22c55e; }
.btn-check:checked + .rating-btn-5 { background: #3b82f6; }

/* =====================================================
   TODO SECTION
   ===================================================== */

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .875rem;
  gap: 12px;
}

.todo-item:last-child { border-bottom: none; }

/* =====================================================
   FOOTER
   ===================================================== */

.ecoware-footer {
  background: var(--ew-surface);
  border-top: 1px solid var(--ew-border);
  color: var(--ew-muted);
  margin-top: 3rem;
}

.ecoware-footer small { font-size: .8rem; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
  .candidate-label { min-width: 110px; font-size: .78rem; }
  .day-cell { min-width: 44px; min-height: 52px; }
  .event-block { font-size: .7rem; padding: 3px 4px; }
  .time-label { font-size: .65rem; }
  .rating-label { flex: 0 0 140px; font-size: .8rem; }
  .info-label { min-width: 90px; }
}

/* Calendar skeleton loader */
.calendar-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--ew-muted);
  font-size: .9rem;
  gap: 10px;
}

.spinner-border-sm { width: 18px; height: 18px; }

/* Fix: tekstkleur in Choices.js filter/select */
.choices__inner {
  background-color: #ffffff !important;
  color: #1e293b !important; /* donker grijs voor leesbaarheid */
  border: 1px solid #e5e7eb;
}

.choices__input {
  color: #1e293b !important;
}

.choices__item {
  color: #1e293b !important;
}

/* dropdown items */
.choices__list--dropdown .choices__item {
  color: #1e293b !important;
}

/* geselecteerde items (tags) */
.choices__list--multiple .choices__item {
  color: #1e293b !important;
  background-color: #f1f5f9;
}
