:root { --max: 1100px; }
* { box-sizing: border-box; }
body { font: 16px/1.5 system-ui, sans-serif; margin: 0; color: #111; }
header, main { max-width: var(--max); margin: 0 auto; padding: 1rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .6rem; border-bottom: 1px solid #eee; text-align: left; }
.table th { cursor: pointer; }
.controls { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) {
  .controls { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 1fr; padding: .5rem; border: 1px solid #eee; border-radius: 12px; margin: .5rem 0; }
  .table td { border: none; display: grid; grid-template-columns: 9ch 1fr; gap: .5rem; }
  .table td::before { font-weight: 600; content: attr(data-label); }
}
.btn { padding: .5rem .8rem; border: 1px solid #ddd; border-radius: 8px; background: #fafafa; text-decoration: none; }
input, select, textarea { width: 100%; padding: .5rem .6rem; border: 1px solid #ddd; border-radius: 8px; }
form { display: grid; gap: .8rem; }
.alert { padding: .6rem .8rem; border-radius: 8px; background: #f3f9ff; border: 1px solid #d8eafd; }


.logo {
  text-align: right;        
  margin-bottom: 1rem;
}
.logo img {
  max-width: 300px;         
  height: auto;
}


.login-btn {
  position: fixed;
  bottom: 1.5rem;       
  right: 1.5rem;      
  opacity: 0;       
  pointer-events: none;  
  animation: fadeIn 1s ease forwards;
  animation-delay: 3s;   
  z-index: 1000;       
}

@keyframes fadeIn {
  to {
    opacity: 1;
    pointer-events: auto; 
  }
}


/* Grundlayout */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f9fafb;
  color: #222;
  line-height: 1.5;
}

/* Header mit Logo und Titel */
header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  background: linear-gradient(65deg, #01978c, #d7e9e7);
  color: white;
}
header .logo img {
  max-height: 80px;
  margin-bottom: 1rem;
}
header h1 {
  margin: 0;
  font-size: 1.8rem;
}
header .alert {
  margin-top: .5rem;
  font-size: 1rem;
  opacity: 0.9;
}

/* Auswahlfeld */
form.controls {
  margin: 1rem auto;
  display: flex;
  justify-content: center;
}
form.controls select {
  font-size: 1rem;
  padding: .4rem .6rem;
  border: 1px solid #ddd;
  border-radius: .5rem;
}

/* Tabelle */
.table {
  width: 95%;
  margin: 1.5rem auto;
  border-collapse: collapse;
  background: white;
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.table th,
.table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #eee;
}
.table th {
  background: #f1f5f9;
  font-weight: 600;
  text-align: left;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tr:hover {
  background: #f9fafc;
}

/* Hinweiszeile (wenn keine Daten) */
.table td[colspan] {
  text-align: center;
  color: #555;
}

/* Floating Login Button */
.login-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  opacity: 0;
  pointer-events: none;
  animation: fadeIn 1s ease forwards;
  animation-delay: 3s;
  z-index: 1000;
}
.login-btn .btn {
  background: #01978c;
  color: #fff;
  border-radius: 999px;
  padding: .75rem 1.25rem;
  font-weight: 600;
  text-decoration: none;
}
@keyframes fadeIn {
  to { opacity: 1; pointer-events: auto; }
}


/* Responsive: Tabelle -> Kartenlayout auf kleinen Bildschirmen */
@media (max-width: 768px) {
  .table, .table thead, .table tbody, .table th, .table td, .table tr {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none; /* Kopfzeile ausblenden */
  }

  .table tr {
    background: white;
    margin-bottom: 1rem;
    border-radius: .75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
    overflow: hidden;
  }

  .table td {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: .75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table td:last-child {
    border-bottom: none;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    margin-right: 1rem;
  }
}


/* Responsive: Tabelle -> Kartenlayout auf kleinen Bildschirmen */
@media (max-width: 768px) {
  .table, .table thead, .table tbody, .table th, .table td, .table tr {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none; /* Kopfzeile ausblenden */
  }

  .table tr {
    background: white;
    margin-bottom: 1rem;
    border-radius: .75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
    overflow: hidden;
  }

  .table td {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: .75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table td:last-child {
    border-bottom: none;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    margin-right: 1rem;
  }

  /* Lehrer- und Geändert-Spalte in mobiler Ansicht ausblenden */
  .table td[data-label="Lehrer"],
  .table td[data-label="Geändert"] {
    display: none;
  }
}
