:root {
  --primary: #176d73;
  --primary-dark: #0f555a;
  --primary-soft: #edf6f6;
  --primary-soft-2: #dfeeee;
  --primary-border: #c8dddd;

  --success: #3d7f45;
  --success-soft: #edf7ee;
  --danger: #c84545;
  --danger-soft: #fdf0f0;
  --warning: #a87017;
  --warning-soft: #fff7e8;

  --light: #f5f3ee;
  --surface: #fbfaf7;
  --border: #d7d1c7;
  --border-soft: #e7e1d8;
  --text: #24211d;
  --muted: #6e6a63;
  --bg: #f3f0ea;
  --white: #ffffff;
  --focus: #111111;

  --shadow-sm: 0 2px 8px rgba(28, 24, 19, 0.05);
  --shadow-md: 0 10px 30px rgba(28, 24, 19, 0.08);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* Reset / Basis */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(23, 109, 115, 0.08), transparent 24%),
    linear-gradient(180deg, #f8f6f2 0%, #f2eee7 100%);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.bt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Admin Shell */

.bt-admin-shell,
.bt-frontend-wrap {
  width: 100%;
}

.bt-admin-shell {
  max-width: 1280px;
  margin: 24px 0 40px;
  padding-right: 20px;
}

.bt-headline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.bt-headline h1 {
  margin: 0;
  font-size: clamp(1.8rem, 1.4rem + 1vw, 2.6rem);
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.bt-version {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

/* Header & Karten */

.bt-header,
.bt-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.bt-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 28px;
  margin: 24px 0 22px;
  backdrop-filter: blur(8px);
}

.bt-header h1,
.bt-card h2,
.bt-card h3,
.bt-card h4 {
  margin-top: 0;
  color: var(--text);
}

.bt-header h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 1.4rem + 2vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.bt-header p {
  max-width: 72ch;
  margin: 0 0 10px;
  color: var(--muted);
}

.bt-card {
  padding: 28px;
  min-width: 0;
}

.bt-card > :last-child {
  margin-bottom: 0;
}

.bt-card p {
  color: var(--text);
}

/* Frontend Wrapper */

.bt-frontend-wrap {
  max-width: 1024px;
  margin: 32px auto 56px;
  padding: 0 16px;
}

/* Actions */

.bt-actions,
.bt-actions-row,
.bt-card-head-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.bt-card-head-inline {
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Tabs (Admin) */

.bt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.bt-tab-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  padding: 11px 14px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.bt-tab-btn:hover {
  background: #f1f6fb;
  color: var(--text);
  border-color: #c6d7df;
  transform: translateY(-1px);
}

.bt-tab-btn.is-active {
  color: #fff;
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 8px 18px rgba(23, 109, 115, 0.22);
}

/* Alte Tab-Struktur weiterhin kompatibel */

.bt-tabs-shell {
  padding: 0;
  overflow: hidden;
}

.bt-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%);
}

.bt-tab-panels {
  padding: 20px;
}

.bt-tab-panel {
  display: none;
}

.bt-tab-panel.is-active {
  display: block;
}

.bt-tab-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Report / Panels */

.bt-report-card {
  margin-bottom: 20px;
}

.bt-report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

/* Formulare */

.bt-grid-row,
.bt-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.bt-form-grid {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--primary-soft) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  align-items: start;
}

.bt-form-grid .bt-input-group {
  margin-bottom: 0;
  min-width: 0;
}

.bt-form-grid .bt-input-group label {
  margin-bottom: 2px;
}

.bt-form-grid input,
.bt-form-grid select {
  width: 100%;
  min-width: 0;
}

.bt-form-grid input::placeholder {
  color: #8a847b;
}

.bt-form-grid input[name="vorname"],
.bt-form-grid input[name="nachname"] {
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
}

.bt-form-grid input[name="vorname"] {
  border-color: var(--primary-border);
}

.bt-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  min-width: 0;
}

.bt-input-group label {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.bt-input-group input,
.bt-input-group select,
.bt-move-select,
.f-name-edit,
.f-jobs-edit,
.bt-entry-name-edit,
.bt-entry-klasse-edit {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.bt-slot-time-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font: inherit;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.bt-input-group input:hover,
.bt-input-group select:hover,
.bt-move-select:hover,
.f-name-edit:hover,
.f-jobs-edit:hover,
.bt-entry-name-edit:hover,
.bt-entry-klasse-edit:hover,
.bt-slot-time-input:hover {
  border-color: #bfc8ce;
}

.bt-input-group input:focus,
.bt-input-group select:focus,
.bt-move-select:focus,
.f-name-edit:focus,
.f-jobs-edit:focus,
.bt-entry-name-edit:focus,
.bt-entry-klasse-edit:focus,
.bt-slot-time-input:focus,
.s-toggle:focus,
.bt-btn:focus,
.bt-accordion-summary:focus,
.bt-sub-accordion-summary:focus,
.bt-acc-head:focus,
.bt-tab-btn:focus,
.bt-chip-action:focus,
.bt-chip-remove:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 109, 115, 0.14);
}

/* Slot-Zeiten-Grid */

.bt-slot-times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.bt-slot-time-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bt-slot-time-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Buttons */

.bt-btn {
  appearance: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.bt-btn:hover {
  transform: translateY(-1px);
}

.bt-btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 109, 115, 0.22);
}

.bt-btn.primary:hover {
  background: var(--primary-dark);
}

.bt-btn.success {
  background: var(--success);
  color: #fff;
}

.bt-btn.success:hover {
  background: #2f6d3d;
}

.bt-btn.danger {
  background: var(--danger);
  color: #fff;
}

.bt-btn.danger:hover {
  background: #af3232;
}

.bt-btn.warning {
  background: var(--warning);
  color: #fff;
}

.bt-btn.warning:hover {
  background: #8e5f11;
}

.bt-btn.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.bt-btn.secondary:hover {
  background: var(--surface);
  border-color: var(--primary-border);
  color: var(--primary);
}

.bt-btn.small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 12px;
}

.bt-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

#bt-reset-entries {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Alerts */

.bt-alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.bt-alert.success {
  background: var(--success-soft);
  border: 2px solid #7ac48a;
  color: #145322;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.bt-alert.error {
  background: var(--danger-soft);
  border-color: #f0b8b8;
  color: #8a1f1f;
}

.bt-alert.info {
  background: var(--primary-soft);
  border-color: #bad5cf;
  color: #184f48;
}

.bt-alert.warning {
  background: var(--warning-soft);
  border-color: #ead39c;
  color: #805500;
}

/* Submit-Status */

.bt-submit-status {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  margin: 18px 0 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  font-size: 16px;
  line-height: 1.45;
  scroll-margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

.bt-submit-status:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.bt-submit-status-icon {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.bt-submit-status-text {
  flex: 1 1 auto;
}

.bt-submit-status.is-loading {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary-dark);
}

.bt-submit-status.is-success {
  background: var(--success-soft);
  border-color: #7ac48a;
  color: #145322;
}

.bt-submit-status.is-error {
  background: var(--danger-soft);
  border-color: #f0b8b8;
  color: #8a1f1f;
}

#bt-submit[disabled] {
  opacity: 0.8;
  cursor: wait;
}

/* Typografie / Badges / Chips */

.bt-muted {
  color: var(--muted);
}

.bt-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 0;
}

.bt-report-badge {
  margin-bottom: 0;
  white-space: nowrap;
}

.bt-report-badge.is-success {
  background: var(--success-soft);
  color: #145322;
}

.bt-report-badge.is-info {
  background: #fff6e6;
  color: #8a5a12;
}

.bt-report-badge.is-error {
  background: var(--danger-soft);
  color: #8a1f1f;
}

/* KPI */

.bt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.bt-kpi-card {
  border: 1px solid #dcdcde;
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 14px;
  min-width: 0;
}

.bt-kpi-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.bt-kpi-value {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

/* Report-Listen */

.bt-report-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 18px;
}

.bt-report-item {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #f8f9fa;
}

.bt-report-item.warning {
  background: var(--warning-soft);
  border-color: #ead39c;
  color: #805500;
}

.bt-report-item.error {
  background: var(--danger-soft);
  border-color: #f0b8b8;
  color: #8a1f1f;
}

/* Firmeneditor */

.f-item {
  background: var(--surface);
  border: 1px solid #dcdcde;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.f-header {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.f-header .f-name-edit {
  flex: 1 1 auto;
}

/* Slot-Sperren */

.s-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.s-toggle {
  min-width: 46px;
  min-height: 34px;
  border: 1px solid #c3c4c7;
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.s-toggle.is-active {
  background: var(--danger);
  color: #fff;
  border-color: #a81f22;
}

/* Tabellen */

.bt-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}

.bt-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  table-layout: auto;
}

.bt-table th,
.bt-table td {
  border: 1px solid #dcdcde;
  padding: 10px;
  vertical-align: top;
  word-break: break-word;
}

.bt-table th {
  background: var(--light);
  text-align: left;
}

.bt-table-compact th,
.bt-table-compact td {
  font-size: 13px;
  padding: 8px 10px;
}

.bt-table-entries {
  table-layout: fixed;
}

.bt-table-entries .col-action {
  width: 96px;
}

.bt-table-entries .col-name {
  width: auto;
}

.bt-table-entries .col-class {
  width: 110px;
}

.bt-table-entries .cell-action {
  white-space: nowrap;
}

.bt-table-entries .cell-name {
  font-weight: 600;
}

.bt-table-entries .bt-btn.small {
  width: 100%;
  min-width: 0;
}

.cell-blocked {
  background: #fdeeee;
  text-align: center;
}

.cell-free {
  color: var(--muted);
  text-align: center;
}

/* Frontend Ranking */

.bt-ranking-toolbar {
  margin: 22px 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.bt-ranking-list {
  display: grid;
  gap: 14px;
  margin: 18px 0 22px;
}

.bt-ranking-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border-soft);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.bt-ranking-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(28, 24, 19, 0.07);
  border-color: var(--border);
}

.bt-ranking-item:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 109, 115, 0.14);
}

.bt-ranking-main {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.bt-ranking-text {
  min-width: 0;
}

.bt-rank-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #e7f1f1 0%, #d8e8e7 100%);
  color: var(--primary);
  font-weight: 800;
  font-size: 1.05rem;
  flex: 0 0 54px;
}

.bt-ranking-item:nth-child(1) .bt-rank-badge {
  background: linear-gradient(180deg, #f4e4a8, #e6cc71);
  color: #6f5600;
}

.bt-ranking-item:nth-child(2) .bt-rank-badge {
  background: linear-gradient(180deg, #ebedf0, #d7dce2);
  color: #4e5764;
}

.bt-ranking-item:nth-child(3) .bt-rank-badge {
  background: linear-gradient(180deg, #e8d4c7, #dcb89f);
  color: #74492c;
}

.bt-ranking-name {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text);
}

.bt-ranking-sub {
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 0.94rem;
}

.bt-ranking-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Chips */

.bt-chip-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bt-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  border: 1px solid var(--primary-border);
}

.bt-chip-wrap-assignments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.bt-assignment-block {
  width: 100%;
  margin-bottom: 10px;
}

.bt-chip-assign {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 4px;
  background: #eef4ff;
  border: 1px solid #cfdcf7;
  color: #1f2d3d;
}

.bt-chip-assign.is-removable {
  padding-right: 2px;
}

.bt-chip-assign > span:first-child {
  min-width: 0;
  word-break: break-word;
}

.bt-chip-action,
.bt-chip-remove {
  appearance: none;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.bt-chip-action {
  color: #1d5fbf;
}

.bt-chip-action::before {
  content: "↔";
  font-weight: 700;
}

.bt-chip-action:hover {
  background: rgba(29, 95, 191, 0.12);
  color: #154a96;
}

.bt-chip-remove {
  color: #b42318;
}

.bt-chip-remove::before {
  content: "×";
  font-size: 18px;
  font-weight: 700;
}

.bt-chip-remove:hover {
  background: rgba(180, 35, 24, 0.12);
  color: #8f1c13;
}

/* Move-Panel */

.bt-move-panel {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fafafa;
}

.bt-move-panel .bt-input-group {
  margin-bottom: 0;
}

.bt-move-panel .bt-actions {
  margin-top: 10px;
  justify-content: flex-start;
  gap: 8px;
}

.bt-assignment-help {
  margin-top: 8px;
}

/* Akkordeons */

.bt-accordion {
  margin-top: 12px;
  border: 1px solid #d9e4ef;
  border-radius: var(--radius-md);
  background: #f8fbfe;
  overflow: hidden;
}

.bt-accordion-summary {
  cursor: pointer;
  list-style: none;
  display: block;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--primary);
}

.bt-accordion-summary::-webkit-details-marker,
.bt-accordion-summary::marker {
  display: none;
  content: "";
}

.bt-accordion-summary::after {
  content: "+";
  float: right;
  font-weight: 700;
}

.bt-accordion[open] .bt-accordion-summary::after {
  content: "–";
}

.bt-accordion-content {
  padding: 0 12px 12px;
}

/* Unter-Akkordeon */

.bt-sub-accordion {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}

.bt-sub-accordion + .bt-sub-accordion {
  margin-top: 8px;
}

.bt-sub-accordion-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.9fr) 18px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.bt-sub-accordion-summary::-webkit-details-marker,
.bt-sub-accordion-summary::marker {
  display: none;
  content: "";
}

.bt-sub-accordion-summary::after {
  content: "+";
  justify-self: end;
  font-weight: 700;
  color: var(--primary);
}

.bt-sub-accordion[open] .bt-sub-accordion-summary::after {
  content: "–";
}

.bt-sub-accordion-content {
  padding: 0 12px 12px;
  border-top: 1px solid #edf0f2;
}

/* Entry-/Student-Listen */

.bt-entry-list,
.bt-student-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.bt-entry-list-compact {
  gap: 8px;
}

.bt-acc-item {
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.bt-acc-item + .bt-acc-item {
  margin-top: 10px;
}

.bt-acc-head {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--primary-soft);
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.bt-acc-head:hover {
  background: var(--primary-soft-2);
}

.bt-acc-head.is-open {
  background: var(--primary-soft-2);
  border-bottom-color: var(--primary-border);
}

.bt-acc-title {
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.bt-acc-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.bt-acc-panel {
  background: #f8fbfe;
}

.bt-acc-panel .bt-entry-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 14px 16px 16px;
}

/* Toolbar Anmeldungen */

.bt-entry-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.bt-entry-toolbar-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.bt-entry-toolbar-main h2 {
  margin-bottom: 0;
}

.bt-entry-toolbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.bt-entry-search-group {
  margin-bottom: 0;
  min-width: 280px;
  max-width: 380px;
}

.bt-entry-search-group input {
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.bt-entry-search-group input::placeholder {
  color: #8a847b;
}

.bt-entry-search-group input:focus {
  border-color: var(--primary);
  box-shadow:
    0 0 0 4px rgba(23, 109, 115, 0.14),
    0 6px 14px rgba(23, 109, 115, 0.08);
}

.bt-entry-result-hint {
  margin-top: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--primary-soft) 0%, #f7fbfb 100%);
  color: var(--primary-dark);
  font-size: 13px;
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
}

/* Slot-Karten */

.bt-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.bt-slot-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.bt-slot-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--light);
  border-bottom: 1px solid #dcdcde;
}

.bt-slot-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.bt-slot-meta {
  font-size: 12px;
  color: var(--muted);
}

.bt-slot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.bt-slot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.9fr);
  gap: 12px;
  align-items: start;
  border: 1px solid #e1e4e8;
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 10px 12px;
}

.bt-slot-row.is-blocked {
  background: #fdeeee;
  border-color: #f0c9c9;
}

.bt-slot-row.is-filled {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.bt-slot-company {
  min-width: 0;
}

.bt-slot-company-name {
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.bt-slot-company-jobs {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  word-break: break-word;
}

.bt-slot-assignment {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.bt-slot-state {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.bt-slot-state.is-free {
  background: #f1f1f1;
  color: #555;
  border-color: #ddd;
}

.bt-slot-state.is-filled {
  background: var(--primary-soft-2);
  color: #0b5f91;
  border-color: #cfe4f3;
}

.bt-slot-state.is-blocked {
  background: #fde7e7;
  color: #9a1f24;
  border-color: #efc4c4;
}

.bt-slot-person,
.bt-slot-empty,
.bt-slot-blocked-label {
  display: block;
  line-height: 1.4;
  word-break: break-word;
}

.bt-slot-person {
  font-weight: 600;
  color: var(--text);
}

.bt-slot-empty {
  color: var(--muted);
  font-style: italic;
}

.bt-slot-blocked-label {
  color: #9a1f24;
  font-weight: 700;
}

/* Karten für Anmeldungen & Teilnehmer */

.bt-entry-card,
.bt-student-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.bt-entry-card-head,
.bt-student-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.bt-entry-title {
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.bt-entry-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.bt-entry-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bt-entry-text {
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.bt-entry-summary-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bt-entry-summary-side {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
  min-width: 0;
}

/* Inline-Checkboxen */

.bt-inline-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}

.bt-inline-check input[type="checkbox"] {
  margin-top: 3px;
}

.bt-frontend-lock-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.bt-frontend-lock-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* Bottom Sheet */

.bt-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 24, 0.42);
  backdrop-filter: blur(3px);
  z-index: 999;
}

.bt-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.18);
  padding: 14px 16px 24px;
}

.bt-sheet-handle {
  width: 52px;
  height: 6px;
  border-radius: 999px;
  background: #d4cec3;
  margin: 4px auto 14px;
}

.bt-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 16px;
}

.bt-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bt-sheet-position-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}

/* Responsive */

@media (max-width: 1100px) {
  .bt-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .bt-grid-row,
  .bt-form-grid {
    grid-template-columns: 1fr;
  }

  .bt-form-grid {
    padding: 14px;
  }

  .bt-header {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .bt-header,
  .bt-report-head,
  .f-header,
  .bt-card-head-inline {
    flex-direction: column;
  }

  .bt-admin-shell {
    padding-right: 0;
  }

  .bt-tabs {
    gap: 10px;
  }

  .bt-tab-btn {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
  }
}

@media (max-width: 782px) {
  .bt-chip-wrap-assignments {
    gap: 8px;
  }

  .bt-chip-assign {
    width: 100%;
    justify-content: space-between;
    padding: 8px 6px 8px 10px;
  }

  .bt-move-panel .bt-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .bt-move-panel .bt-actions .bt-btn {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .bt-frontend-wrap {
    margin: 20px auto 42px;
    padding: 0 12px;
  }

  .bt-card {
    padding: 20px;
    border-radius: 20px;
  }

  .bt-ranking-item {
    grid-template-columns: 1fr;
  }

  .bt-ranking-actions {
    width: 100%;
    justify-content: stretch;
  }

  .bt-ranking-actions .bt-btn {
    flex: 1 1 calc(33.333% - 6px);
  }

  .bt-kpi-grid,
  .bt-slot-grid,
  .bt-sheet-actions,
  .bt-sheet-position-row {
    grid-template-columns: 1fr;
  }

  .bt-table-entries {
    table-layout: auto;
  }

  .bt-table-entries th,
  .bt-table-entries td {
    padding: 8px;
  }

  .bt-table-entries .bt-btn.small {
    width: auto;
  }

  .bt-slot-row,
  .bt-acc-head {
    grid-template-columns: 1fr;
  }

  .bt-sub-accordion-summary {
    grid-template-columns: 1fr 18px;
  }

  .bt-entry-summary-side {
    grid-column: 1 / -1;
    font-size: 12px;
  }

  .bt-acc-meta {
    white-space: normal;
  }

  .bt-tab-panels {
    padding: 14px;
  }

  .bt-sheet {
    max-width: none;
  }

  .bt-entry-toolbar,
  .bt-entry-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .bt-entry-toolbar-actions {
    margin-left: 0;
  }

  .bt-entry-search-group {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .bt-entry-search-group input,
  .bt-entry-toolbar-actions .bt-btn,
  .bt-tab-btn {
    width: 100%;
  }

  .bt-headline {
    flex-direction: column;
    align-items: flex-start;
  }
  /* =========================================================
   Status-Markierung Anmeldungen
   für:
   - Nicht zugeteilt
   - Teilweise zugeteilt
   - Vollständig zugeteilt
   ========================================================= */

	.bt-chip.bt-status-none {
	  background: var(--danger-soft);
	  color: #8a1f1f;
	  border-color: #f0b8b8;
	  font-weight: 700;
	}

	.bt-chip.bt-status-partial {
	  background: var(--warning-soft);
	  color: #805500;
	  border-color: #ead39c;
	  font-weight: 700;
	}

	.bt-chip.bt-status-full {
	  background: var(--success-soft);
	  color: #145322;
	  border-color: #7ac48a;
	  font-weight: 700;
	}

	/* farblicher Akzent für komplette Accordion-Zeile */
	.bt-acc-item:has(.bt-acc-head.bt-status-none) {
	  border-color: #e6aaaa;
	}

	.bt-acc-item:has(.bt-acc-head.bt-status-partial) {
	  border-color: #e3c36b;
	}

	.bt-acc-item:has(.bt-acc-head.bt-status-full) {
	  border-color: #8fc89a;
	}

	.bt-acc-head.bt-status-none {
	  background: linear-gradient(180deg, #fff1f1 0%, #fdecec 100%);
	}

	.bt-acc-head.bt-status-none:hover,
	.bt-acc-head.bt-status-none.is-open {
	  background: linear-gradient(180deg, #ffe8e8 0%, #f9dede 100%);
	}

	.bt-acc-head.bt-status-partial {
	  background: linear-gradient(180deg, #fff9ee 0%, #fff4e5 100%);
	}

	.bt-acc-head.bt-status-partial:hover,
	.bt-acc-head.bt-status-partial.is-open {
	  background: linear-gradient(180deg, #fff4df 0%, #fdecc8 100%);
	}

	.bt-acc-head.bt-status-full {
	  background: linear-gradient(180deg, #f2fbf3 0%, #edf7ee 100%);
	}

	.bt-acc-head.bt-status-full:hover,
	.bt-acc-head.bt-status-full.is-open {
	  background: linear-gradient(180deg, #e9f6eb 0%, #dff0e2 100%);
	}

	/* optional: Status-Chip im Header optisch etwas nach rechts ausrichten */
	.bt-acc-head .bt-chip.bt-status-none,
	.bt-acc-head .bt-chip.bt-status-partial,
	.bt-acc-head .bt-chip.bt-status-full {
	  justify-self: end;
	}

	/* mobil: Chip soll unter Titel/Meta sauber umbrechen */
	@media (max-width: 680px) {
	  .bt-acc-head .bt-chip.bt-status-none,
	  .bt-acc-head .bt-chip.bt-status-partial,
	  .bt-acc-head .bt-chip.bt-status-full {
		justify-self: start;
	  }
	}
}