/* ============================================================================
   Klassenliste — Checkliste für Klassen  (modernes Design)
   ============================================================================ */

.kl-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

/* ── Loading / Empty ────────────────────────────────────────────────────── */
.kl-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; height: 200px; color: var(--text-2); font-size: 14px;
}
.kl-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: kl-spin 0.7s linear infinite;
}
@keyframes kl-spin { to { transform: rotate(360deg); } }

.kl-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; height: 300px; color: var(--text-2);
}
.kl-empty-icon { font-size: 48px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.kl-header {
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

/* Tabs */
.kl-tabs {
  display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
}
.kl-tab {
  padding: 5px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  background: var(--bg-2); color: var(--text-2);
  border: 1.5px solid var(--border); cursor: pointer;
  transition: all .15s;
}
.kl-tab.on {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}
.kl-tab-new {
  font-size: 17px; font-weight: 700; line-height: 1;
  padding: 4px 11px; color: var(--accent); border-style: dashed;
}
.kl-tab-new:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Header row */
.kl-header-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.kl-student-count {
  font-size: 12px; color: var(--text-3); white-space: nowrap;
}
.kl-action-group { display: flex; align-items: center; gap: 6px; }

/* Search input */
.kl-search-wrap {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 140px; max-width: 260px;
}
.kl-search-icon {
  position: absolute; left: 8px; font-size: 12px; pointer-events: none;
}
.kl-search-input {
  width: 100%; padding: 5px 8px 5px 26px;
  font-size: 13px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text-1); outline: none;
  transition: border-color .15s;
}
.kl-search-input:focus { border-color: var(--accent); }

/* Shared button helpers */
.btn-soft {
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-soft:hover { background: var(--bg-3, color-mix(in srgb, var(--border) 50%, var(--bg))); color: var(--text-1); }
.btn-sm { padding: 5px 11px !important; font-size: 12px !important; border-radius: 8px !important; }
.btn-danger { background: #ef4444; color: #fff; border: none; }
.btn-danger:hover { background: #dc2626; }
.kl-del-btn:hover { background: #fef2f2 !important; color: #ef4444 !important; border-color: #fca5a5 !important; }

/* Share menu */
.kl-share-wrap { position: relative; }
.kl-share-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  padding: 6px; min-width: 210px;
  display: flex; flex-direction: column; gap: 2px;
}
.kl-share-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13px; color: var(--text-1);
  background: transparent; border: none; cursor: pointer;
  text-align: left; width: 100%; transition: background .1s;
}
.kl-share-item:hover { background: var(--bg-2); }
.kl-share-icon { font-size: 16px; flex-shrink: 0; }

/* ── Table wrapper ──────────────────────────────────────────────────────── */
.kl-table-wrap {
  flex: 1;
  overflow: hidden;          /* card manages its own scroll */
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
}

/* Table card — rounded, shadowed, IS the scroll container */
.kl-table-card {
  flex: 1;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  overflow: auto;            /* scroll both axes here */
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

[data-theme="dark"] .kl-table-card {
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
}

.kl-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
}

/* ── Sticky name column ─────────────────────────────────────────────────── */
.kl-th-name, .kl-td-name {
  position: sticky; left: 0; z-index: 2;
  background: var(--bg);
  min-width: 160px; max-width: 200px;
}
.kl-th-name { z-index: 3; background: var(--bg-2); }

/* ── Column headers ─────────────────────────────────────────────────────── */
.kl-th {
  padding: 0; font-weight: 600;
  color: var(--text-2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap; vertical-align: bottom;
  background: var(--bg-2);
  transition: background 0.15s, box-shadow 0.15s;
}
.kl-th-dragging {
  opacity: 0.4;
}
.kl-th-drag-over {
  background: var(--accent-light, #e8eeff) !important;
  box-shadow: -3px 0 0 0 var(--accent, #4f8ef7);
}
.kl-col-drag-handle {
  font-size: 14px; color: var(--text-3, #94a3b8);
  cursor: grab; line-height: 1; user-select: none;
  opacity: .5; transition: color 0.1s, opacity 0.1s;
}
.kl-th:hover .kl-col-drag-handle { color: var(--accent, #4f8ef7); opacity: 1; }
.kl-th[draggable="true"] { cursor: grab; }
.kl-th-name {
  padding: 12px 16px; text-align: left;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3);
}
.kl-th-add { min-width: 44px; background: var(--bg-2); }

.kl-th-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 10px 6px 8px;
  min-width: 84px; max-width: 140px; position: relative;
}
.kl-col-type-badge {
  font-size: 11px; opacity: .7;
}
.kl-col-title {
  display: block; text-align: center; font-size: 12px; line-height: 1.3;
  cursor: pointer; padding: 2px 4px; border-radius: 4px;
  word-break: break-word; white-space: normal;
  transition: background .15s;
}
.kl-col-title:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.kl-col-header-content {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%;
}
.kl-col-header-date {
  font-size: 10px; font-weight: 600; letter-spacing: .02em;
  color: var(--accent); opacity: .8;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 4px; padding: 1px 5px; white-space: nowrap;
}
/* date picker directly in <th> */
.kl-col-date-pick {
  display: block; width: 100%;
  font-size: 10px; text-align: center;
  border: 1.5px dashed var(--border); border-radius: 20px;
  padding: 2px 4px; margin-top: 4px;
  cursor: pointer; background: transparent; color: var(--text-3);
  transition: border-color .15s, color .15s, background .15s;
  outline: none;
}
.kl-col-date-pick:hover { border-color: var(--accent); color: var(--accent); }
.kl-col-date-pick.has-date {
  border-style: solid; border-color: var(--accent);
  color: var(--accent); font-weight: 700;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.kl-col-input {
  width: 100%; font-size: 12px; text-align: center;
  border: 1.5px solid var(--accent); border-radius: 6px;
  padding: 3px 6px; background: var(--bg); color: var(--text-1); outline: none;
}
.kl-col-del {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 13px; line-height: 1; color: var(--text-3);
  background: transparent; opacity: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.kl-th:hover .kl-col-del { opacity: 1; }
.kl-col-del:hover { background: #ef4444; color: #fff; opacity: 1; }

/* "Alle markieren" button in column header */
.kl-all-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 700;
  letter-spacing: .03em; white-space: nowrap;
  background: var(--bg); color: var(--text-3);
  border: 1.5px solid var(--border); cursor: pointer;
  transition: all .13s; margin-top: 4px;
}
.kl-all-btn:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb,var(--accent) 8%,var(--bg)); }
.kl-all-btn.full { background: color-mix(in srgb,#16a34a 10%,var(--bg)); border-color: #16a34a; color: #16a34a; }
.kl-all-btn.full:hover { background: #fef2f2; border-color: #ef4444; color: #ef4444; }

.kl-add-col-btn {
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 20px; line-height: 1;
  background: var(--bg-2); color: var(--text-3);
  border: 1.5px dashed var(--border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin: 8px auto; transition: all .15s;
}
.kl-add-col-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Progress row ───────────────────────────────────────────────────────── */
.kl-progress-row td {
  border-bottom: 2px solid var(--border);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-2));
}
.kl-td-prog-label {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3);
  padding: 6px 16px; font-weight: 700;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-2));
}
.kl-td-prog { padding: 6px 4px; }
.kl-prog {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px; min-width: 84px;
}
.kl-prog-num { font-size: 11px; font-weight: 700; color: var(--text-3); }
.kl-prog-full { color: #16a34a !important; }
.kl-prog-track {
  width: 80%; height: 5px;
  background: var(--border); border-radius: 3px; overflow: hidden;
}
.kl-prog-fill {
  height: 100%; background: var(--accent);
  border-radius: 3px; transition: width .35s ease;
}

/* ── Student rows ───────────────────────────────────────────────────────── */
.kl-row { transition: background .1s; }
.kl-row:nth-child(even) td { background: color-mix(in srgb, var(--bg-2) 50%, var(--bg)); }
.kl-row:nth-child(even) .kl-td-name { background: color-mix(in srgb, var(--bg-2) 50%, var(--bg)); }
.kl-row:hover td { background: color-mix(in srgb, var(--accent) 7%, var(--bg)) !important; }
.kl-row:hover .kl-td-name { background: color-mix(in srgb, var(--accent) 7%, var(--bg)) !important; }

/* Row done — all checks complete */
.kl-row-done td { background: color-mix(in srgb, #22c55e 8%, var(--bg)) !important; }
.kl-row-done .kl-td-name { background: color-mix(in srgb, #22c55e 12%, var(--bg)) !important; }
.kl-row-done:hover td { background: color-mix(in srgb, #22c55e 14%, var(--bg)) !important; }

/* Row all-toggle button */
.kl-row-all-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border); background: none;
  font-size: 10px; cursor: pointer; margin-right: 6px;
  color: var(--text-3); transition: all .15s; flex-shrink: 0;
}
.kl-row-all-btn:hover { border-color: var(--accent); color: var(--accent); }
.kl-row-all-btn.done {
  background: #22c55e; border-color: #22c55e; color: #fff; font-weight: 700;
}

.kl-td {
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.kl-td-name {
  padding: 0 16px; height: 46px;
  font-weight: 500; color: var(--text-1); font-size: 13px;
  white-space: nowrap;
}
.kl-td-check { text-align: center; padding: 0 4px; }

/* ── Checkbox — clearly visible in light mode ───────────────────────────── */
.kl-checkbox {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 2.5px solid #94a3b8; /* slate-400 — always visible */
  background: #f8fafc;
  cursor: pointer; transition: all .15s;
  position: relative; user-select: none;
}
[data-theme="dark"] .kl-checkbox {
  border-color: #475569;
  background: #1e293b;
}
.kl-checkbox input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.kl-checkmark {
  font-size: 17px; color: transparent;
  font-weight: 800; transition: all .12s;
  line-height: 1;
}
.kl-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
}
.kl-checkbox.checked .kl-checkmark { color: #fff; }
.kl-checkbox:hover:not(.checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, #f8fafc);
}
[data-theme="dark"] .kl-checkbox:hover:not(.checked) {
  background: color-mix(in srgb, var(--accent) 15%, #1e293b);
}

/* ── Date input cell ────────────────────────────────────────────────────── */
.kl-date-input {
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
  min-width: 110px;
  max-width: 130px;
}
.kl-date-input:focus { border-color: var(--accent); color: var(--text-1); }
.kl-date-input.has-value {
  border-color: #16a34a;
  color: #16a34a;
  font-weight: 600;
  background: color-mix(in srgb, #16a34a 8%, var(--bg));
}
[data-theme="dark"] .kl-date-input { border-color: #334155; }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.kl-modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end;
  backdrop-filter: blur(3px);
}
@media (min-width: 600px) {
  .kl-modal-backdrop { align-items: center; justify-content: center; }
}
.kl-modal {
  background: var(--bg); border-radius: 20px 20px 0 0;
  width: 100%; max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 -4px 40px rgba(0,0,0,.22);
  overflow: hidden;
}
@media (min-width: 600px) {
  .kl-modal { border-radius: 20px; max-width: 540px; max-height: 86vh; }
  .kl-modal-sm { max-width: 380px !important; }
  .kl-modal-chat { max-width: 480px !important; }
}
.kl-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.kl-modal-title { font-size: 16px; font-weight: 700; color: var(--text-1); margin: 0; }
.kl-modal-body {
  flex: 1; overflow-y: auto; padding: 18px 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.kl-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 22px; border-top: 1px solid var(--border); flex-shrink: 0;
}

/* Labels & inputs inside modal */
.kl-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); display: block;
}
.kl-textarea {
  width: 100%; box-sizing: border-box;
  background: var(--bg-2); color: var(--text-1);
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; line-height: 1.5;
  font-family: var(--font-mono, monospace);
  resize: vertical; outline: none; transition: border-color .15s;
}
.kl-textarea:focus { border-color: var(--accent); }

/* ── ColumnEditor ───────────────────────────────────────────────────────── */
.kl-col-editor {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-2); border-radius: 12px;
  padding: 10px 12px; border: 1.5px solid var(--border);
}
.kl-col-group {
  display: flex; flex-direction: column; gap: 4px;
}
.kl-col-row {
  display: flex; align-items: center; gap: 8px;
}
.kl-col-row-input {
  flex: 1; font-size: 13px;
  border-radius: 8px !important;
  padding: 6px 10px !important;
}
.kl-col-date-row {
  display: flex; align-items: center; gap: 8px;
  padding-left: 4px;
}
.kl-col-date-label {
  font-size: 11px; color: var(--text-3); white-space: nowrap; flex-shrink: 0;
}
.kl-col-date-field {
  flex: 1; font-size: 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 5px 10px; background: var(--bg); color: var(--text-2);
  cursor: pointer; outline: none; transition: border-color .15s, color .15s;
}
.kl-col-date-field:focus,
.kl-col-date-field:hover { border-color: var(--accent); color: var(--text-1); }
.kl-col-date-field.has-date {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
}
.kl-col-date-clear {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  font-size: 13px; line-height: 1; color: var(--text-3);
  background: var(--bg-2); border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.kl-col-date-clear:hover { background: #ef4444; color: #fff; border-color: #ef4444; }
.kl-type-btn {
  flex-shrink: 0; width: 34px; height: 34px;
  border-radius: 8px; font-size: 14px;
  background: var(--bg); border: 1.5px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.kl-type-btn.on { background: color-mix(in srgb,var(--accent) 12%,var(--bg)); border-color: var(--accent); }
.kl-type-btn:hover { border-color: var(--accent); }
.kl-col-remove {
  flex-shrink: 0; width: 28px; height: 28px;
  border-radius: 6px; font-size: 16px; line-height: 1;
  color: var(--text-3); background: transparent;
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all .15s;
}
.kl-col-remove:hover { background: #fef2f2; color: #ef4444; }
.kl-add-col-inline {
  margin-top: 4px; align-self: flex-start;
}

/* ── SendChatModal — recipient list ─────────────────────────────────────── */
.kl-recipient-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 220px; overflow-y: auto;
  background: var(--bg-2); border-radius: 12px;
  padding: 6px; border: 1.5px solid var(--border);
}
.kl-recipient {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  background: transparent; border: none; cursor: pointer;
  text-align: left; width: 100%; transition: background .1s;
}
.kl-recipient:hover { background: var(--bg); }
.kl-recipient.on {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  outline: 1.5px solid var(--accent);
}
.kl-recipient-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent);
  color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.kl-avatar-all { font-size: 18px; }
.kl-recipient-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kl-recipient-info { display: flex; flex-direction: column; min-width: 0; }
.kl-recipient-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.kl-recipient-email { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Column picker ──────────────────────────────────────────────────────── */
.kl-col-picker {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-2); border-radius: 12px;
  padding: 8px 10px; border: 1.5px solid var(--border);
  max-height: 180px; overflow-y: auto;
}
.kl-col-pick-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer; transition: background .1s;
  user-select: none;
}
.kl-col-pick-item input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.kl-col-pick-item:hover { background: var(--bg); }
.kl-col-pick-item.on { background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.kl-col-pick-all { border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; margin-bottom: 2px; }
.kl-col-pick-check {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid #94a3b8; background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: transparent;
  transition: all .12s;
}
[data-theme="dark"] .kl-col-pick-check { border-color: #475569; background: #1e293b; }
.kl-col-pick-item.on .kl-col-pick-check {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.kl-col-pick-label { font-size: 13px; color: var(--text-1); flex: 1; }
.kl-col-pick-warn {
  font-size: 12px; color: #f59e0b; margin: 0;
  padding: 4px 0;
}

/* Chat preview */
.kl-chat-preview {
  background: var(--bg-2); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  font-size: 12px; line-height: 1.6;
  color: var(--text-2); white-space: pre-wrap;
  font-family: var(--font-mono, monospace);
  max-height: 160px; overflow-y: auto; margin: 0;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .kl-header { padding: 10px 14px 10px; }
  .kl-table-wrap { padding: 10px 10px 16px; }
  .kl-table-card { border-radius: 12px; }
  .kl-th-name, .kl-td-name { min-width: 130px; max-width: 160px; font-size: 12px; }
  .kl-td-name { padding: 0 10px; }
  .kl-th-inner { min-width: 72px; padding: 7px 4px; }
  .kl-checkbox { width: 32px; height: 32px; border-radius: 8px; }
  .kl-checkmark { font-size: 15px; }
  .kl-date-input { min-width: 90px; font-size: 11px; padding: 4px 5px; }
}

/* ── Presencia en tiempo real ──────────────────────────────────────────── */
.kl-presence-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 20px; font-size: 12px; font-weight: 500;
  color: #16a34a;
  background: linear-gradient(90deg, rgba(22,163,74,.08), transparent);
  border-bottom: 1px solid rgba(22,163,74,.15);
}
.kl-presence-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22,163,74,.4);
  animation: kl-pulse 2s infinite;
}
@keyframes kl-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22,163,74,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* ── Filtro "Fehlend" activo ───────────────────────────────────────────── */
.kl-filter-active {
  background: rgba(245,158,11,.15) !important;
  color: #b45309 !important;
  border-color: rgba(245,158,11,.4) !important;
}

/* ── Confetti ──────────────────────────────────────────────────────────── */
.kl-confetti-overlay {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  overflow: hidden;
}
.kl-confetti-dot {
  position: absolute; top: -20px;
  animation: kl-confetti-fall linear forwards;
}
@keyframes kl-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(760deg) scale(0.6); opacity: 0; }
}

/* ── Nota (Grade) column ───────────────────────────────────────────────── */
.kl-grade-input {
  width: 52px; height: 36px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg, #fff);
  text-align: center;
  font-size: 15px; font-weight: 700;
  color: var(--text-3); padding: 0 4px;
  transition: border-color .15s, color .15s;
  -moz-appearance: textfield;
}
.kl-grade-input::-webkit-inner-spin-button,
.kl-grade-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.kl-grade-input:focus { outline: none; border-color: #4f46e5; }
.kl-grade-input.has-value { border-color: currentColor; }
.kl-grade-avg { font-size: 13px; font-weight: 700; }

/* ── Student name — clickable ──────────────────────────────────────────── */
.kl-td-name-click {
  cursor: pointer;
  transition: color .15s, background .15s;
}
.kl-td-name-click:hover { color: #4f46e5; background: rgba(79,70,229,.06); }

/* ── StudentPanel ──────────────────────────────────────────────────────── */
.kl-student-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(360px, 100vw);
  background: var(--bg, #fff);
  border-left: 1px solid var(--border, #e2e8f0);
  box-shadow: -8px 0 32px rgba(0,0,0,.12);
  z-index: 300;
  display: flex; flex-direction: column;
  overflow-y: auto;
  animation: kl-sp-slide .2s ease;
}
@keyframes kl-sp-slide {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.kl-sp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: linear-gradient(135deg, #312f80 0%, #4f46e5 100%);
  color: #fff; gap: 12px;
}
.kl-sp-header > div:first-child { display: flex; align-items: center; gap: 12px; }
.kl-sp-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.kl-sp-name { font-size: 15px; font-weight: 700; }
.kl-sp-sub  { font-size: 11px; opacity: .75; margin-top: 1px; }
.kl-sp-header .iconbtn { color: rgba(255,255,255,.8); background: rgba(255,255,255,.1); border-color: transparent; }
.kl-sp-section { padding: 14px 16px; border-bottom: 1px solid var(--border, #e2e8f0); }
.kl-sp-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.kl-sp-add { padding: 3px 10px; font-size: 11px; }
.kl-sp-empty { font-size: 12px; color: var(--text-3); margin: 0; }
.kl-sp-list-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 8px; font-size: 12px;
}
.kl-sp-list-name { font-weight: 600; color: var(--text-1); min-width: 60px; }
.kl-sp-chip {
  background: var(--bg-2, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 1px 8px;
  font-size: 11px; font-weight: 500; color: var(--text-2);
}
.kl-sp-chip.done { background: rgba(22,163,74,.1); color: #16a34a; border-color: rgba(22,163,74,.3); }
.kl-sp-chip.grade { background: transparent; border-color: transparent; font-weight: 700; }
.kl-sp-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.kl-sp-form-row { display: flex; gap: 6px; }
.kl-sp-form-row .input { flex: 1; font-size: 12px; padding: 6px 8px; }
.kl-sp-form-btns { display: flex; gap: 8px; justify-content: flex-end; }
.kl-sp-contact {
  position: relative;
  background: var(--bg-2, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  margin-bottom: 8px;
}
.kl-sp-contact-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.kl-sp-contact-type { font-size: 12px; font-weight: 600; color: var(--text-1); }
.kl-sp-contact-date { font-size: 11px; color: var(--text-3); }
.kl-sp-contact-by   { font-size: 11px; color: var(--text-3); }
.kl-sp-contact-note { font-size: 12px; color: var(--text-2); margin: 0; line-height: 1.5; }
.kl-sp-contact-del {
  position: absolute; top: 8px; right: 8px;
  border: none; background: none; cursor: pointer;
  color: var(--text-3); font-size: 16px; line-height: 1;
  padding: 0 4px;
}
.kl-sp-contact-del:hover { color: #ef4444; }
