/* 1) Root & Reset -------------------------------------------------------- */
:root {
  --bg: #333333;
  --text: #FFC29B;
  --text-rgb: 255, 194, 155;
  --accent: #FF6B6B;
  --radius: 12px;
  --font: "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%;
  margin: 0
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* 2) Layout -------------------------------------------------------------- */
.site-header {
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid rgba(var(--text-rgb), .25);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: .3px;
  transition: transform .2s
}

.brand:hover {
  transform: translateY(-2px)
}

.brand img {
  height: 40px;
  width: auto;
  display: block
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px
}

.nav__link {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .3px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.nav__link:hover,
.nav__link.active {
  color: var(--accent);
  border-color: var(--accent)
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 20px 40px;
  background: transparent;
  box-shadow: none;
  border: none;
}

.footer {
  margin-top: auto;
  padding: 18px 20px;
  text-align: center;
  opacity: .75;
  border-top: 1px solid rgba(var(--text-rgb), .25);
}

.footer .link {
  color: var(--text);
  text-decoration: underline;
  margin-left: 4px;
  transition: color .2s;
}

.footer .link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* 3) Typografie ---------------------------------------------------------- */
h2 {
  text-align: center;
  color: var(--accent);
  margin: 8px 0 18px;
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: .3px;
}

/* 4) Formulare ----------------------------------------------------------- */
.fieldset {
  border: 1px solid rgba(var(--text-rgb), .28);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  margin: 14px 0;
  background: transparent;
}

.fieldset legend {
  padding: 0 6px;
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem
}

.form-grid,
.form-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin-top: 10px;
}

.form-group {
  display: flex;
  flex-direction: column
}

label {
  font-weight: 700;
  margin-bottom: 6px
}

input,
select {
  width: 100%;
  padding: .7rem .9rem;
  border-radius: 10px;
  border: 1px solid rgba(var(--text-rgb), .35);
  background: var(--bg);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}

input::placeholder {
  color: rgba(var(--text-rgb), .35)
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, .25)
}

.required {
  color: var(--accent)
}

/* 5) Buttons ------------------------------------------------------------- */
.form-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px
}

.btn {
  margin-top: 1.5rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  color: var(--text);
}

.btn-primary {
  background: var(--text);
  color: var(--bg)
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  filter: brightness(1.05)
}

.btn-secondary {
  background: transparent;
  border-color: var(--accent)
}

.btn-secondary:hover {
  background: var(--accent);
  color: #fff
}

/* Einheitliches Styling für Link-Buttons (z. B. "Zur Übersicht") */
a.btn,
a.btn-primary,
a.btn-secondary {
  display: inline-block;
  text-align: center;
  font-weight: 800;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
}

/* ===== Impressum-Seite: Links (E-Mail + Website) ===== */
main a.link[href^="mailto:"],
main a.link[href^="http"] {
  color: var(--text);
  text-decoration: underline;
  transition: color .2s ease;
}

main a.link[href^="mailto:"]:hover,
main a.link[href^="http"]:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* gleiche Farben wie normale Buttons */
a.btn-primary {
  background: var(--text);
  color: var(--bg);
}

a.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  filter: brightness(1.05);
}

a.btn-secondary {
  background: transparent;
  border-color: var(--accent);
  color: var(--text);
}

a.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}


/* Icon-Buttons (Übersicht) */
.actions {
  width: 1%;
  white-space: nowrap;
  text-align: right
}

.icon-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(var(--text-rgb), .25);
  padding: .45rem .6rem;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.icon-btn+.icon-btn {
  margin-left: 8px
}

.icon-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

.icon-btn.danger:hover {
  background: rgba(255, 107, 107, .12);
  color: var(--accent);
  border-color: var(--accent)
}

/* 6) Alerts -------------------------------------------------------------- */
.alert {
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  margin: 10px 0;
  background: #2f2f2f;
  font-weight: 700;
}

.alert.success {
  border-color: #2ecc71
}

.alert.error {
  border-color: var(--accent)
}

/* 7) Tabelle ------------------------------------------------------------- */
.table-wrap {
  overflow: auto;
  margin-top: 14px;
  background: var(--bg);
  border: 1px solid rgba(var(--text-rgb), .22);
  border-radius: 10px;
  padding: 0;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  background: var(--bg);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  color: var(--accent);
  text-align: left;
  font-weight: 900;
  letter-spacing: .2px;
  border-bottom: 1px solid rgba(var(--text-rgb), .25);
  padding: .7rem .8rem;
}

.table th:first-child {
  border-top-left-radius: 10px
}

.table th:last-child {
  border-top-right-radius: 10px
}

.table tbody td {
  padding: .7rem .8rem;
  border-bottom: 1px solid rgba(var(--text-rgb), .15);
  background: var(--bg);
}

.table tbody tr:nth-child(odd) td {
  background: rgba(var(--text-rgb), .04)
}

.table tbody tr:hover td {
  background: rgba(255, 107, 107, .10);
  transition: background .2s
}

.cell-main {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.cell-title {
  font-weight: 900;
  letter-spacing: .2px
}

.cell-sub {
  font-size: .82rem;
  opacity: .75
}

.table .link {
  color: var(--text);
  text-decoration: none
}

.table .link:hover {
  color: var(--accent);
  text-decoration: underline
}

/* 8) Modals -------------------------------------------------------------- */
.success-modal,
.detail-modal,
.toast {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .55);
}

.success-modal__box,
.detail-modal__box {
  background: #2e2e2e;
  color: var(--text);
  border: 1px solid rgba(var(--text-rgb), .35);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .6);
  animation: popIn .18s ease-out;
}

.success-modal__box {
  width: min(560px, 92vw);
  padding: 1.25rem 1.4rem 1rem;
  text-align: center
}

.success-modal__icon {
  height: 64px;
  width: 64px;
  margin: 4px auto 8px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 900
}

.success-modal__title {
  margin: 0 0 .35rem;
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: .3px
}

.success-modal__text {
  margin: 0 0 1rem
}

.success-modal__actions {
  display: flex;
  justify-content: center;
  gap: .6rem;
  margin-top: .2rem
}

.detail-modal__box {
  width: min(720px, 94vw);
  padding: 1.1rem 1.2rem 1rem;
  position: relative
}

.detail-modal__close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer
}

.detail-modal__close:hover {
  color: var(--accent)
}

.detail-modal__title {
  margin: 0 0 .6rem;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: .3px;
  text-align: center
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem 1rem;
  margin: .4rem 0 1rem
}

.drow {
  display: flex;
  gap: .75rem;
  align-items: flex-start
}

.drow .k {
  min-width: 130px;
  color: rgba(var(--text-rgb), .8);
  font-weight: 800
}

.drow .v {
  flex: 1
}

/* ===== Toast: Eingaben fehlen (zentriert & kompakt) ===== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1100;

  width: min(320px, 90vw);
  background: #2e2e2e;
  color: var(--text);
  border: 1px solid rgba(var(--text-rgb), .35);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .6);
  text-align: center;
  padding: 1rem 1.2rem 0.9rem;
  animation: popIn .18s ease-out;
}

.toast strong {
  display: block;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
}

.toast__msg {
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0.9;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.toast .btn {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.9rem;
}

.toast .btn-primary {
  background: var(--accent);
  border: none;
  color: #fff;
}

.toast .btn-primary:hover {
  background: #ff7b7b;
  transform: translateY(-2px);
}

/* dezente Einblendanimation */
@keyframes popIn {
  from {
    transform: translate(-50%, -48%) scale(0.97);
    opacity: 0.85;
  }

  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}


/* 9) Utilities & Responsive --------------------------------------------- */
.only-wide {
  display: table-cell
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap
}

.filterbar .filter-actions {
  grid-column: 1 / -1;
  justify-content: center
}



@keyframes popIn {
  from {
    transform: translateY(6px) scale(.98);
    opacity: .8
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1
  }
}

/* ===== Mobile: Tabelle als Karten + Actions unten ===== */
@media (max-width: 900px) {

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

  /* Table -> Block-Layout */
  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  /* Jede Tabellenzeile als „Karte“ */
  .table tr {
    background: var(--bg);
    border: 1px solid rgba(var(--text-rgb), .22);
    border-radius: 10px;
    padding: .6rem .75rem;
    margin-bottom: .9rem;
  }

  /* Zellen gestapelt, ohne Unterstriche */
  .table tbody td {
    border: 0;
    padding: .35rem 0;
    background: transparent;
    white-space: normal;
    /* falls lange E-Mails umbrechen sollen */
  }

  /* Name/ID oben etwas kräftiger */
  .cell-main {
    margin-bottom: .25rem;
  }

  .cell-title {
    font-weight: 900;
  }

  .cell-sub {
    opacity: .7;
  }

  /* Actions unten, als eigene „Zeile“ mit Trennlinie */
  .table td.actions {
    margin-top: .45rem;
    padding-top: .55rem;
    border-top: 1px solid rgba(var(--text-rgb), .18);
    display: flex;
    justify-content: flex-end;
    /* rechtsbündig; gern auf center ändern */
    gap: .5rem;
    width: 100%;
  }

  /* Icon-Buttons etwas kompakter */
  .icon-btn {
    padding: .35rem .5rem;
  }

  .icon-btn img {
    width: 20px;
    height: 20px;
  }

  .brand img {
    height: 18px;
    padding-right: 20px;
  }

  .form-grid,
  .form-grid-two {
    grid-template-columns: 1fr
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch
  }

  .only-wide {
    display: none
  }

  .table thead th,
  .table tbody td {
    font-size: .95rem
  }

  .detail-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    /* Scrollen aktivieren */
    padding: 2rem 1rem;
    /* Platz oben/unten für Scrollen */
  }

  .detail-modal__box {
    max-height: 90vh;
    /* nicht höher als Bildschirm */
    overflow-y: auto;
    /* Innerhalb des Popups scrollen */
    width: 100%;
    box-sizing: border-box;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .drow {
    flex-direction: column;
    align-items: flex-start;
  }

  .drow .k {
    margin-bottom: 0.3rem;
  }

  .success-modal__actions {
    flex-direction: column;
    gap: 0.6rem;
  }
}