/* Aktive Gestaltung der Jugendfeuerwehr-Oberflaeche. Abhaengigkeiten: jugendfeuerwehr.php und jugendfeuerwehr_v5.js. */
/* Reset */
[hidden], .is-hidden {
  display: none !important;
}

html {
  background: #f8fafc;
}

.jf-body {
  --jf-bg: #f8fafc;
  --jf-surface: #ffffff;
  --jf-surface-soft: #f1f5f9;
  --jf-border: #e2e8f0;
  --jf-text: #0f172a;
  --jf-muted: #64748b;
  --jf-primary: #d32f2f;
  --jf-primary-hover: #b71c1c;
  --jf-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --jf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  background: var(--jf-bg);
  color: var(--jf-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.jf-body.jf-dark {
  --jf-bg: #0b0f19;
  --jf-surface: #151d2c;
  --jf-surface-soft: #1e293b;
  --jf-border: #293548;
  --jf-text: #f1f5f9;
  --jf-muted: #94a3b8;
  --jf-primary: #ef4444;
  --jf-primary-hover: #dc2626;
  --jf-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --jf-shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.55);
  background: var(--jf-bg);
  color: var(--jf-text);
}

.jf-dark {
  background: #0b0f19;
}

.jf-app-header .header-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Logo links | Datum + Uhrzeit exakt mittig | Aktionen rechts */
.jf-app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.jf-app-header .jf-header-actions {
  justify-self: end;
}

@media (max-width: 768px) {
  .jf-app-header {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .jf-app-header .time-display {
    order: -1;
  }

  .jf-app-header .jf-header-actions {
    justify-self: center;
    justify-content: center;
  }
}

.jf-app-header h1 {
  font-size: 1.35rem;
  margin: 0;
}

.jf-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.jf-user-chip {
  display: inline-flex;
  align-items: center;
  height: 38px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1;
  vertical-align: middle;
  backdrop-filter: blur(4px);
}

.jf-header-actions .jf-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  box-sizing: border-box;
  padding: 0;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
  border-radius: 8px;
  color: #fff;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.jf-header-actions .jf-btn-icon:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.25);
}

.jf-header-actions .jf-btn-icon svg {
  display: block;
  pointer-events: none;
  stroke: currentColor;
}

.jf-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 20px;
  color: var(--jf-text);
}

.jf-auth-view {
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: center;
}

.jf-auth-card,
.jf-toolbar,
.jf-panel,
.jf-modal-card {
  background: var(--jf-surface);
  border: 1px solid var(--jf-border);
  border-radius: 12px;
  box-shadow: var(--jf-shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.jf-auth-card {
  width: min(420px, 100%);
  padding: 28px;
}

.jf-auth-card h2,
.jf-toolbar h2,
.jf-panel h2,
.jf-modal-card h2 {
  color: var(--primary);
  margin: 0 0 6px;
}

.jf-auth-card p,
.jf-toolbar p,
.jf-panel p,
.jf-hint,
.jf-muted {
  color: var(--jf-muted);
}

.jf-toolbar,
.jf-panel-head,
.jf-actions,
.jf-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.jf-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.jf-toolbar,
.jf-panel {
  padding: 18px;
  margin-bottom: 16px;
}

/* Navigation: Pill Bar Styling */
body .main-nav[hidden],
body .nav-toggle[hidden],
body .main-nav .nav-item[hidden],
body .main-nav:hover .nav-item[hidden] {
  display: none !important;
}

.jf-body .main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--jf-surface);
  border-bottom: 1px solid var(--jf-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.jf-body .main-nav .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--jf-muted);
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.jf-body .main-nav .nav-item:hover {
  color: var(--jf-text);
  background: var(--jf-surface-soft);
  transform: translateY(-1px);
}

.jf-body .main-nav .nav-item.is-active,
.jf-body .main-nav .nav-item.active {
  color: #fff !important;
  background: var(--jf-primary) !important;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.32);
}

.jf-body.jf-dark .main-nav {
  background: rgba(21, 29, 44, 0.92);
  border-bottom-color: var(--jf-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.jf-body.jf-dark .nav-toggle {
  background: #151d2c;
  border: 1px solid var(--jf-border);
  color: var(--jf-text);
}

.jf-view {
  display: none;
}

.jf-view.is-active {
  display: block;
}

.jf-grid,
.jf-grid-2 {
  display: grid;
  gap: 14px;
}

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

.jf-grid-2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.jf-stack {
  display: grid;
  gap: 12px;
}

.jf-full {
  grid-column: 1 / -1;
}

.jf-form label,
.jf-stack label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.jf-form input,
.jf-form select,
.jf-form textarea,
.jf-stack input,
.jf-stack select,
.jf-stack textarea,
.jf-inline-form input,
.jf-inline-form select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1.5px solid var(--jf-border);
  border-radius: 8px;
  background: var(--jf-surface);
  color: var(--jf-text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jf-controls input[type="search"],
.jf-controls input {
  width: 220px;
  min-width: 150px;
  max-width: 260px;
  min-height: 34px;
  height: 34px;
  padding: 5px 12px;
  border: 1.5px solid var(--jf-border);
  border-radius: 7px;
  background: var(--jf-surface);
  color: var(--jf-text);
  font: inherit;
  font-size: 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jf-controls select {
  width: auto;
  min-width: 120px;
  min-height: 34px;
  height: 34px;
  padding: 4px 10px;
  border: 1.5px solid var(--jf-border);
  border-radius: 7px;
  background: var(--jf-surface);
  color: var(--jf-text);
  font: inherit;
  font-size: 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jf-controls .btn {
  min-height: 34px;
  height: 34px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 7px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.jf-controls .jf-file-button {
  min-height: 34px;
  height: 34px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.jf-form input:focus,
.jf-form select:focus,
.jf-form textarea:focus,
.jf-stack input:focus,
.jf-stack select:focus,
.jf-stack textarea:focus,
.jf-controls input:focus,
.jf-controls select:focus,
.jf-inline-form input:focus,
.jf-inline-form select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.jf-table-sort {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.jf-table-sort:hover {
  color: var(--jf-primary);
}

.jf-form select[multiple] {
  min-height: 110px;
}

.jf-form textarea,
.jf-stack textarea {
  min-height: 92px;
  resize: vertical;
}

.jf-check {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.jf-check input {
  width: auto;
  min-height: 0;
}

.jf-column-picker,
.jf-permission-grid,
.jf-chip-list,
.jf-inline-form {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.jf-column-picker {
  margin: 12px 0;
  padding: 12px;
  border: 1px dashed var(--jf-border);
  border-radius: 6px;
  background: var(--jf-surface-soft);
}

.jf-permission-grid {
  margin: 10px 0 16px;
}

.jf-permission-grid label {
  padding: 8px 10px;
  border: 1px solid var(--jf-border);
  border-radius: 6px;
  background: var(--jf-surface-soft);
}

.jf-issued-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--jf-border);
  border-radius: 8px;
  background: var(--jf-surface-soft);
}

.jf-issued-box h3,
.jf-panel h3,
.jf-modal-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.jf-service-list {
  display: grid;
  gap: 12px;
}

.jf-service-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: flex-start;
  padding: 12px 16px;
  border: 1px solid var(--jf-border);
  border-left: 4px solid var(--jf-primary);
  border-radius: 10px;
  background: var(--jf-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.jf-service-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.jf-service-card.is-archived {
  opacity: .72;
  border-left-color: #777;
  filter: grayscale(0.5);
}

.jf-service-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.jf-service-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.jf-role-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.jf-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  letter-spacing: 0.01em;
}

.jf-role-tag small {
  font-size: 0.72rem;
  opacity: 0.85;
}

.jf-role-responsible { background: #2563eb; } /* Blau */
.jf-role-supervisor { background: #16a34a; } /* Grün */
.jf-role-tentative { background: #7c3aed; } /* Violett: Anmeldung unter Vorbehalt */
.jf-role-driver { background: #d97706; color: #fff; } /* Amber/Orange */
.jf-role-vehicle { background: #0284c7; } /* Cyan/Sky Blau */

.jf-service-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--jf-surface-soft);
  border: 1px solid var(--jf-border);
  font-size: 0.78rem;
  line-height: 1.3;
  margin-bottom: 3px;
}

.jf-service-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2px 0 2px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.jf-service-topic {
  font-weight: 500;
  color: var(--jf-muted);
  margin: 0 0 4px;
  font-size: 0.86rem;
  line-height: 1.35;
}

.jf-service-card h3 {
  margin: 0 0 2px;
}

.jf-service-id-badge {
  display: inline-block;
  padding: 1.5px 6px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.14);
  color: inherit;
  margin-right: 6px;
  vertical-align: middle;
}

.jf-dark .jf-service-id-badge {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.jf-service-note-box {
  margin-top: 7px;
  padding: 6px 10px;
  background: #fefce8;
  border: 1px solid #fef08a;
  border-left: 3px solid #eab308;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #713f12;
  word-break: break-word;
}

.jf-body.jf-dark .jf-service-note-box,
.jf-dark .jf-service-note-box {
  background: rgba(234, 179, 8, 0.09);
  border-color: rgba(234, 179, 8, 0.22);
  border-left-color: #eab308;
  color: #fef08a;
}

.jf-service-note-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
  color: #ca8a04;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.jf-body.jf-dark .jf-service-note-title,
.jf-dark .jf-service-note-title {
  color: #facc15;
}

.jf-service-note-text {
  line-height: 1.35;
  white-space: pre-wrap;
  font-size: 0.82rem;
}

.jf-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  align-self: flex-start;
  min-width: 180px;
}

.jf-card-actions:empty {
  display: none;
}

.jf-card-actions .btn {
  padding: 5px 11px;
  font-size: 0.82rem;
  border-radius: 6px;
  min-height: 32px;
  line-height: 1.25;
}

.jf-status,
.jf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: rgba(211,47,47,.12);
  color: var(--primary);
  padding: 4px 9px;
  font-weight: 800;
  font-size: .85rem;
}

.jf-chip small {
  color: var(--jf-muted);
  font-weight: 700;
}

.jf-attendance-summary-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.jf-summary-blob {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.jf-bg-present { background-color: #2e7d32; }
.jf-bg-excused { background-color: #fbc02d; color: #000; }
.jf-bg-unexcused { background-color: #c62828; }
.jf-bg-guest { background-color: #8e24aa; }

.jf-reminder-push {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--jf-border);
}

.jf-reminder-message {
  min-height: 1.4em;
  margin: 12px 0 4px;
  color: var(--jf-muted);
  font-size: 0.92rem;
}

.jf-reminder-message.is-error {
  color: #b71c1c;
  font-weight: 600;
}

.jf-code {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.jf-file-button {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.jf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.jf-import-table {
  max-height: 55vh;
  overflow: auto;
  margin: 12px 0;
}

.jf-import-table .jf-import-notes {
  white-space: pre-line;
  min-width: 220px;
}

.jf-import-table .jf-import-skip {
  opacity: .55;
}

.jf-excused-until {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--jf-border);
  font-size: 0.9rem;
}

.jf-excused-until[hidden] {
  display: none;
}

.jf-excused-until small {
  color: var(--jf-muted);
}

.jf-attendance-guest-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  margin-top: 8px;
  border: 1px solid var(--jf-border);
  border-radius: 6px;
  background: var(--jf-surface-soft);
}

.jf-attendance-guest-row input[type="number"] {
  width: 80px;
}

.jf-summary-slash {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--jf-muted);
  transform: rotate(10deg);
  display: inline-block;
  line-height: 1;
}

.jf-no-attendance {
  color: #b71c1c;
  font-weight: 700;
  font-size: 0.9rem;
  background: #ffebee;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ffcdd2;
  display: inline-block;
  margin-top: 12px;
}

.jf-select-search {
  margin-bottom: 5px;
  font-size: 0.85rem !important;
  min-height: 32px !important;
}

/* Custom Multi-Select Dropdown */
.jf-multi-select {
  position: relative;
  border: 1px solid var(--jf-border);
  border-radius: 6px;
  background: var(--jf-surface);
  padding: 5px;
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  cursor: text;
}

.jf-multi-select:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

.jf-ms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.jf-ms-chip {
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.jf-ms-chip-label {
  display: grid;
  gap: 1px;
  line-height: 1.2;
}

.jf-ms-chip-label small {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.9;
}

.jf-ms-chip-remove {
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.jf-ms-input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  flex: 1;
  min-width: 60px;
  padding: 2px 5px !important;
  min-height: 28px !important;
  box-shadow: none !important;
}

.jf-ms-dropdown {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  background: var(--jf-surface);
  border: 1px solid var(--jf-border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.jf-ms-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  min-height: 36px;
  box-sizing: border-box;
  color: var(--jf-text, inherit);
}

.jf-ms-option:hover {
  background: var(--jf-surface-soft);
  color: var(--primary);
}

.jf-ms-option.is-selected {
  background: var(--jf-surface-soft);
  opacity: 0.5;
  cursor: default;
}

.jf-ms-option.is-hidden {
  display: none;
}

.jf-attendance-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.jf-attendance-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) repeat(4, auto);
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--jf-border);
  border-radius: 6px;
  background: var(--jf-surface-soft);
}

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

.jf-stat-box {
  border: 1px solid var(--jf-border);
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
}

.jf-stat-wide {
  grid-column: 1 / -1;
}

.jf-calendar-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.jf-calendar-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--jf-border);
}

.jf-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 18px;
}
.jf-modal.is-open {
  display: grid;
  animation: jfModalBackdrop 0.18s ease-out;
}

#randomizer-modal {
  z-index: 1200;
}

.jf-modal-card {
  width: min(760px, 100%);
  max-height: min(92vh, 980px);
  overflow: auto;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  animation: jfModalSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes jfModalBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes jfModalSlideIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.jf-modal-wide {
  width: min(1040px, 100%);
}

.jf-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.jf-icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--jf-border);
  border-radius: 6px;
  background: var(--jf-surface-soft);
  color: var(--jf-text);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.jf-note-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.jf-note {
  border: 1px solid var(--jf-border);
  border-radius: 8px;
  padding: 12px;
  background: var(--jf-surface-soft);
}

.jf-media-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.jf-media-list img {
  width: 120px;
  height: 84px;
  object-fit: cover;
  border: 1px solid var(--jf-border);
  border-radius: 6px;
}

.jf-alert {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 1px solid var(--jf-border);
  background: var(--jf-surface);
  font-weight: 800;
}

.jf-alert-danger {
  color: #b71c1c;
  background: #ffebee;
  border-color: #ffcdd2;
}

.jf-alert-success {
  color: #1b5e20;
  background: #e8f5e9;
  border-color: #c8e6c9;
}

.jf-body.jf-dark .table-container,
.jf-body.jf-dark .data-table th {
  background: var(--jf-surface);
}

.jf-body.jf-dark .data-table th {
  color: var(--jf-text);
}

.jf-body.jf-dark .data-table td {
  border-bottom-color: var(--jf-border);
}

.jf-body.jf-dark .data-table tr:hover {
  background: var(--jf-surface-soft);
}

.jf-body.jf-dark .no-data {
  color: var(--jf-muted);
}

@media (max-width: 900px) {
  .jf-grid,
  .jf-grid-2,
  .jf-stats {
    grid-template-columns: 1fr;
  }

  .jf-service-card {
    grid-template-columns: 1fr;
  }

  .jf-card-actions {
    min-width: 0;
    justify-content: flex-start;
  }

  .jf-attendance-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .jf-shell {
    padding: 12px;
  }

  .jf-header-actions,
  .jf-controls,
  .jf-actions,
  .jf-inline-form {
    align-items: stretch;
  }

  .jf-header-actions > *,
  .jf-controls > *,
  .jf-actions > *,
  .jf-inline-form > * {
    flex: 1 1 100%;
  }

  .jf-modal {
    padding: 8px;
  }
}

/* Member Issued Items Categorization & Styling */
.jf-item-section {
  margin-top: 24px;
  background: var(--jf-surface-soft);
  border: 1px solid var(--jf-border);
  border-radius: 8px;
  overflow: hidden;
}

.jf-item-section-header {
  background: var(--jf-border);
  padding: 8px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jf-item-section-header h4 {
  margin: 0;
  color: var(--jf-text);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.jf-badge {
  background: var(--jf-surface);
  color: var(--jf-text);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.jf-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px; /* Divider effect */
  background: var(--jf-border);
}

.jf-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--jf-surface);
  padding: 10px 15px;
  transition: background 0.2s ease;
}

.jf-item-row:hover {
  background: var(--jf-surface-soft);
}

.jf-item-row.is-active {
  background: #fff9c4; /* Subtle yellow highlight */
}

.jf-body.jf-dark .jf-item-row.is-active {
  background: #3e3a1f;
}

.jf-item-row .jf-check {
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.jf-item-date-wrap {
  flex-shrink: 0;
}

.jf-item-date {
  width: 140px;
  height: 34px !important;
  font-size: 0.85rem !important;
  padding: 4px 8px !important;
  border: 1px solid var(--jf-border);
  border-radius: 4px;
  background: var(--jf-surface);
  color: var(--jf-text);
}

.jf-item-date:disabled {
  opacity: 0.3;
  background: var(--jf-surface-soft);
  cursor: not-allowed;
}

/* ======= STATS DASHBOARD GRID ======= */
.jf-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  grid-column: 1 / -1; /* Volle Breite nutzen */
}

.jf-stat-box {
  background: var(--jf-surface);
  border: 1px solid var(--jf-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.jf-stat-wide {
  grid-column: 1 / -1;
}

.jf-stat-chart {
  min-height: 360px;
}

@media (max-width: 900px) {
  .jf-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .jf-stats-grid { grid-template-columns: 1fr; }
}

/* ======= HERO HEADER ======= */
.jf-stats-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 16px;
  margin-bottom: 24px;
  color: #fff;
}

.jf-stats-hero-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.jf-stats-hero-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.jf-stats-hero h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
}

.jf-stats-hero-sub {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
}

.jf-stats-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ======= KPI CARDS ======= */
.jf-stats-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.jf-kpi-card {
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.14);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jf-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
}

.jf-kpi-youth      { background: linear-gradient(135deg, #ef5350, #c62828); }
.jf-kpi-joins      { background: linear-gradient(135deg, #66bb6a, #2e7d32); }
.jf-kpi-exits      { background: linear-gradient(135deg, #ff7043, #d84315); }
.jf-kpi-duration   { background: linear-gradient(135deg, #7b1fa2, #4a148c); }
.jf-kpi-services   { background: linear-gradient(135deg, #00897b, #004d40); }
.jf-kpi-warn       { background: linear-gradient(135deg, #f57c00, #bf360c); }
.jf-kpi-ok         { background: linear-gradient(135deg, #388e3c, #1b5e20); }

.jf-kpi-double {
  grid-column: span 2;
}

.jf-kpi-fluctuation {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.jf-kpi-double-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
}

.jf-kpi-double-icon {
  font-size: 1.4rem;
}

.jf-kpi-double-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.jf-kpi-double-content {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  flex-grow: 1;
}

.jf-kpi-split-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.jf-kpi-split-value {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.jf-kpi-split-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.8);
}

.jf-kpi-split-divider {
  width: 1px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 600px) {
  .jf-kpi-double {
    grid-column: span 1;
  }
  .jf-kpi-double-content {
    flex-direction: column;
    gap: 12px;
  }
  .jf-kpi-split-divider {
    width: 80%;
    height: 1px;
  }
}

.jf-kpi-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
  line-height: 1;
}

.jf-kpi-value {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}

.jf-kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  opacity: 0.9;
}

/* ======= STAT BOX HEADER ======= */
.jf-stat-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--jf-border);
}

.jf-stat-box-icon { font-size: 1.3rem; line-height: 1; }

.jf-stat-box-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--jf-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.jf-section-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}

.jf-badge-warn { background: #fff3e0; color: #e65100; }
.jf-badge-ok   { background: #e8f5e9; color: #2e7d32; }
.jf-body.jf-dark .jf-badge-warn { background: rgba(230,81,0,0.2); color: #ffb74d; }
.jf-body.jf-dark .jf-badge-ok   { background: rgba(46,125,50,0.2); color: #81c784; }

/* ======= STATUS BADGES ======= */
.jf-status-badge-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.jf-status-badge {
  background: var(--jf-surface-soft);
  border: 1px solid var(--jf-border);
  border-radius: 12px;
  padding: 14px 20px;
  text-align: center;
  min-width: 90px;
  transition: transform 0.2s;
}

.jf-status-badge:hover { transform: scale(1.04); }

.jf-status-badge-count {
  font-size: 2rem;
  font-weight: 800;
  color: var(--jf-primary);
  line-height: 1;
}

.jf-status-badge-label {
  font-size: 0.78rem;
  color: var(--jf-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ======= MISSING DOCS ======= */
.jf-missing-tag {
  display: inline-block;
  background: #fce4e4;
  color: #c62828;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 2px;
}

.jf-body.jf-dark .jf-missing-tag {
  background: rgba(198,40,40,0.2);
  color: #ef9a9a;
}

.jf-success-msg {
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 10px;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 1rem;
}

.jf-body.jf-dark .jf-success-msg {
  background: rgba(46,125,50,0.15);
  color: #a5d6a7;
}

/* ======= EXAMS ======= */
.jf-exams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 680px) { .jf-exams-grid { grid-template-columns: 1fr; } }

.jf-exam-col h4 { margin: 0 0 12px 0; font-size: 0.95rem; font-weight: 700; }

.jf-exam-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jf-exam-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.jf-exam-badge {
  display: inline-block;
  background: #e3f2fd;
  color: #1565c0;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.jf-exam-passed { background: #e8f5e9; color: #2e7d32; }
.jf-body.jf-dark .jf-exam-badge  { background: rgba(21,101,192,0.2); color: #90caf9; }
.jf-body.jf-dark .jf-exam-passed { background: rgba(46,125,50,0.2); color: #a5d6a7; }

/* ======= PROGRESS BAR (premium) ======= */
.jf-progress-bar {
  background: var(--jf-border);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  width: 100px;
  display: inline-block;
  vertical-align: middle;
}

.jf-progress-fill {
  background: var(--jf-primary);
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.jf-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jf-prog-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--jf-text);
  min-width: 36px;
}

.jf-prog-good { background: linear-gradient(90deg, #43a047, #66bb6a) !important; }
.jf-prog-mid  { background: linear-gradient(90deg, #fb8c00, #ffa726) !important; }
.jf-prog-low  { background: linear-gradient(90deg, #e53935, #ef5350) !important; }

/* ======= PREMIUM TABLE ======= */
.jf-premium-table thead th {
  background: var(--jf-surface-soft);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.jf-premium-table tbody tr:hover td {
  background: var(--jf-surface-soft);
  transition: background 0.15s;
}

/* ======= HEATMAP ======= */
.jf-heatmap-table {
  border-collapse: separate;
  border-spacing: 3px;
  width: max-content;
}

.jf-heatmap-table th {
  background: transparent;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  padding: 5px 2px;
  color: var(--jf-text);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 80px;
  border: none;
}

.jf-heatmap-table td {
  padding: 5px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
  border: none;
}

.jf-heatmap-table td[class^="jf-heat-"] {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 5px;
  cursor: help;
  transition: transform 0.1s;
}

.jf-heatmap-table td[class^="jf-heat-"]:hover {
  transform: scale(1.3);
  z-index: 1;
  position: relative;
}

.jf-heat-present   { background-color: #4caf50; }
.jf-heat-excused   { background-color: #ffca28; }
.jf-heat-unexcused { background-color: #f44336; }
.jf-heat-empty     { background-color: var(--jf-border); }

.jf-heatmap-legend {
  margin-top: 16px;
  display: flex;
  gap: 20px;
  font-size: 0.88rem;
  color: var(--jf-text);
  flex-wrap: wrap;
  align-items: center;
}

.jf-heat-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 5px;
}

/* ======= RANDOMIZER ======= */
.jf-randomizer-machine {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 8px;
}

.jf-randomizer-reel {
  min-height: 112px;
  border-radius: 18px;
  background: linear-gradient(180deg, #1f2430 0%, #0f131a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 30px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.jf-randomizer-reel::before,
.jf-randomizer-reel::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 18px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.24), transparent);
  opacity: 0.55;
}

.jf-randomizer-reel::before { top: 10px; }
.jf-randomizer-reel::after { bottom: 10px; transform: rotate(180deg); }

.jf-randomizer-name {
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  color: #ffffff;
  letter-spacing: 0.01em;
  padding: 0 10px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  animation: jf-randomizer-flicker 0.14s linear infinite;
}

.jf-randomizer-reel.is-stopped .jf-randomizer-name {
  animation: none;
  color: #ffe082;
}

.jf-randomizer-image {
  display: block;
  width: min(320px, 100%);
  margin: 18px auto 0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

@keyframes jf-randomizer-flicker {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-1px); opacity: 0.84; }
}

@media (max-width: 900px) {
  .jf-randomizer-machine {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ---- Erinnerungsregeln und Nachrichten an Benutzer ---- */
.jf-rule-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}

.jf-rule-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--jf-border);
  border-radius: 6px;
  background: var(--jf-surface-soft);
}

.jf-rule-row.is-off .jf-rule-label {
  color: var(--jf-muted);
  text-decoration: line-through;
}

.jf-rule-label {
  flex: 1;
  font-weight: 700;
}

.jf-rule-row .jf-check {
  font-weight: 600;
}

.jf-rule-empty {
  color: var(--jf-muted);
  font-size: 0.92rem;
}

.jf-rule-add {
  align-items: center;
}

.jf-rule-add input {
  width: 90px;
  flex: 0 0 auto;
}

.jf-rule-add select {
  width: auto;
  flex: 0 0 auto;
}

.jf-rule-add-text {
  color: var(--jf-muted);
}

.jf-recipient-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px 12px;
  max-height: 260px;
  overflow: auto;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--jf-border);
  border-radius: 6px;
  background: var(--jf-surface-soft);
}

.jf-recipient-list .jf-check {
  font-weight: 600;
  align-items: flex-start;
}

.jf-recipient-meta {
  display: block;
  color: var(--jf-muted);
  font-size: 0.8rem;
  font-weight: 400;
}


/* ======= VERLETZUNGSBUCH ======= */
.jf-injury-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.jf-injury-card {
  position: relative;
  background: var(--jf-surface);
  border: 1px solid var(--jf-border);
  border-left: 4px solid var(--jf-primary);
  border-radius: 10px;
  padding: 12px 14px 10px;
  box-shadow: var(--jf-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.jf-injury-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.jf-injury-name {
  font-size: 1rem;
  color: var(--jf-text);
}

.jf-injury-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--jf-muted);
  white-space: nowrap;
}

.jf-injury-service {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--jf-muted);
  background: var(--jf-surface-soft);
  border: 1px solid var(--jf-border);
  border-radius: 999px;
  padding: 2px 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jf-injury-block p {
  margin: 2px 0 0;
  color: var(--jf-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.jf-injury-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--jf-muted);
}

.jf-injury-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--jf-border);
  font-size: 0.76rem;
  color: var(--jf-muted);
}

.jf-injury-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 12px;
  color: var(--jf-muted);
}

@media (min-width: 721px) {
  #injury-search {
    width: 260px;
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .jf-injury-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}


/* ======= MOBILE-OPTIMIERUNG (Smartphone) =======
   Kompakter Header, Icon-Leiste statt gestapelter Vollbreite-Buttons,
   Tab-Leiste statt Hamburger-Menue, Vollbild-Dialoge. Bewusst am Dateiende,
   damit diese Regeln die aelteren 720px-/768px-Regeln ueberschreiben. */
@media (max-width: 720px) {
  /* --- Header: 2 Zeilen (Logo + Uhrzeit / Benutzer + Icon-Buttons) --- */
  .jf-app-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo time"
      "actions actions";
    align-items: center;
    justify-items: stretch;
    gap: 8px 10px;
    padding: 8px 12px 10px;
    text-align: left;
  }

  .jf-app-header .header-title {
    grid-area: logo;
    min-width: 0;
  }

  .jf-app-header .header-logo {
    max-width: 150px;
    max-height: 30px;
    width: auto;
    height: auto !important;
    display: block;
  }

  .jf-app-header .time-display {
    grid-area: time;
    order: 0;
    text-align: right;
    line-height: 1.15;
  }

  .jf-app-header #current-date {
    font-size: 0.72rem;
    opacity: 0.85;
  }

  .jf-app-header #current-time {
    font-size: 1.25rem;
    font-weight: 700;
  }

  .jf-app-header .jf-header-actions {
    grid-area: actions;
    justify-self: stretch;
    justify-content: flex-end;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }

  /* Ueberschreibt die alte Regel "alle Kinder 100% breit" */
  .jf-app-header .jf-header-actions > * {
    flex: 0 0 auto;
  }

  .jf-app-header .jf-user-chip {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    height: 36px;
    padding: 0 10px;
    font-size: 0.82rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 34px;
  }

  .jf-app-header .jf-user-chip:not([hidden]) {
    display: block !important;
  }

  .jf-app-header .jf-header-actions .jf-btn-icon {
    width: 40px;
    height: 36px;
    min-height: 36px;
    border-radius: 10px;
  }

  .jf-app-header .jf-header-actions .jf-btn-icon svg {
    width: 19px;
    height: 19px;
  }

  /* --- Navigation: horizontal scrollbare Tab-Leiste statt Hamburger --- */
  body.jf-body .nav-toggle {
    display: none !important;
  }

  body.jf-body .main-nav,
  body.jf-body .main-nav:hover {
    display: flex !important;
    flex-direction: row;
    justify-content: flex-start;
    align-items: stretch;
    height: auto !important;
    max-height: none !important;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 6px 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.jf-body .main-nav::-webkit-scrollbar {
    display: none;
  }

  body.jf-body .main-nav .nav-item,
  body.jf-body .main-nav:hover .nav-item {
    display: inline-flex !important;
    flex: 1 0 auto;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    padding: 9px 14px;
    min-height: 40px;
    font-size: 0.85rem;
    border: 1px solid transparent;
    border-top: 1px solid transparent;
  }

  body .main-nav .nav-item[hidden],
  body .main-nav:hover .nav-item[hidden] {
    display: none !important;
  }

  /* --- Inhalt --- */
  .jf-shell {
    padding: 10px 10px 24px;
  }

  .jf-toolbar,
  .jf-panel {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .jf-panel h2,
  .jf-toolbar h2 {
    font-size: 1.15rem;
    margin-bottom: 2px;
  }

  .jf-panel-head {
    gap: 10px;
    margin-bottom: 8px;
  }

  .jf-panel-head > div:first-child {
    flex: 1 1 100%;
  }

  /* Steuerleiste: Suche volle Breite, Buttons 2-spaltig nebeneinander */
  .jf-panel-head .jf-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    align-items: stretch;
  }

  .jf-panel-head .jf-controls > * {
    flex: none;
    min-width: 0;
    width: 100%;
    margin: 0;
  }

  .jf-panel-head .jf-controls > input[type="search"],
  .jf-panel-head .jf-controls > select,
  .jf-panel-head .jf-controls > .jf-check {
    grid-column: 1 / -1;
  }

  .jf-panel-head .jf-controls .btn {
    justify-content: center;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
  }

  /* 16px verhindert das automatische Hineinzoomen auf iOS */
  .jf-body input,
  .jf-body select,
  .jf-body textarea {
    font-size: 16px;
  }

  .jf-body .table-container {
    margin: 0 -4px;
    border-radius: 8px;
  }

  .jf-body .data-table th,
  .jf-body .data-table td {
    padding: 9px 10px;
    font-size: 0.88rem;
  }

  /* --- Dialoge als Vollbild-Sheet --- */
  .jf-modal {
    padding: 0;
    align-items: end;
  }

  .jf-modal-card,
  .jf-modal-wide {
    width: 100%;
    max-height: 96dvh;
    padding: 16px 14px 20px;
    border-radius: 16px 16px 0 0;
  }

  .jf-modal-head {
    position: sticky;
    top: -16px;
    z-index: 2;
    margin: -16px -14px 12px;
    padding: 12px 14px;
    background: var(--jf-surface);
    border-bottom: 1px solid var(--jf-border);
  }
}

@media (max-width: 380px) {
  .jf-app-header .jf-user-chip {
    display: none !important;
  }

  .jf-app-header .jf-header-actions {
    justify-content: space-between;
  }

  .jf-app-header .jf-header-actions .jf-btn-icon {
    flex: 1 1 0;
  }
}

/* Instanz-Kennzeichnung im Kopfbereich (Jugendfeuerwehr / Minifeuerwehr) */
.jf-instance-badge {
  display: inline-block;
  margin-left: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  white-space: nowrap;
}

/* ==========================================================================
   Geteilte Dienste & Verknüpfte Dashboards
   ========================================================================== */
.jf-shared-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
  margin-left: 6px;
  vertical-align: middle;
}

body.dark .jf-shared-badge {
  background: rgba(3, 105, 161, 0.25);
  color: #7dd3fc;
  border-color: rgba(3, 105, 161, 0.4);
}

.jf-shared-staff-row {
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(14, 165, 233, 0.06);
  border-left: 3px solid #0284c7;
  border-radius: 0 6px 6px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.dark .jf-shared-staff-row {
  background: rgba(14, 165, 233, 0.1);
  border-left-color: #38bdf8;
}

.jf-shared-staff-header {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 4px;
}

body.dark .jf-shared-staff-header {
  color: #7dd3fc;
}

.jf-role-tag.jf-role-partner {
  background: #f0f9ff;
  color: #0c4a6e;
  border: 1px solid #bae6fd;
}

body.dark .jf-role-tag.jf-role-partner {
  background: rgba(14, 165, 233, 0.18);
  color: #e0f2fe;
  border-color: rgba(14, 165, 233, 0.35);
}

.jf-shared-staff-preview {
  background: var(--jf-surface, #f8f9fa);
  border: 1px dashed #0284c7;
  border-radius: 8px;
  padding: 10px 12px;
}

.jf-linked-dashboards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jf-linked-dashboard-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--jf-surface, #fff);
  border: 1px solid var(--jf-border, #e0e0e0);
  border-radius: 8px;
  flex-wrap: wrap;
}

.jf-linked-dashboard-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 200px;
}

.jf-linked-dashboard-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.jf-linked-dashboard-url {
  font-size: 0.8rem;
  color: var(--jf-muted, #666);
  font-family: monospace;
  word-break: break-all;
}

.jf-linked-dashboard-meta {
  font-size: 0.78rem;
  color: var(--jf-muted, #777);
}

.jf-linked-dashboard-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.jf-status-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.jf-status-pill.is-active {
  background: #dcfce7;
  color: #15803d;
}

.jf-status-pill.is-inactive {
  background: #f1f5f9;
  color: #64748b;
}

body.dark .jf-status-pill.is-active {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

body.dark .jf-status-pill.is-inactive {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}


/* Anwesenheits-Punkte: ausgewählte +1/-1-Schaltfläche mit Kategorie-ähnlichem Glow */
.jf-body .jf-point-btn.is-selected {
  color: #fff !important;
  border-color: currentColor !important;
  transform: translateY(-1px);
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 0 14px currentColor;
  outline: 2px solid currentColor;
  outline-offset: 1px;
}
.jf-body .jf-point-plus.is-selected {
  background: #16834a !important;
  color: #fff !important;
  border-color: #55e69a !important;
  box-shadow: 0 0 0 2px rgba(85,230,154,.22), 0 0 16px rgba(45,220,125,.72);
}
.jf-body .jf-point-minus.is-selected {
  background: #b42332 !important;
  color: #fff !important;
  border-color: #ff7180 !important;
  box-shadow: 0 0 0 2px rgba(255,113,128,.22), 0 0 16px rgba(255,65,85,.7);
}
.jf-body .jf-point-btn:disabled { opacity: .45; box-shadow: none; outline: none; transform: none; }
