* { box-sizing: border-box; font-family: "Helvetica", Arial, sans-serif; }
body { margin: 0; background: #f7f8fa; color: #333; }

header { background: #800404; color: #fff; padding: 1.5rem; text-align: center; }
nav { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; position: relative; }
.tablink { background: transparent; border: none; color: #fff; padding: .5rem 1rem; cursor: pointer; border-radius: 6px; }
.tablink.active { background: #707070; }
#jetztEintragen { position: absolute; right: 2rem; background: #d3ac0b; border: 0; padding: .6rem 1rem; border-radius: 8px; font-weight: 700; cursor: pointer; }
#jetztEintragen:hover { background: #d3ac0b; }

main { width: 92%; max-width: 1100px; margin: 2rem auto; background: #fff; padding: 2rem; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
h2 { margin: 0 0 .75rem; }

.tables-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.table-card { background: #fafbfc; border: 1px solid #e6e9ef; border-radius: 12px; padding: 1rem; min-height: 360px; display: flex; flex-direction: column; }

.fixed-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.fixed-table th, .fixed-table td { border: 1px solid #e1e4ea; padding: .7rem .6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixed-table thead th { background: #800404; color: #fff; font-weight: 600; }

button.action { padding: .4rem .7rem; border: 0; border-radius: 6px; cursor: pointer; }
button.edit { background: #299a00; color: #fff; }
button.delete { background: #ff2b2b; color: #fff; margin-left: .4rem; }

form {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: none;
}
.form-row { display: grid; gap: .35rem; }
label { font-size: .95rem;}
input[type="text"], input[type="date"], select { width: 100%; padding: .7rem .8rem; border: 1px solid #cfd6e4; border-radius: 8px; background: #fff; }
button.primary { background: #800404; color: #fff; border: 0; padding: .7rem 1.1rem; border-radius: 8px; cursor: pointer; }
button.secondary { background: #e6ebf3; color: #800404; border: 0; padding: .7rem 1.1rem; border-radius: 8px; cursor: pointer; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 34, 62, .4); display: grid; place-items: center; z-index: 50; }
.modal { width: min(560px, 92vw); background: #fff; border-radius: 14px; padding: 1.2rem; box-shadow: 0 10px 24px rgba(0,0,0,.15); }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .5rem; }

/* Toast */
.toast { position: fixed; right: 24px; bottom: 24px; background: #0e8a41; color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.2); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 60; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 900px) {
  .tables-grid { grid-template-columns: 1fr; }
  #jetztEintragen { position: static; }
  nav { flex-wrap: wrap; }
}

/* Actions-Spalte sichtbar + Buttons sauber anordnen */
.fixed-table td.actions-cell { overflow: visible; }  
.actions {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap;
}
button.action { padding: .4rem .6rem; } 

/* In Tabellen-Zelle mit Aktionen: Umbruch erlauben + kein Überlaufen */
.fixed-table td.actions-cell {
  overflow: visible;         
  white-space: normal;        
}

/* Buttons in der Zelle ordentlich anordnen */
.actions {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;            
  max-width: 100%;            
}

/* Buttons minimal kompakter, damit beide meist in eine Zeile passen */
button.action { padding: .35rem .6rem; }

/* Impressum / Rechtstexte */
.legal h3 { margin: 1rem 0 .5rem; font-size: 1.05rem; color: #1f2e46; }
.legal p  { margin: .4rem 0; line-height: 1.5; color: #2a3952; }
.legal a  { color: #0b5bd3; text-decoration: none; }
.legal a:hover { text-decoration: underline; }
