/* ===== Trainer Dashboard ===== */
.bti-trainer-dashboard {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}

/* Toolbar */
.bti-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.bti-toolbar__left,
.bti-toolbar__right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bti-link {
  text-decoration: none;
}

/* Form labels en dropdowns */
.bti-trainer-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
  align-items: center;
}

.bti-trainer-form .bti-form-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.bti-trainer-form .bti-trainer-select {
  min-width: 150px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  font-size: 0.95rem;
}

/* Oude tabel */
.bti-trainer-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.bti-trainer-table th,
.bti-trainer-table td {
  padding: 0.75rem 1rem;
  border: 1px solid #e1e1e1;
  text-align: left;
}

.bti-trainer-table th {
  background: #eafaea;
  font-weight: 600;
}

.bti-trainer-table tr:nth-child(even) {
  background: #fcfcfc;
}

/* Oude button */
.bti-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.bti-button--danger {
  background: #dc3545;
  color: #fff;
}

.bti-button--danger:hover {
  background: #c82333;
  transform: translateY(-1px);
}

/* Titels */
.bti-trainer-dashboard .bti-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.bti-trainer-dashboard .bti-subtitle {
  font-size: 1.5rem;
  color: #555;
  margin-bottom: 1rem;
}

.bti-trainer-dashboard .bti-subtitle2 {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1rem;
}

/* Algemene styling voor status-labels */
.bti-status {
  font-weight: bold;
}

.bti-status-gepland {
  color: #28a745;
}

.bti-status-afgemeld {
  color: #dc3545;
}

/* Matrix */
.bti-group-matrix th {
  background: #eafaea;
  padding: 0.5em;
  text-align: center;
}

.bti-group-matrix td {
  text-align: center;
  padding: 0.5em;
}

/* Buttons in matrix */
.bti-button--secondary {
  background: #6c757d;
  color: #fff;
}

.bti-button--secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

.bti-matrix-button {
  padding: 0.3em 0.6em;
  font-size: 0.9rem;
}

/* Open groep knop */
.bti-next-lesson {
  display: flex;
  align-items: center;
  margin-bottom: 1.5em;
  font-size: 1.1em;
}

.bti-next-label {
  font-weight: bold;
  margin-right: 0.5em;
}

.bti-next-info {
  margin-right: 1em;
}

.bti-next-button {
  background: #0073aa;
  color: #fff;
}

.bti-next-button:hover {
  background: #005177;
}

/* Link-styling */
.bti-group-link {
  display: inline-block;
  padding: 0.25em 0.5em;
  background: #0073aa;
  color: #fff;
  border-radius: 3px;
  text-decoration: none;
}

.bti-group-link:hover {
  background: #005177;
}

.bti-no-group {
  color: #999;
}

/* ===== Attendance List ===== */
.bti-att-status-present {
  color: #28a745 !important;
  font-weight: bold !important;
}

.bti-att-status-absent {
  color: #dc3545 !important;
  font-weight: bold !important;
}

.bti-att-status-cell {
  text-align: center;
  font-size: 1.2rem;
}

/* Les gegeven knop links */
.bti-controls {
  text-align: left !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.bti-controls button.bti-lesgegeven {
  float: left;
  margin: 0 !important;
  padding: 6px 12px;
}

/* Checkbox */
.bti-presence-table input[type="checkbox"] {
  width: 22px;
  height: 22px;
  transform: translateY(2px);
  accent-color: currentColor;
}

.bti-presence-table td.presence-col,
.bti-presence-table th.presence-col {
  width: 70px;
}

.bti-presence-table td:first-child {
  font-weight: 700;
  font-size: 16px;
}

/* =========================================================
   NIEUWE DASHBOARD MARKUP
   ========================================================= */

/* Tabs */
.bti-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.bti-tab {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #cfd6dd;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}

.bti-tab.is-active {
  background: #0b74de;
  color: #fff;
  border-color: #0b74de;
}

/* Datum select */
.bti-dateform {
  margin: 0 0 10px 0;
}

.bti-dateform__label {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.bti-select {
  padding: 8px 10px;
  border: 1px solid #cfd6dd;
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  font-size: 15px;
  width: 180px;
  max-width: 100%;
}

/* Tijd-pills */
.bti-slot-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.bti-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 10px 14px;
  border: 2px solid #0b74de;
  border-radius: 999px;
  background: #fff;
  color: #0b74de;
  text-decoration: none;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}

.bti-pill:hover {
  filter: brightness(0.98);
}

.bti-pill.is-active {
  background: #0b74de;
  color: #fff;
  border-color: #0b74de;
}

/* Card */
.bti-card {
  position: relative;
  background: #eaf7ef;
  border: 1px solid #bfe6c9;
  border-radius: 10px;
  padding: 14px;
  padding-bottom: 72px;
  margin-top: 10px;
  box-sizing: border-box;
}

.bti-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.bti-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
}

.bti-card__left {
  min-width: 0;
  flex: 1 1 auto;
}

.bti-headerline1 {
  font-size: 20px;
  font-weight: 800;
  margin: 6px 0 6px;
  line-height: 1.3;
}

.bti-headerline2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
  color: #2f3a40;
}

.bti-headerline3 {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: #2f3a40;
}

.bti-leveltext {
  font-weight: 600;
}

/* Nieuwe buttons */
.bti-btn {
  padding: 9px 14px;
  border: 1px solid #cfd6dd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
}

.bti-btn--danger {
  border-color: #ff5b5b;
  color: #ff2f2f;
  background: #fff;
}

.bti-btn--primary {
  border-color: #2ecc71;
  color: #1e9e52;
  background: #fff;
}

.bti-btn--ghost {
  border-color: #cfd6dd;
  color: #333;
  background: #fff;
}

/* Status chips */
.bti-status-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #cfd6dd;
  background: #f5f7f9;
}

.bti-status-chip--planned {
  background: #e9f7ef;
  border-color: #bfe6c9;
}

.bti-status-chip--cancelled {
  background: #fdecec;
  border-color: #ffbdbd;
}

.bti-status-chip--filled {
  background: #fff6e5;
  border-color: #ffd79a;
}

/* Tabel nieuw */
.bti-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #fff;
  table-layout: fixed;
}

.bti-table th,
.bti-table td {
  border: 1px solid #d9e2ea;
  padding: 10px;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Extra les knop */
.bti-btn-add-extra.bti-extra-bottom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 900;
  border: 2px solid #f39c12;
  background: #f39c12;
  color: #fff;
}

.bti-btn-add-extra.bti-extra-bottom:hover {
  border-color: #2e7d32;
  background: #2e7d32;
  color: #fff;
}

.bti-attendance__msg.is-ok {
  color: #1e9e52;
  font-weight: 700;
}

.bti-attendance__msg.is-err {
  color: #c82333;
  font-weight: 700;
}

/* Dashboard buttons kleuren */
.bti-btn.bti-btn--danger {
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.bti-btn.bti-btn--danger:hover {
  background: #c82333;
  border-color: #c82333;
  color: #fff;
}

.bti-btn.bti-btn--primary {
  background: #28a745;
  border-color: #28a745;
  color: #fff;
}

.bti-btn.bti-btn--primary:hover {
  background: #218838;
  border-color: #218838;
  color: #fff;
}

.bti-pill--given {
  background: #e8f7ee;
  border-color: #bfe6cf;
  color: #1f6d3a;
}

.bti-pill--cancel {
  background: #fdecea;
  border-color: #f5c2c0;
  color: #b42318;
}

.bti-pill--neutral {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1e3a8a;
}

.bti-card__actions .bti-btn--primary,
.bti-card__actions .bti-btn--ghost {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  min-height: 30px;
}

.bti-btn--markgiven,
.bti-btn--given-mini {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
}

/* =========================================================
   Actions rechtsboven strak
   ========================================================= */
.bti-card__actions .bti-cancel-form,
.bti-card__actions .bti-given-form {
  margin: 0;
}

.bti-btn--cancel-top {
  border-radius: 999px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  min-height: 32px;
}

.bti-cancel-form {
  display: inline-block;
}

.bti-given-form {
  display: inline-block;
}

.bti-presence-link {
  display: inline-flex;
}

/* =========================================================
   MOBIEL
   ========================================================= */
@media (max-width: 768px) {

  .bti-trainer-dashboard {
    max-width: 100%;
    padding: 12px;
  }

  .bti-card {
    position: relative;
    width: 100%;
    padding: 12px;
    padding-top: 72px !important;
    padding-bottom: 12px;
    overflow: hidden;
  }

  .bti-card__top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .bti-card__left {
    width: 100%;
    min-width: 0;
  }

  /* HIER ZIT DE FIX:
     ruimte rechts vrijhouden voor de rode knop,
     zodat de tijd zoals 18:00 zichtbaar blijft */
  .bti-headerline1 {
    display: block;
    width: 100%;
    padding-right: 130px;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
    font-size: 18px;
    line-height: 1.35;
    margin: 4px 0 6px;
  }

  .bti-headerline2,
  .bti-headerline3 {
    width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.35;
  }

  .bti-tabs,
  .bti-slot-pills {
    gap: 8px;
  }

  .bti-tab,
  .bti-pill {
    font-size: 14px;
  }

  .bti-btn-add-extra.bti-extra-bottom {
    position: static;
    display: flex;
    width: 100%;
    margin-top: 12px;
    justify-content: center;
  }

  .bti-card__actions {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin-top: 10px !important;
  }

  /* rode knop rechtsboven */
  .bti-card__actions .bti-cancel-form {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    width: auto !important;
    margin: 0 !important;
    z-index: 20 !important;
    display: block !important;
  }

  .bti-card__actions .bti-cancel-form .bti-btn--cancel-top {
    display: inline-flex !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    border-radius: 999px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .bti-card__actions .bti-cancel-form .bti-cancel-reason {
    margin-top: 8px !important;
    width: 230px !important;
    max-width: 72vw !important;
  }

  /* groene knop breed */
  .bti-card__actions .bti-given-form {
    display: block !important;
    width: 100% !important;
    margin: 0 0 10px 0 !important;
  }

  .bti-card__actions .bti-given-form .bti-btn {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
  }

  /* presentielijst breed */
  .bti-card__actions .bti-presence-link {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
    margin: 0 !important;
  }

  .bti-table {
    table-layout: fixed;
  }

  .bti-table th,
  .bti-table td {
    padding: 6px !important;
    font-size: 13px !important;
  }

  .bti-table th:nth-child(1),
  .bti-table td:nth-child(1) {
    width: 31% !important;
    min-width: 0 !important;
    word-break: break-word;
  }

  .bti-table th:nth-child(2),
  .bti-table td:nth-child(2) {
    width: 20% !important;
    min-width: 0 !important;
    text-align: center;
  }

  .bti-table th:nth-child(3),
  .bti-table td:nth-child(3) {
    width: 14% !important;
    min-width: 0 !important;
    text-align: center;
  }

  .bti-table th:nth-child(4),
  .bti-table td:nth-child(4) {
    width: 35% !important;
    min-width: 0 !important;
    max-width: none !important;
    text-align: center !important;
    padding: 6px 4px !important;
  }

  .bti-presence-table td:nth-child(4) form,
  .bti-presence-table td:last-child form {
    display: block !important;
    width: 100%;
    margin: 0 !important;
  }

  .bti-presence-table td:nth-child(4) .bti-btn,
  .bti-presence-table td:nth-child(4) button.bti-btn,
  .bti-presence-table td:nth-child(4) .bti-button,
  .bti-presence-table td:last-child .bti-btn,
  .bti-presence-table td:last-child button.bti-btn,
  .bti-presence-table td:last-child .bti-button {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 8px 4px !important;
    font-size: 11px !important;
    line-height: 1.05 !important;
    border-radius: 8px !important;
    white-space: normal !important;
    word-break: break-word;
  }

  .bti-table input[type="checkbox"],
  .bti-presence-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
    transform: none;
  }

  .bti-trainer-dashboard form button[type="submit"],
  .bti-save-btn,
  .bti-btn--save,
  .bti-controls button.bti-lesgegeven,
  .bti-btn-save-attendance {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}