* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  /* Kein grauer/blauer Flash-Kasten beim Antippen (Android/iOS). */
  -webkit-tap-highlight-color: transparent;
}

body {
  background: linear-gradient(135deg, #0a0e1a 0%, #050710 100%);
  color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.2s ease;
  font-size: 16px;
  line-height: 1.6;
  /* Schärfere Schrift auf macOS/iOS, kein Auto-Aufblähen bei iOS-Drehung. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

header {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10,14,26,0.7);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

header h1 {
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

nav a {
  color: #e5e7eb;
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
}

nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

nav a.active {
  background: rgba(96,165,250,0.15);
  color: #93c5fd;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.hero {
  background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(147,51,234,0.08) 100%);
  border-radius: 1.5rem;
  padding: 3rem 2.5rem;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(96,165,250,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
}

.hero p {
  margin-bottom: 2rem;
  color: #d1d5db;
  line-height: 1.7;
  font-size: 1rem;
  max-width: 70ch;
  position: relative;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  position: relative;
}

.card {
  padding: 1.75rem;
  border-radius: 1.25rem;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(96,165,250,0.3);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  background: rgba(15,23,42,0.7);
}

.card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.875rem;
  color: #9ca3af;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  flex: 1;
}

.card a.btn {
  align-self: flex-start;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.4);
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.btn:active {
  transform: translateY(0);
}

.section {
  margin-bottom: 4rem;
}

.section h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f9fafb;
}

.section p {
  font-size: 0.9375rem;
  color: #d1d5db;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  max-width: 70ch;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 1.25rem;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

thead {
  background: rgba(59,130,246,0.08);
  transition: background 0.2s ease;
  border-bottom: 2px solid rgba(96,165,250,0.2);
}

th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e5e7eb;
}

td {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.875rem;
  color: #d1d5db;
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(96,165,250,0.08);
}

tbody tr:last-child {
  border-bottom: none;
}

.empty-row {
  text-align: center;
  font-style: italic;
  color: #b3b3b3;
}

.file-list {
  list-style: none;
  margin-top: 0.4rem;
}

.file-list li {
  margin-bottom: 0.25rem;
}

.file-list a {
  color: #9ecbff;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.file-list a:hover {
  text-decoration: underline;
  color: #bcd2ff;
}

footer {
  padding: 1rem 1.5rem 1.2rem 1.5rem;
  font-size: 0.8rem;
  color: #9b9b9b;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

footer .footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.35rem;
}

footer a {
  color: #c9d6e6;
  text-decoration: none;
  border-bottom: 1px solid rgba(201,214,230,0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
}

footer a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

html[data-theme="light"] footer a {
  color: #334155;
  border-bottom-color: rgba(51,65,85,0.35);
}
html[data-theme="light"] footer a:hover {
  color: #0f172a;
  border-bottom-color: #0f172a;
}

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  background: rgba(0,0,0,0.5);
  padding: 0.12rem 0.3rem;
  border-radius: 0.35rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 0.75rem;
  color: #c9e2ff;
  background: rgba(0,0,0,0.35);
  margin-bottom: 0.4rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ---- Navigation Buttons (Theme + Logout) ---- */
header nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

header nav a {
  margin-left: 0.4rem;
}

.nav-spacer {
  flex: 1;
}

.nav-btn {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(7,9,18,0.9);
  color: #f5f5f5;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.15s ease, border-color 0.2s ease;
}

.nav-btn span {
  font-size: 0.9rem;
}

.nav-btn:hover {
  background: rgba(31,96,255,0.85);
}

/* ---- Pills / Labels ---- */
.pill {
  display: inline-flex !important;
  align-items: center !important;
  padding: 0.25rem 0.625rem !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  margin-right: 0.375rem !important;
  margin-bottom: 0.25rem !important;
  background: rgba(0,0,0,0.4) !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
  vertical-align: middle !important;
}

.pill-day {
  border-color: rgba(251, 191, 36, 0.9) !important;
  background: rgba(251, 191, 36, 0.2) !important;
  color: #fbbf24 !important;
}

.pill-type-setup {
  border-color: rgba(59,130,246,0.9) !important;
  background: rgba(59,130,246,0.2) !important;
  color: #60a5fa !important;
}

.pill-type-teardown {
  border-color: rgba(249,115,22,0.9) !important;
  background: rgba(249,115,22,0.2) !important;
  color: #fb923c !important;
}

.pill-type-event {
  border-color: rgba(147,51,234,0.9) !important;
  background: rgba(147,51,234,0.2) !important;
  color: #a78bfa !important;
}

.pill-type-rehearsal {
  border-color: rgba(34,197,94,0.9) !important;
  background: rgba(34,197,94,0.2) !important;
  color: #4ade80 !important;
}

.pill-type-other {
  border-color: rgba(148,163,184,0.9) !important;
  background: rgba(148,163,184,0.2) !important;
  color: #cbd5e1 !important;
}

.pill-postponed {
  border-color: rgba(245,158,11,0.95) !important;
  background: rgba(245,158,11,0.18) !important;
  color: #fbbf24 !important;
  font-weight: 700 !important;
}

.pill-day {
  border-color: rgba(251, 191, 36, 0.9);
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
}

.pill-type-setup {
  border-color: rgba(59,130,246,0.9);
  background: rgba(59,130,246,0.12);
  color: #bfdbfe;
}

.pill-type-teardown {
  border-color: rgba(249,115,22,0.9);
  background: rgba(249,115,22,0.12);
  color: #fed7aa;
}

.pill-type-event {
  border-color: rgba(147,51,234,0.9);
  background: rgba(147,51,234,0.16);
  color: #e9d5ff;
}

.pill-type-rehearsal {
  border-color: rgba(34,197,94,0.9);
  background: rgba(34,197,94,0.12);
  color: #bbf7d0;
}

.pill-type-other {
  border-color: rgba(148,163,184,0.9);
  background: rgba(148,163,184,0.16);
  color: #e5e7eb;
}

/* ---- Events Toolbar ---- */
.events-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.events-toolbar input[type="search"],
.events-toolbar select {
  padding: 0.35rem 0.6rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(5,7,16,0.9);
  color: #f5f5f5;
  font-size: 0.8rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.events-toolbar input[type="search"] {
  flex: 1;
  min-width: 160px;
}

.events-toolbar select {
  min-width: 150px;
}

.events-toolbar input[type="search"]:focus,
.events-toolbar select:focus {
  outline: none;
  border-color: rgba(59,130,246,0.7);
}

/* ---- Past Events ---- */
tr.past-event {
  opacity: 0.55;
}

/* ---- Postponed Events ---- */
#list-view tbody tr.postponed-event {
  position: relative;
  background: rgba(245,158,11,0.08);
  opacity: 0.78;
}

#list-view tbody tr.postponed-event:hover {
  background: rgba(245,158,11,0.12);
}

#list-view tbody tr.postponed-event td {
  position: relative;
  text-decoration-line: line-through;
  text-decoration-thickness: 0.14em;
  text-decoration-color: rgba(251,191,36,0.95);
}

#list-view tbody tr.postponed-event td:first-child {
  border-left: 3px solid rgba(245,158,11,0.95);
}

#list-view tbody tr.postponed-event td::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  top: 50%;
  border-top: 2px solid rgba(251,191,36,0.95);
  pointer-events: none;
  transform: translateY(-50%);
  z-index: 1;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  header {
    padding: 1rem 1.25rem;
  }

  header h1 {
    font-size: 0.875rem;
  }

  nav {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  nav a {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }

  main {
    padding: 2rem 1.25rem;
  }

  .hero {
    padding: 2rem 1.5rem;
    border-radius: 1.25rem;
  }

  .hero h2 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.9375rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .card {
    padding: 1.5rem;
  }

  .section {
    margin-bottom: 3rem;
  }

  .section h2 {
    font-size: 1.5rem;
  }

  table {
    min-width: 500px;
  }

  th, td {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0.875rem 1rem;
  }

  header h1 {
    font-size: 0.8125rem;
  }

  main {
    padding: 1.5rem 1rem;
  }

  .hero {
    padding: 1.5rem 1.25rem;
  }

  .hero h2 {
    font-size: 1.25rem;
  }

  .card {
    padding: 1.25rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===========================
   LIGHT MODE (Unified & Complete)
   =========================== */

html[data-theme="light"] body {
  background: #f3f4ff;
  color: #0f172a;
}
/* Account-Icon im Header (SVG) */
.nav-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
}

.nav-account-icon-svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* leichte Hover-Optik */
.nav-account:hover .nav-account-icon-svg {
  filter: brightness(1.2);
}

/* Anpassung für Dark-Mode */
html[data-theme="dark"] .nav-account-icon-svg {
  filter: brightness(1.3);
}

/* Anpassung für Light-Mode */
html[data-theme="light"] .nav-account-icon-svg {
  filter: invert(0.05);
}

/* Header / Navigation */
html[data-theme="light"] header {
  background: linear-gradient(to right, #e5edff, #f5f7ff);
  border-bottom-color: rgba(15,23,42,0.08);
  box-shadow: 0 8px 20px rgba(148, 163, 184, 0.4);
}

html[data-theme="light"] header h1 {
  color: #0f172a;
}

html[data-theme="light"] nav a {
  color: #1f2937;
}

html[data-theme="light"] nav a:hover,
html[data-theme="light"] nav a.active {
  color: #1d4ed8;
}

/* Hero Section */
html[data-theme="light"] .hero {
  background: radial-gradient(circle at top left, rgba(59,130,246,0.12), transparent 55%),
              radial-gradient(circle at bottom right, rgba(168,85,247,0.12), transparent 55%);
  border-color: rgba(148,163,184,0.6);
  box-shadow: 0 18px 36px rgba(148, 163, 184, 0.45);
}

html[data-theme="light"] .hero p {
  color: #475569;
}

/* Cards */
html[data-theme="light"] .card {
  background: #ffffff;
  border-color: rgba(148,163,184,0.7);
  color: #111827;
}

html[data-theme="light"] .card p {
  color: #475569;
}

html[data-theme="light"] .card:hover {
  border-color: rgba(59,130,246,0.9);
  box-shadow: 0 18px 38px rgba(148,163,184,0.5);
}

/* Buttons */
html[data-theme="light"] .btn {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-color: rgba(59,130,246,0.5);
  color: #ffffff;
}

html[data-theme="light"] .btn:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 10px 24px rgba(59,130,246,0.4);
}

/* Sections / Panels */
html[data-theme="light"] .section,
html[data-theme="light"] .panel,
html[data-theme="light"] .account-card,
html[data-theme="light"] .admin-panel,
html[data-theme="light"] .table-card,
html[data-theme="light"] main > section {
  background: #ffffff;
  color: #111827;
  border-color: rgba(148, 163, 184, 0.75);
  box-shadow: 0 18px 36px rgba(148, 163, 184, 0.45);
}

html[data-theme="light"] .section p,
html[data-theme="light"] .section h2,
html[data-theme="light"] .section h3 {
  color: #0f172a;
}

html[data-theme="light"] .section p {
  color: #475569;
}

/* Tables */
html[data-theme="light"] .table-wrapper {
  background: #ffffff;
  border-color: rgba(148,163,184,0.7);
}

html[data-theme="light"] table {
  background: #ffffff;
  color: #111827;
}

html[data-theme="light"] thead {
  background: #e5edff;
}

html[data-theme="light"] th {
  color: #111827;
}

/* td hat eine eigene hellgraue Schriftfarbe -> im Light-Mode explizit ueberschreiben,
   sonst bleibt der Tabellentext hellgrau und ist auf Weiss kaum lesbar. */
html[data-theme="light"] td {
  color: #1f2937;
}

html[data-theme="light"] tbody tr:nth-child(even) {
  background: #f9fafb;
}

html[data-theme="light"] tbody tr:hover {
  background: rgba(191,219,254,0.9);
}

html[data-theme="light"] .empty-row {
  color: #6b7280;
}

/* PDF Frame */
html[data-theme="light"] .pdf-frame {
  background: #ffffff;
  border-color: rgba(148,163,184,0.7);
}

.pdf-status {
  min-height: 1.2rem;
  margin: 0.55rem 0 0;
  color: #9ca3af;
  font-size: 0.85rem;
}

.pdf-status.is-error {
  color: #fca5a5;
}

a[data-disabled="true"] {
  cursor: wait;
  opacity: 0.65;
  pointer-events: none;
}

/* Toolbars and Inputs */
html[data-theme="light"] .events-toolbar input[type="search"],
html[data-theme="light"] .events-toolbar select {
  background: #ffffff;
  border-color: rgba(148,163,184,0.9);
  color: #111827;
}

/* Navigation Buttons */
html[data-theme="light"] .nav-btn {
  background: #e5e7eb;
  color: #111827;
  border-color: rgba(148,163,184,0.9);
}

html[data-theme="light"] .nav-btn:hover {
  background: #d1d5db;
}

/* Footer */
html[data-theme="light"] footer {
  color: #4b5563;
  border-top-color: rgba(148, 163, 184, 0.6);
}

/* Code blocks */
html[data-theme="light"] code {
  background: rgba(148,163,184,0.15);
  color: #0f172a;
}

/* Badge */
html[data-theme="light"] .badge-soft {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.4);
  color: #1e40af;
}

/* Pills - maintain colors but adjust slightly for light mode */
html[data-theme="light"] .pill {
  background: rgba(255,255,255,0.8);
  border-color: rgba(148,163,184,0.5);
}

html[data-theme="light"] .pill-day {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(217, 119, 6, 0.5);
  color: #b45309;
}

html[data-theme="light"] .pill-type-setup {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.5);
  color: #1e40af;
}

html[data-theme="light"] .pill-type-teardown {
  background: rgba(249,115,22,0.15);
  border-color: rgba(249,115,22,0.5);
  color: #c2410c;
}

html[data-theme="light"] .pill-type-event {
  background: rgba(147,51,234,0.15);
  border-color: rgba(147,51,234,0.5);
  color: #7e22ce;
}

html[data-theme="light"] .pill-type-rehearsal {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.5);
  color: #15803d;
}

html[data-theme="light"] .pill-type-other {
  background: rgba(148,163,184,0.2);
  border-color: rgba(148,163,184,0.6);
  color: #475569;
}

html[data-theme="light"] .pill-postponed {
  background: rgba(245,158,11,0.16) !important;
  border-color: rgba(180,83,9,0.5) !important;
  color: #854d0e !important;
}

html[data-theme="light"] #list-view tbody tr.postponed-event {
  background: rgba(245,158,11,0.12);
}

html[data-theme="light"] #list-view tbody tr.postponed-event:hover {
  background: rgba(245,158,11,0.18);
}

html[data-theme="light"] #list-view tbody tr.postponed-event td {
  text-decoration-color: rgba(180,83,9,0.85);
}

html[data-theme="light"] #list-view tbody tr.postponed-event td:first-child {
  border-left-color: rgba(180,83,9,0.75);
}

html[data-theme="light"] #list-view tbody tr.postponed-event td::after {
  border-top-color: rgba(180,83,9,0.75);
}

/* File links */
html[data-theme="light"] .file-list a {
  color: #2563eb;
  background: rgba(59,130,246,0.05);
  border-color: rgba(59,130,246,0.2);
}

html[data-theme="light"] .file-list a:hover {
  background: rgba(59,130,246,0.1);
  color: #1d4ed8;
}

/* Account-Icon im Header */
.nav-account {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.nav-account:hover {
  background: rgba(0, 0, 0, 0.45);
}

/* Grundlayout der Icons */
.account-icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* Standard: Dark-Theme -> helle Icon-Version anzeigen */
.account-icon--light {
  display: block;
}
.account-icon--dark {
  display: none;
}

/* Light-Theme -> dunkle Icon-Version anzeigen */
html[data-theme="light"] .account-icon--light {
  display: none;
}
html[data-theme="light"] .account-icon--dark {
  display: block;
}

/* ===========================
   Barrierefreiheit (a11y)
   =========================== */

/* Nur für Screenreader sichtbar (z.B. Tabellen-Caption) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Deutlich sichtbarer Tastatur-Fokus auf interaktiven Elementen */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
  border-radius: 4px;
}
html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] input:focus-visible,
html[data-theme="light"] select:focus-visible,
html[data-theme="light"] textarea:focus-visible {
  outline-color: #2563eb;
}

/* Team-/Namen-Chips in der Terminliste */
.team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.team-chip {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e5e7eb;
}
html[data-theme="light"] .team-chip {
  background: rgba(15,23,42,0.06);
  border-color: rgba(15,23,42,0.12);
  color: #1f2937;
}

/* ===========================
   2026 UI Overhaul
   =========================== */

:root {
  --tt-bg: #080a0d;
  --tt-bg-elevated: #10141a;
  --tt-surface: rgba(18, 23, 30, 0.86);
  --tt-surface-strong: rgba(23, 29, 38, 0.94);
  --tt-border: rgba(196, 209, 224, 0.16);
  --tt-border-strong: rgba(196, 209, 224, 0.28);
  --tt-text: #f4f7fb;
  --tt-muted: #a9b4c4;
  --tt-subtle: #758195;
  --tt-accent: #38bdf8;
  --tt-accent-2: #f59e0b;
  --tt-radius: 0.65rem;
  --tt-shadow: 0 18px 48px rgba(0,0,0,0.36);
}

/* Light-Mode-Gegenstuecke der Design-Tokens. Wichtig, weil viele Komponenten
   (z.B. .eq-group, Dashboard-Karten, Listenansicht) ihre Farben aus var(--tt-*)
   ziehen und ohne diese Definitionen im Light-Mode dunkel blieben. */
html[data-theme="light"] {
  --tt-bg: #f6f8fb;
  --tt-bg-elevated: #ffffff;
  --tt-surface: #ffffff;
  --tt-surface-strong: #ffffff;
  --tt-border: rgba(15, 23, 42, 0.12);
  --tt-border-strong: rgba(15, 23, 42, 0.22);
  --tt-text: #0f172a;
  --tt-muted: #475569;
  --tt-subtle: #64748b;
  --tt-accent: #2563eb;
  --tt-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

body {
  background:
    linear-gradient(135deg, rgba(56,189,248,0.06), transparent 32%),
    linear-gradient(180deg, #0d1117 0%, var(--tt-bg) 48%, #050608 100%);
  color: var(--tt-text);
}

header {
  background: rgba(9, 12, 17, 0.88);
  border-bottom-color: var(--tt-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}

header h1 {
  background: none;
  color: var(--tt-text);
  -webkit-text-fill-color: currentColor;
  letter-spacing: 0.08em;
}

nav a {
  border-radius: 0.55rem;
  color: #dbe4ef;
}

nav a:hover,
nav a.active {
  background: rgba(56,189,248,0.12);
  color: #f8fbff;
}

main {
  max-width: 1280px;
}

.hero,
.section,
.panel,
.account-card,
.card,
.table-wrapper {
  border-radius: var(--tt-radius);
  border-color: var(--tt-border);
  background: var(--tt-surface);
  box-shadow: var(--tt-shadow);
}

.hero {
  padding: 2.4rem;
}

.hero::before,
.card::before {
  display: none;
}

.section {
  padding: 1.2rem;
  border: 1px solid var(--tt-border);
}

.section h2,
.hero h2 {
  letter-spacing: -0.01em;
}

.section p,
.hero p,
.small-text {
  color: var(--tt-muted);
}

.card {
  background: rgba(18,23,30,0.66);
  border-radius: var(--tt-radius);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(56,189,248,0.28);
  box-shadow: 0 18px 36px rgba(0,0,0,0.32);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-export,
button {
  border-radius: 0.55rem;
}

.btn,
.btn-primary {
  background: #1f8dcc;
  border-color: rgba(56,189,248,0.5);
  box-shadow: 0 10px 24px rgba(14,165,233,0.2);
}

.btn:hover,
.btn-primary:hover {
  background: #1678af;
  box-shadow: 0 12px 26px rgba(14,165,233,0.24);
}

.btn-outline {
  border-color: var(--tt-border-strong);
  color: #dbe4ef;
}

.btn-export {
  border-color: rgba(245,158,11,0.48);
  background: rgba(245,158,11,0.12);
  color: #fbbf24;
}

input,
select,
textarea {
  font: inherit;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.events-toolbar input[type="search"],
.events-toolbar select {
  border-radius: 0.55rem;
  border-color: var(--tt-border-strong);
  background: rgba(5,8,12,0.72);
}

thead {
  background: rgba(56,189,248,0.08);
  border-bottom-color: rgba(56,189,248,0.18);
}

th {
  color: #dce7f5;
  letter-spacing: 0.04em;
}

td {
  color: #cbd5e1;
}

.tag-pill,
.pill,
.team-chip {
  border-radius: 0.45rem !important;
}

html[data-theme="light"] body {
  background: #f6f8fb;
}

html[data-theme="light"] header {
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 28px rgba(15,23,42,0.08);
}

html[data-theme="light"] .section,
html[data-theme="light"] .panel,
html[data-theme="light"] .account-card,
html[data-theme="light"] .card,
html[data-theme="light"] .table-wrapper,
html[data-theme="light"] .hero {
  background: #ffffff;
  border-color: rgba(15,23,42,0.1);
  box-shadow: 0 14px 34px rgba(15,23,42,0.08);
}

/* (Das frühere Hamburger-/Dropdown-CSS wurde entfernt - mobile Navigation
   läuft komplett über die fixierte Bottom-Bar, siehe .tt-bottomnav unten.) */

@media (max-width: 768px) {
  /* Mobile Navigation läuft über die fixierte Bottom-Bar (.tt-bottomnav).
     Die Top-Nav wird hier ausgeblendet. */
  header nav { display: none !important; }

  /* .tt-bottomnav wird mobil sichtbar – die display:flex-Regel steht weiter
     unten (nach den Basis-Styles), damit sie bei gleicher Spezifität gewinnt. */

  /* Platz für die fixierte Bar, damit Inhalt + Footer nicht verdeckt werden. */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  /* Toasts über die Bottom-Bar heben, damit sie nicht dahinter verschwinden. */
  #tt-toast-host {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 0.75rem);
  }
}

/* ===========================
   Mobile Bottom-Navigation (tt-bottomnav, injiziert in ui.js)
   =========================== */
.tt-bottomnav {
  display: none; /* nur mobil – siehe @media (max-width: 768px) */
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900; /* unter Toast (2000), Consent & Tour, damit Overlays vorn bleiben */
  justify-content: space-around;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.3rem 0.4rem;
  padding-bottom: calc(0.3rem + env(safe-area-inset-bottom, 0px));
  background: var(--tt-surface-strong, rgba(16,20,26,0.96));
  backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--tt-border, rgba(255,255,255,0.12));
  box-shadow: 0 -8px 24px rgba(0,0,0,0.32);
}

.tt-bn-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 0.3rem 0.2rem;
  border: 0;
  background: transparent;
  color: var(--tt-muted, #9aa4b2);
  text-decoration: none;
  font: inherit;
  font-size: 0.62rem;
  cursor: pointer;
  border-radius: 0.55rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.tt-bn-icon { display: flex; }
.tt-bn-icon svg { width: 22px; height: 22px; display: block; }
.tt-bn-label { letter-spacing: 0.01em; }

.tt-bn-item.active { color: var(--tt-accent, #38bdf8); }
.tt-bn-item:active { background: rgba(255,255,255,0.06); }
.tt-bn-item:focus-visible { outline: 2px solid var(--tt-accent, #38bdf8); outline-offset: -2px; }

html[data-theme="light"] .tt-bottomnav {
  background: rgba(255,255,255,0.97);
  border-top-color: rgba(15,23,42,0.1);
  box-shadow: 0 -8px 24px rgba(15,23,42,0.12);
}
html[data-theme="light"] .tt-bn-item { color: #475569; }
html[data-theme="light"] .tt-bn-item:active { background: rgba(15,23,42,0.05); }

/* ===========================
   „Mehr"-Bottom-Sheet (tt-more-sheet, injiziert in ui.js)
   =========================== */
.tt-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: flex-end;
}
.tt-more-sheet[hidden] { display: none; }

.tt-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tt-more-sheet.is-open .tt-more-backdrop { opacity: 1; }

.tt-more-panel {
  position: relative;
  width: 100%;
  background: var(--tt-surface-strong, #11151c);
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  border-top: 1px solid var(--tt-border, rgba(255,255,255,0.14));
  padding: 0.5rem 0.75rem calc(1rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -16px 40px rgba(0,0,0,0.4);
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.tt-more-sheet.is-open .tt-more-panel { transform: translateY(0); }

.tt-more-grip {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--tt-border-strong, rgba(255,255,255,0.28));
  margin: 0.35rem auto 0.6rem;
}

.tt-more-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 0.6rem;
  border: 0;
  background: transparent;
  color: var(--tt-text, #f4f7fb);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0.6rem;
}
.tt-more-row + .tt-more-row { border-top: 1px solid var(--tt-border, rgba(255,255,255,0.08)); }
.tt-more-row:active { background: rgba(255,255,255,0.06); }
.tt-more-icon { display: inline-flex; flex: 0 0 auto; }
.tt-more-icon svg,
.tt-more-icon img { width: 22px; height: 22px; display: block; }

html[data-theme="light"] .tt-more-panel { background: #ffffff; }
html[data-theme="light"] .tt-more-row { color: #0f172a; }
html[data-theme="light"] .tt-more-row + .tt-more-row { border-top-color: rgba(15,23,42,0.08); }
html[data-theme="light"] .tt-more-row:active { background: rgba(15,23,42,0.05); }

@media (prefers-reduced-motion: reduce) {
  .tt-more-backdrop,
  .tt-more-panel { transition: none; }
}

/* Bottom-Bar nur mobil sichtbar machen (steht bewusst NACH den Basis-Styles,
   damit display:flex die Basisregel display:none bei gleicher Spezifität schlägt). */
@media (max-width: 768px) {
  .tt-bottomnav { display: flex; }
  html.has-bottomnav main {
    padding-bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px));
  }
  html.has-bottomnav footer {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ===========================
   Toast-Benachrichtigungen (ttToast in ui.js)
   =========================== */
#tt-toast-host {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: min(92vw, 420px);
}

.tt-toast {
  pointer-events: auto;
  width: 100%;
  background: rgba(15,23,42,0.97);
  color: #f1f5f9;
  border: 1px solid rgba(148,163,184,0.35);
  border-left: 3px solid #60a5fa;
  border-radius: 0.7rem;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.tt-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tt-toast--success { border-left-color: #4ade80; }
.tt-toast--error { border-left-color: #f87171; }

@media (prefers-reduced-motion: reduce) {
  .tt-toast { transition: none; transform: none; }
}

html[data-theme="light"] .tt-toast {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15,23,42,0.12);
  box-shadow: 0 12px 30px rgba(15,23,42,0.18);
}

/* ===========================
   PDF-Dokumentkarte (Öffnen/Download statt eingebettetem Viewer)
   =========================== */
.doc-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--tt-radius, 0.65rem);
  border: 1px solid var(--tt-border, rgba(255,255,255,0.12));
  background: var(--tt-surface, rgba(18,23,30,0.66));
  box-shadow: var(--tt-shadow, 0 18px 48px rgba(0,0,0,0.36));
}
.doc-card-icon {
  font-size: 1.7rem;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.25);
}
.doc-card-body { flex: 1; min-width: 0; }
.doc-card-title { font-weight: 600; font-size: 1rem; }
.doc-card .pdf-status { margin-top: 0.15rem; }

.pdf-status {
  font-size: 0.85rem;
  color: var(--tt-muted, #9ca3af);
}
.pdf-status.is-error { color: #f87171; }

@media (max-width: 480px) {
  .doc-card { flex-direction: column; align-items: stretch; text-align: center; }
  .doc-card-icon { align-self: center; }
  .doc-card .btn { width: 100%; justify-content: center; }
}

/* ===========================
   Start-Dashboard: Nächste Termine
   =========================== */
.dash-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.dash-item {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: var(--tt-radius, 0.65rem);
  border: 1px solid var(--tt-border, rgba(255,255,255,0.1));
  background: rgba(255,255,255,0.03);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.dash-item:hover {
  background: rgba(56,189,248,0.08);
  border-color: rgba(56,189,248,0.3);
  transform: translateY(-1px);
}
.dash-item--postponed {
  position: relative;
  overflow: hidden;
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.42);
  opacity: 0.82;
}
.dash-item--postponed:hover {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.62);
}
.dash-item--postponed::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  top: 50%;
  border-top: 3px solid rgba(251,191,36,0.9);
  pointer-events: none;
  transform: translateY(-50%);
}
.dash-item--postponed .dash-date,
.dash-item--postponed .dash-title,
.dash-item--postponed .dash-meta {
  text-decoration-line: line-through;
  text-decoration-thickness: 0.14em;
  text-decoration-color: rgba(251,191,36,0.95);
}
.dash-date {
  flex: 0 0 auto;
  min-width: 5.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tt-accent, #38bdf8);
}
.dash-main { flex: 1; min-width: 0; }
.dash-title { font-weight: 600; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.dash-meta { font-size: 0.82rem; color: var(--tt-muted, #9ca3af); margin-top: 0.15rem; }
/* Leerer / Fehler-Zustand mit Icon */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  color: var(--tt-muted, #9ca3af);
  padding: 1.6rem 1rem;
  border: 1px dashed var(--tt-border, rgba(255,255,255,0.14));
  border-radius: var(--tt-radius, 0.65rem);
}
.dash-empty svg { width: 30px; height: 30px; opacity: 0.7; }
.dash-empty--error { color: #f3b0b0; }
.dash-empty--error svg { opacity: 0.9; }

/* Loading-Skeleton (Platzhalter beim Laden der Termine) */
.dash-skel {
  height: 3.4rem;
  border-radius: var(--tt-radius, 0.65rem);
  border: 1px solid var(--tt-border, rgba(255,255,255,0.1));
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.09) 37%,
    rgba(255,255,255,0.04) 63%);
  background-size: 400% 100%;
  animation: dash-shimmer 1.4s ease infinite;
}
html[data-theme="light"] .dash-skel {
  border-color: rgba(15,23,42,0.1);
  background: linear-gradient(90deg,
    rgba(15,23,42,0.04) 25%,
    rgba(15,23,42,0.08) 37%,
    rgba(15,23,42,0.04) 63%);
  background-size: 400% 100%;
}
@keyframes dash-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-skel { animation: none; }
}

html[data-theme="light"] .dash-item {
  background: #ffffff;
  border-color: rgba(15,23,42,0.1);
}
html[data-theme="light"] .dash-item:hover {
  background: rgba(56,130,246,0.08);
}
html[data-theme="light"] .dash-item--postponed {
  background: rgba(245,158,11,0.12);
  border-color: rgba(180,83,9,0.36);
}
html[data-theme="light"] .dash-item--postponed:hover {
  background: rgba(245,158,11,0.18);
  border-color: rgba(180,83,9,0.52);
}
html[data-theme="light"] .dash-item--postponed::after {
  border-top-color: rgba(180,83,9,0.75);
}
html[data-theme="light"] .dash-item--postponed .dash-date,
html[data-theme="light"] .dash-item--postponed .dash-title,
html[data-theme="light"] .dash-item--postponed .dash-meta {
  text-decoration-color: rgba(180,83,9,0.85);
}

@media (max-width: 480px) {
  .dash-item { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .dash-date { min-width: 0; }
}

/* ===========================
   Termin-Tabelle (Pläne) auf Mobil als Karten
   =========================== */
@media (max-width: 640px) {
  #list-view .table-wrapper {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  #list-view table { min-width: 0; }
  #list-view thead { display: none; }
  #list-view table,
  #list-view tbody,
  #list-view tr,
  #list-view td { display: block; width: 100%; }

  #list-view tbody tr {
    border: 1px solid var(--tt-border, rgba(255,255,255,0.12));
    border-radius: var(--tt-radius, 0.65rem);
    background: var(--tt-surface, rgba(18,23,30,0.66));
    margin-bottom: 0.7rem;
    padding: 0.6rem 0.9rem;
  }
  #list-view tbody tr:hover { background: var(--tt-surface, rgba(18,23,30,0.66)); }
  #list-view tbody tr.postponed-event {
    overflow: hidden;
    border-color: rgba(245,158,11,0.48);
  }
  #list-view tbody tr.postponed-event::after {
    content: "";
    position: absolute;
    left: 0.7rem;
    right: 0.7rem;
    top: 50%;
    border-top: 3px solid rgba(251,191,36,0.95);
    pointer-events: none;
    transform: translateY(-50%);
  }
  #list-view tbody tr.postponed-event td::after {
    display: none;
  }

  #list-view td {
    border: none;
    padding: 0.3rem 0;
    text-align: left;
  }
  #list-view td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--tt-muted, #9ca3af);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.1rem;
  }
  #list-view td:empty { display: none; }
  #list-view td.empty-row { text-align: center; }
  #list-view td.empty-row::before { content: none; }
}

/* ===========================
   Equipment-Inventar (equipment.html + Admin-Badges)
   =========================== */
.eq-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.eq-controls input[type="search"],
.eq-controls select {
  min-height: 2.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--tt-radius, 0.65rem);
  border: 1px solid var(--tt-border, rgba(255,255,255,0.14));
  background: rgba(5,7,16,0.88);
  color: var(--tt-text, #f4f7fb);
  font: inherit;
  font-size: 0.9rem;
}
.eq-controls input[type="search"]::placeholder {
  color: var(--tt-muted, #9ca3af);
}
.eq-controls input[type="search"]:focus,
.eq-controls select:focus {
  outline: none;
  border-color: rgba(56,189,248,0.55);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
}
.eq-controls input[type="search"] { flex: 1 1 240px; min-width: 0; }
.eq-controls select { flex: 0 1 auto; }
html[data-theme="light"] .eq-controls input[type="search"],
html[data-theme="light"] .eq-controls select {
  background: #ffffff;
  border-color: rgba(15,23,42,0.14);
  color: #0f172a;
}

.eq-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.eq-status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}
.eq-status--verfuegbar { color: #4ade80; background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.35); }
.eq-status--defekt     { color: #f87171; background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.35); }
.eq-status--verliehen  { color: #fbbf24; background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.35); }

html[data-theme="light"] .eq-status--verfuegbar { color: #15803d; background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.4); }
html[data-theme="light"] .eq-status--defekt     { color: #b91c1c; background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); }
html[data-theme="light"] .eq-status--verliehen  { color: #b45309; background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.4); }

/* Gruppierte, einklappbare Equipment-Liste (kompakt – statt langer Karten-Scroll) */
.eq-empty {
  color: var(--tt-muted, #9ca3af);
  padding: 1rem;
  text-align: center;
  border: 1px dashed var(--tt-border, rgba(255,255,255,0.14));
  border-radius: var(--tt-radius, 0.65rem);
}
.eq-group {
  border: 1px solid var(--tt-border, rgba(255,255,255,0.12));
  border-radius: var(--tt-radius, 0.65rem);
  background: var(--tt-surface, rgba(18,23,30,0.66));
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.eq-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  user-select: none;
}
.eq-group > summary::-webkit-details-marker { display: none; }
.eq-group > summary::before {
  content: "›";
  display: inline-block;
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--tt-muted, #9ca3af);
  transition: transform 0.15s ease;
}
.eq-group[open] > summary::before { transform: rotate(90deg); }
.eq-group-title { flex: 1; min-width: 0; }
.eq-group-count {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tt-muted, #9ca3af);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
.eq-group-body { border-top: 1px solid var(--tt-border, rgba(255,255,255,0.1)); }
.eq-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
}
.eq-row + .eq-row { border-top: 1px solid rgba(255,255,255,0.05); }
.eq-row-main { min-width: 0; }
.eq-row-name { display: block; }
.eq-row-note { display: block; font-size: 0.78rem; color: var(--tt-muted, #9ca3af); }
.eq-row .eq-status { flex: 0 0 auto; }
html[data-theme="light"] .eq-group-count { background: rgba(15,23,42,0.06); }
html[data-theme="light"] .eq-row + .eq-row { border-top-color: rgba(15,23,42,0.06); }

/* Mobil: Equipment-Tabelle → Karten (gleiche Technik wie #list-view) */
@media (max-width: 640px) {
  #equipment-list .table-wrapper { border: none; background: transparent; box-shadow: none; overflow: visible; }
  #equipment-list table { min-width: 0; }
  #equipment-list thead { display: none; }
  #equipment-list table,
  #equipment-list tbody,
  #equipment-list tr,
  #equipment-list td { display: block; width: 100%; }
  #equipment-list tbody tr {
    border: 1px solid var(--tt-border, rgba(255,255,255,0.12));
    border-radius: var(--tt-radius, 0.65rem);
    background: var(--tt-surface, rgba(18,23,30,0.66));
    margin-bottom: 0.7rem;
    padding: 0.6rem 0.9rem;
  }
  #equipment-list td { border: none; padding: 0.3rem 0; text-align: left; }
  #equipment-list td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--tt-muted, #9ca3af);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.1rem;
  }
  #equipment-list td:empty { display: none; }
  #equipment-list td.empty-row { text-align: center; }
  #equipment-list td.empty-row::before { content: none; }
}

/* ===========================
   Empfehlungs-Banner: optionale Kontakt-E-Mail (ui.js)
   =========================== */
.tt-email-nudge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: rgba(148,163,184,0.06);
  border-bottom: 1px solid var(--tt-border, rgba(255,255,255,0.12));
  color: var(--tt-text, #f4f7fb);
  font-size: 0.85rem;
}
.tt-email-nudge-text { flex: 1 1 240px; color: var(--tt-muted, #cbd5e1); }
.tt-email-nudge-text em { font-style: normal; color: var(--tt-muted, #cbd5e1); font-weight: 600; }
.tt-email-nudge-cta {
  flex: 0 0 auto;
  background: rgba(56,189,248,0.12);
  color: var(--tt-accent, #38bdf8);
  border: 1px solid rgba(56,189,248,0.40);
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
}
.tt-email-nudge-cta:hover { background: rgba(56,189,248,0.18); }
html[data-theme="light"] .tt-email-nudge-cta {
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.32);
  color: #2563eb;
}
.tt-email-nudge-x {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: var(--tt-muted, #9ca3af);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.3rem;
}
.tt-email-nudge-x:hover { color: var(--tt-text, #fff); }
html[data-theme="light"] .tt-email-nudge { background: rgba(37,99,235,0.08); }

@media (max-width: 480px) {
  .tt-email-nudge {
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
  }
  .tt-email-nudge-text { flex: 1 1 100%; }
  .tt-email-nudge-cta {
    padding: 0.3rem 0.7rem;
    font-size: 0.76rem;
  }
}

/* Einheitlicher Lade-Spinner fuer alle Listen-/Detail-Ladezustaende */
.tt-spin {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.7;
  vertical-align: -0.18em;
  margin-right: 0.5em;
  flex-shrink: 0;
  animation: tt-spin 0.7s linear infinite;
}
@keyframes tt-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .tt-spin { animation: none; }
}

/* ===========================
   Team-/Mitgliederliste (team.html)
   =========================== */
.team-subhead { font-size: 1rem; margin: 0.4rem 0 0.6rem; color: var(--tt-text, #f4f7fb); }
.team-count { font-size: 0.8rem; color: var(--tt-muted, #9ca3af); font-weight: 400; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}
.team-member {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border: 1px solid var(--tt-border, rgba(255,255,255,0.1));
  border-radius: var(--tt-radius, 0.65rem);
  background: var(--tt-surface, rgba(18,23,30,0.66));
  padding: 0.6rem 0.8rem;
}
.team-member .tm-name { font-weight: 600; }
.team-member .tm-class { font-size: 0.8rem; color: var(--tt-muted, #9ca3af); }
.team-member.is-coord { border-color: rgba(56,189,248,0.45); }
html[data-theme="light"] .team-member { background: #ffffff; border-color: rgba(15,23,42,0.1); }

/* ===========================
   Erst-Login-Zustimmung (ttConsent in ui.js)
   =========================== */
.tt-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(3, 7, 16, 0.78);
  backdrop-filter: blur(6px);
}
.tt-consent-card {
  width: 100%;
  max-width: 460px;
  background: var(--tt-surface-strong, #11151c);
  border: 1px solid var(--tt-border, rgba(255,255,255,0.14));
  border-radius: 1rem;
  padding: 1.5rem 1.4rem;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  color: var(--tt-text, #f4f7fb);
}
.tt-consent-card h2 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.tt-consent-card p { color: var(--tt-muted, #a9b4c4); margin-bottom: 0.7rem; }
.tt-consent-list {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.tt-consent-list li { font-size: 0.9rem; line-height: 1.45; }
.tt-consent-list a,
.tt-consent-links a { color: var(--tt-accent, #60a5fa); }
.tt-consent-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  margin-bottom: 1.1rem;
  cursor: pointer;
}
.tt-consent-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--tt-accent, #3b82f6);
}
.tt-consent-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.tt-consent-actions button {
  border-radius: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.tt-consent-logout {
  background: transparent;
  border-color: var(--tt-border-strong, rgba(255,255,255,0.28));
  color: var(--tt-text, #e5e7eb);
}
.tt-consent-accept {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
}
.tt-consent-accept:disabled { opacity: 0.5; cursor: not-allowed; }
.tt-consent-links {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--tt-muted, #9ca3af);
  text-align: center;
}
html[data-theme="light"] .tt-consent-card {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15,23,42,0.12);
}
html[data-theme="light"] .tt-consent-card p { color: #475569; }

/* ===========================
   Onboarding-Tour (ttStartTour in ui.js)
   =========================== */
.nav-help {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--tt-border, rgba(255,255,255,0.2));
  background: rgba(255,255,255,0.05);
  color: var(--tt-text, #e5e7eb);
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
  margin-left: 0.2rem;
}
.nav-help:hover { background: rgba(56,189,248,0.15); }
html[data-theme="light"] .nav-help {
  border-color: rgba(15,23,42,0.18);
  background: rgba(15,23,42,0.04);
  color: #1f2937;
}

#tt-tour {
  position: fixed;
  inset: 0;
  z-index: 2500;
  pointer-events: none;
}
#tt-tour.is-centered {
  background: rgba(3,7,16,0.7);
  pointer-events: auto;
}
.tt-tour-hole {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(3,7,16,0.7);
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .tt-tour-hole { transition: none; }
}
.tt-tour-card {
  position: fixed;
  pointer-events: auto;
  width: min(320px, calc(100vw - 24px));
  background: var(--tt-surface-strong, #11151c);
  color: var(--tt-text, #f4f7fb);
  border: 1px solid var(--tt-border, rgba(255,255,255,0.16));
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 18px 48px rgba(0,0,0,0.55);
  z-index: 2;
}
#tt-tour.is-centered .tt-tour-card {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.tt-tour-step { font-size: 0.72rem; color: var(--tt-muted, #9ca3af); margin-bottom: 0.3rem; letter-spacing: 0.05em; }
.tt-tour-title { font-size: 1.05rem; margin-bottom: 0.35rem; }
.tt-tour-body { font-size: 0.9rem; color: var(--tt-muted, #cbd5e1); line-height: 1.5; margin-bottom: 0.9rem; }
.tt-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tt-tour-actions button { border-radius: 0.55rem; padding: 0.45rem 0.85rem; font-size: 0.85rem; cursor: pointer; border: 1px solid transparent; }
.tt-tour-skip { background: transparent; color: var(--tt-muted, #9ca3af); }
.tt-tour-nav { display: flex; gap: 0.4rem; }
.tt-tour-prev { background: transparent; border-color: var(--tt-border-strong, rgba(255,255,255,0.28)); color: var(--tt-text, #e5e7eb); }
.tt-tour-next { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; }
html[data-theme="light"] .tt-tour-card { background: #fff; color: #0f172a; border-color: rgba(15,23,42,0.12); }
html[data-theme="light"] .tt-tour-body { color: #475569; }

/* ===========================================================================
   Mobile-/Smoothness-Politur (2026-06-02)
   Steht bewusst am Dateiende, damit Regeln bei gleicher Spezifitaet gewinnen.
   =========================================================================== */

/* Sanftes Scrollen zu Ankern – nur wenn der Nutzer Bewegung nicht reduziert. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Markierungsfarbe an das Akzent-Blau angleichen. */
::selection { background: rgba(56, 189, 248, 0.32); color: #ffffff; }
html[data-theme="light"] ::selection { background: rgba(37, 99, 235, 0.22); color: #0f172a; }

/* iOS Safari zoomt beim Fokus in Felder mit Schriftgroesse < 16px hinein.
   Auf kleinen Viewports darum mindestens 16px erzwingen. */
@media (max-width: 768px) {
  input, select, textarea,
  .events-toolbar input[type="search"],
  .events-toolbar select,
  .eq-controls input[type="search"],
  .eq-controls select {
    font-size: 16px;
  }
}

/* Dezentes Press-Feedback fuer Buttons ohne eigene aktive Animation
   (.btn hat bereits einen Hover-Lift). Mit Reduced-Motion-Schutz. */
@media (prefers-reduced-motion: no-preference) {
  .btn-danger, .theme-pill {
    transition: transform 0.12s ease, filter 0.2s ease,
                border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  }
  .btn-danger:active:not(:disabled),
  .theme-pill:active {
    transform: scale(0.97);
  }
}

/* ===========================================================================
   UI Refresh (2026-06-10), ueberarbeitet nach Nutzer-Feedback:
   schlicht, modern, hochwertig. Keine LED-Punkte, keine Akzent-Striche,
   keine Display-Schrift mit Technik-Charakter.
   - Manrope (ruhige, moderne Grotesk) fuer die gesamte Oberflaeche
   - JetBrains Mono nur fuer Datums-/Uhrzeit-Chips (dezente Datenanzeige)
   Steht bewusst am Dateiende, damit Regeln bei gleicher Spezifitaet gewinnen.
   =========================================================================== */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
}

:root {
  --tt-font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --tt-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --tt-radius: 0.75rem;
}

/* Eine Schriftfamilie fuer alles: ruhig und konsistent. Ueberschreibt den
   System-Stack aus dem *-Selektor am Dateianfang (gleiche Spezifitaet, spaeter). */
* {
  font-family: var(--tt-font-sans);
}

body {
  background:
    radial-gradient(1100px 520px at 85% -12%, rgba(56, 189, 248, 0.07), transparent 60%),
    linear-gradient(180deg, #0d1117 0%, var(--tt-bg) 48%, #050608 100%);
}
html[data-theme="light"] body { background: #f6f8fb; }

/* ---- Header: ruhige Wortmarke ---- */
header h1 {
  font-weight: 800;
  letter-spacing: 0.12em;
}

/* ---- Headlines: klare Hierarchie ueber Gewicht statt Dekoration ---- */
.hero h2,
.section > h2,
.detail-title {
  font-weight: 700;
  letter-spacing: -0.015em;
}
.section > h2 {
  font-size: 1.4rem;
}

/* ---- Hero: grosszuegig, ohne Zierlinien ---- */
.hero h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  margin-bottom: 0.5rem;
}
.hero-kicker {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tt-subtle);
  margin-bottom: 0.9rem !important;
}
.hero-kicker .hero-led { display: none; }

/* ---- Quick-Access-Karten: Icon-Kachel, ruhiger Hover ---- */
.card-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  margin-bottom: 0.85rem;
  color: var(--tt-accent);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.card-icon svg { width: 22px; height: 22px; }
html[data-theme="light"] .card-icon {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
}

/* ---- Buttons: Signal-Cyan, klare Fokus-/Druckzustaende ---- */
.btn,
.btn-primary {
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.22);
}
.btn:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8, #3b82f6);
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.3);
}

/* ---- Datums-/Uhrzeit-Chips: dezente Mono-Datenanzeige ---- */
.dash-date,
td[data-label="Datum"],
td[data-label="Uhrzeit"] {
  font-family: var(--tt-font-mono);
}
.dash-date {
  font-size: 0.76rem;
  text-align: center;
  padding: 0.32rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.24);
}
html[data-theme="light"] .dash-date {
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
}
@media (max-width: 480px) {
  .dash-date { align-self: flex-start; }
}

/* ---- Equipment-Zeilen: Hover-Affordanz fuer klickbare Reihen ---- */
a.eq-row { color: inherit; text-decoration: none; transition: background 0.15s ease; }
a.eq-row:hover { background: rgba(56, 189, 248, 0.07); }
html[data-theme="light"] a.eq-row:hover { background: rgba(37, 99, 235, 0.06); }

/* ---- Bottom-Nav: aktiver Tab mit ruhiger Flaeche ---- */
.tt-bn-item.active {
  background: rgba(56, 189, 248, 0.1);
}
html[data-theme="light"] .tt-bn-item.active { background: rgba(37, 99, 235, 0.08); }

/* ---- Fokus-Ring auf Signalfarbe vereinheitlichen ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline-color: var(--tt-accent);
}

/* ---- Seiteneinstieg: orchestrierter Aufbau von oben nach unten ---- */
@media (prefers-reduced-motion: no-preference) {
  main > .hero,
  main > .section {
    animation: tt-rise 0.45s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  }
  main > *:nth-child(2) { animation-delay: 0.06s; }
  main > *:nth-child(3) { animation-delay: 0.12s; }
  main > *:nth-child(4) { animation-delay: 0.18s; }
  main > *:nth-child(5) { animation-delay: 0.24s; }
}
@keyframes tt-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---- Footer: schlicht und klein ---- */
footer {
  font-size: 0.78rem;
}

/* ---- Layout-Stabilitaet: leere Shell-Container reservieren ihre Hoehe,
   bis ui.js den Inhalt injiziert (kein Springen beim Laden) ---- */
header[data-shell]:empty { min-height: 73px; }
footer[data-shell]:empty { min-height: 53px; }
@media (max-width: 768px) {
  header[data-shell]:empty { min-height: 56px; }
}

/* =========================================================
   Marken- & Startseiten-Politur (2026-06-10)
   Schlicht-modern: Tiefe + dezente Marke ueber Gewicht/Abstand,
   kein Lila, keine LED-Punkte. Bewegung reduced-motion-sicher.
   ========================================================= */

/* Marke in der Kopfzeile: Monogramm + Schriftzug, verlinkt auf Start */
.tt-brand { margin: 0; display: flex; align-items: center; }
.tt-brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}
.tt-brand-mark {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.tt-brand a:hover .tt-brand-mark { transform: scale(1.06); }

/* Hero: dezente Tiefe in Markenblau (einfarbig, weich) */
.hero::after {
  content: "";
  position: absolute;
  top: -45%;
  right: -12%;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,0.16), transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: clamp(1.7rem, 5.5vw, 2.15rem); }
html[data-theme="light"] .hero::after {
  background: radial-gradient(circle, rgba(37,99,235,0.12), transparent 68%);
}

/* Tactiles Press-Feedback (vor allem mobil spuerbar), ruhig */
.card:active,
.dash-item:active { transform: translateY(0) scale(0.99); }
.btn:active,
.btn-primary:active { transform: scale(0.985); }

@media (prefers-reduced-motion: reduce) {
  .tt-brand a:hover .tt-brand-mark,
  .card:active,
  .dash-item:active,
  .btn:active,
  .btn-primary:active { transform: none; }
}
