.absences {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-top: 8px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 0 0 8px 18px;
}

.page-header h1 {
  margin: 0;
  color: #07132c;
  font-size: clamp(25px, 2.1vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.page-header p {
  margin: 8px 0 0;
  color: #344054;
  font-size: 15px;
  font-weight: 520;
}

.profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 244px;
  margin-right: 18px;
  color: #111827;
}

.profile-button {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(16, 24, 40, 0.09);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.56);
  font-size: 17px;
  font-weight: 950;
}

.profile-details,
.profile-details strong,
.profile-details span {
  display: block;
}

.profile-details strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.profile-details span {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.absence-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card-header {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}

.card-header.compact {
  min-height: 50px;
}

.card-header h2 {
  margin: 0;
  color: #101828;
  font-size: 19px;
  line-height: 1.1;
}

.absence-form {
  display: grid;
  min-width: 0;
}

.form-main {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(620px, 2.05fr);
  gap: 28px;
  min-width: 0;
  padding: 18px 24px 14px;
}

.field-block {
  min-width: 0;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 12px;
  color: #111827;
}

.step-title strong {
  font-size: 13px;
  font-weight: 900;
}

.search-select,
.input-group,
.date-input {
  min-width: 0;
}

.search-select {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  color: #667085;
  border: 1px solid rgba(16, 24, 40, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.search-select input,
.date-input input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font: inherit;
}

.search-select input::placeholder,
.date-input input::placeholder {
  color: #667085;
  opacity: 1;
}

.period-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
}

.period-card {
  position: relative;
  display: grid;
  grid-template-columns: 20px 28px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 78px;
  padding: 0 18px;
  border: 1px solid rgba(16, 24, 40, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.period-card input,
.reason-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.period-card:has(input:checked) {
  border-color: var(--blue);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(11, 114, 255, 0.72), 0 9px 20px rgba(11, 114, 255, 0.08);
}

.radio-visual {
  width: 18px;
  height: 18px;
  border: 2px solid #b9c4d6;
  border-radius: 50%;
  background: #fff;
}

.period-card input:checked + .radio-visual {
  border: 6px solid var(--blue);
}

.period-card .icon {
  color: #72809a;
}

.period-card strong,
.period-card small {
  display: block;
}

.period-card > span:last-child,
.reason-card > span:last-child,
.lesson-cell > span {
  min-width: 0;
}

.period-card strong {
  margin-bottom: 6px;
  color: #101828;
  font-size: 13px;
  font-weight: 900;
}

.period-card small {
  color: #475467;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.form-details {
  display: grid;
  grid-template-columns: minmax(450px, 1fr) minmax(520px, 1.18fr);
  align-items: start;
  gap: 24px;
  min-width: 0;
  padding: 6px 24px 14px;
}

.left-fields {
  display: grid;
  align-content: start;
  gap: 32px;
  min-width: 0;
}

.lessons-block {
  align-self: start;
  min-width: 0;
  padding-left: 24px;
  border-left: 1px solid rgba(16, 24, 40, 0.08);
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.input-group > span:first-child {
  display: block;
  margin-bottom: 10px;
  color: #111827;
  font-size: 12px;
  font-weight: 720;
}

.date-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: #111827;
  border: 1px solid rgba(16, 24, 40, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.84);
}

.date-input.muted {
  background: rgba(247, 249, 252, 0.78);
}

.date-input .icon {
  color: #1f2a44;
}

.date-input.muted .icon {
  color: #98a2b3;
}

.hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.hint .icon {
  color: #344054;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.reason-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.reason-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.reason-card:has(input:checked) {
  border-color: rgba(11, 114, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(11, 114, 255, 0.24);
}

.reason-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  line-height: 1;
}

.reason-icon .icon {
  display: block;
  width: 16px;
  height: 16px;
  margin: auto;
}

.reason-card strong,
.reason-card small,
.absence-table td span:not(.reason-icon) {
  display: block;
}

.reason-card strong {
  margin-bottom: 4px;
  color: #101828;
  font-size: 11.5px;
  font-weight: 900;
}

.reason-card small {
  color: #475467;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.reason-red .reason-icon,
.reason-icon.reason-red {
  color: var(--dept-business);
  background: color-mix(in srgb, var(--dept-business) 13%, #fff);
}

.reason-green .reason-icon,
.reason-icon.reason-green {
  color: var(--dept-stem);
  background: color-mix(in srgb, var(--dept-stem) 15%, #fff);
}

.reason-purple .reason-icon,
.reason-icon.reason-purple {
  color: var(--dept-care);
  background: color-mix(in srgb, var(--dept-care) 14%, #fff);
}

.reason-strike .reason-icon,
.reason-icon.reason-strike {
  color: var(--dept-care);
  background: color-mix(in srgb, var(--dept-care) 14%, #fff);
}

.reason-other .reason-icon,
.reason-icon.reason-other {
  color: var(--dept-work);
  background: color-mix(in srgb, var(--dept-work) 13%, #fff);
}

.reason-blue .reason-icon,
.reason-icon.reason-blue {
  color: var(--dept-design);
  background: color-mix(in srgb, var(--dept-design) 13%, #fff);
}

.reason-orange .reason-icon,
.reason-icon.reason-orange {
  color: var(--dept-it);
  background: color-mix(in srgb, var(--dept-it) 15%, #fff);
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
}

.lesson-cell {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
  min-height: 62px;
  padding: 13px 16px;
  border-right: 1px solid rgba(16, 24, 40, 0.08);
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
  cursor: pointer;
}

.lesson-cell:nth-child(3n) {
  border-right: 0;
}

.lesson-cell:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.lesson-cell input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  border: 1px solid #aab6ca;
  accent-color: var(--blue);
}

.lesson-cell strong,
.lesson-cell small {
  display: block;
}

.lesson-cell strong {
  margin-bottom: 7px;
  color: #101828;
  font-size: 12px;
  font-weight: 900;
}

.lesson-cell small {
  color: #344054;
  font-size: 12px;
  font-weight: 600;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  min-height: 60px;
  padding: 10px 24px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
}

.button-ghost {
  color: #101828;
  border: 1px solid rgba(16, 24, 40, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.button-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(11, 114, 255, 0.2);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.absence-table {
  min-width: 1060px;
}

.absence-table th {
  height: 40px;
  padding: 0 24px;
  background: rgba(248, 250, 252, 0.78);
}

.absence-table td {
  height: 55px;
  padding: 0 24px;
  font-size: 12px;
}

.absence-table td:first-child {
  color: #101828;
}

.absence-table td span:not(.reason-icon) {
  margin-top: 5px;
  color: #344054;
  font-weight: 650;
}

.absence-table td:nth-child(3) {
  display: flex;
  align-items: center;
  gap: 12px;
}

.more-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #101828;
  border-radius: 6px;
  background: transparent;
}

.more-button:hover {
  background: rgba(15, 23, 42, 0.06);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 24px;
  color: #344054;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  font-size: 12px;
  font-weight: 650;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: #8190a7;
  border-radius: 50%;
  background: transparent;
  font-weight: 850;
}

.pagination button:nth-child(2) .icon,
.pagination button:nth-child(4) .icon {
  transform: rotate(90deg);
}

.pagination button:nth-child(4) .icon {
  transform: rotate(-90deg);
}

.pagination button.active {
  color: var(--blue);
  border: 1px solid var(--blue);
  background: #fff;
}

@media (max-width: 1440px) {
  .form-main {
    grid-template-columns: minmax(300px, 0.88fr) minmax(560px, 2.12fr);
    gap: 24px;
  }

  .form-details {
    grid-template-columns: minmax(430px, 1fr) minmax(500px, 1.16fr);
  }

  .period-options {
    gap: 14px;
  }
}

@media (max-width: 1240px) {
  .form-main,
  .form-details {
    grid-template-columns: 1fr;
  }

  .left-fields {
    display: contents;
  }

  .date-block {
    order: 1;
  }

  .lessons-block {
    order: 2;
  }

  .reason-block {
    order: 3;
  }

  .lessons-block {
    padding-left: 0;
    border-left: 0;
  }

  .reason-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .page-header {
    padding-left: 0;
  }

  .profile {
    margin-right: 0;
  }
}

@media (max-width: 820px) {
  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .profile {
    min-width: 0;
  }

  .form-main,
  .form-details {
    padding-left: 16px;
    padding-right: 16px;
  }

  .period-options,
  .date-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .lesson-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-cell:nth-child(3n) {
    border-right: 1px solid rgba(16, 24, 40, 0.08);
  }

  .lesson-cell:nth-child(2n) {
    border-right: 0;
  }

  .lesson-cell:nth-last-child(-n + 3) {
    border-bottom: 1px solid rgba(16, 24, 40, 0.08);
  }

  .lesson-cell:nth-last-child(-n + 1) {
    border-bottom: 0;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }
}

@media (max-width: 580px) {
  .absences {
    gap: 9px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .page-header p {
    font-size: 13px;
  }

  .profile {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(16, 24, 40, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
  }

  .profile-details {
    overflow-wrap: anywhere;
  }

  .card-header {
    min-height: 52px;
    padding: 0 14px;
  }

  .card-header h2 {
    font-size: 17px;
  }

  .form-main,
  .form-details {
    gap: 22px;
    padding: 16px 14px;
  }

  .left-fields {
    gap: 28px;
  }

  .reason-grid,
  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .lesson-cell,
  .lesson-cell:nth-child(2n),
  .lesson-cell:nth-child(3n) {
    border-right: 0;
  }

  .lesson-cell:nth-last-child(-n + 1) {
    border-bottom: 0;
  }

  .form-actions {
    flex-direction: column-reverse;
    padding: 14px;
  }

  .button {
    width: 100%;
  }
}

/* Databasegestuurde personeelskiezer */
.register-card {
  overflow: visible;
}

.person-block {
  position: relative;
  z-index: 20;
}

.search-select {
  position: relative;
  cursor: text;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-select.is-open,
.search-select:focus-within {
  border-color: var(--blue);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 3px rgba(11, 114, 255, 0.10), 0 10px 24px rgba(15, 23, 42, 0.08);
}

.search-select.is-loading::after {
  content: "";
  position: absolute;
  right: 42px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(11, 114, 255, 0.20);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: teacher-picker-spin 850ms linear infinite;
}


/* Hou de bestaande SVG-chevron als enige dropdownpijltje. Browsers tonen soms
   automatisch een extra zwarte datalist-pijl; die verbergen we expliciet. */
.search-select input::-webkit-calendar-picker-indicator,
.search-select input::-webkit-list-button {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.search-select > .icon:last-child {
  transition: transform 160ms ease, color 160ms ease;
  pointer-events: none;
}

.search-select.is-open > .icon:last-child {
  transform: rotate(180deg);
  color: var(--blue);
}

.teacher-picker-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 336px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.teacher-picker-panel[hidden] {
  display: none;
}

.teacher-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 9px 10px 9px 12px;
  color: #101828;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  transition: background 140ms ease, transform 140ms ease;
}

.teacher-option:hover,
.teacher-option:focus-visible {
  background: rgba(11, 114, 255, 0.08);
  transform: translateY(-1px);
  outline: 0;
}

.teacher-option strong,
.teacher-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-option strong {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 900;
}

.teacher-option small {
  color: #475467;
  font-size: 11px;
  font-weight: 700;
}

.teacher-option b {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: var(--blue);
  border-radius: 999px;
  background: rgba(11, 114, 255, 0.10);
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0.01em;
}

.teacher-picker-empty {
  display: grid;
  gap: 5px;
  padding: 14px 12px;
  color: #475467;
  font-size: 12px;
  font-weight: 650;
}

.teacher-picker-empty strong {
  color: #101828;
  font-size: 13px;
  font-weight: 900;
}

@keyframes teacher-picker-spin {
  to { transform: rotate(360deg); }
}

.absence-actions-cell {
  position: relative;
  overflow: visible;
}

.more-button.is-active,
.more-button:focus-visible {
  color: var(--blue);
  background: rgba(11, 114, 255, 0.08);
  outline: 0;
}

.absence-action-menu {
  position: absolute;
  z-index: 80;
  top: 42px;
  right: 14px;
  display: none;
  min-width: 150px;
  padding: 6px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(16px);
}

.absence-action-menu.is-open {
  display: grid;
  gap: 2px;
}

.absence-action-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  color: #101828;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 850;
}

.absence-action-menu button:hover,
.absence-action-menu button:focus-visible {
  background: rgba(11, 114, 255, 0.08);
  outline: 0;
}

.absence-action-menu button.danger {
  color: var(--dept-business);
}

.absence-action-menu button.danger:hover,
.absence-action-menu button.danger:focus-visible {
  background: color-mix(in srgb, var(--dept-business) 10%, #fff);
}

.absence-form.is-editing {
  box-shadow: inset 4px 0 0 var(--blue);
}
