:root {
  --bg: #0b1220;
  --text: #f3f6ff;
  --accent: #00d1ff;
  --muted: #a5b3c4;
  --cta: #051022;
  --btn: #051022;
  --card: rgba(255, 255, 255, 0.04);
  --radius: 1.2rem;
}

/* ------------------ */
/* Globales Setup     */
/* ------------------ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Work Sans', 'Inter', system-ui, sans-serif;
  background: linear-gradient(180deg, #080b14, #111828 55%, #0b1220);
  color: var(--text);
  min-height: 100vh;
}

.container {
  width: min(1600px, 92%);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

h1,
h2 {
  margin-top: 0;
}

/* ------------------ */
/* Header / Layout    */
/* ------------------ */
header {
  padding: 3rem 5%;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 600;
}

header p {
  max-width: 1024px;
  margin: 1rem auto 0;
  color: var(--muted);
  line-height: 1.6;
}

main {
  padding: 0 5% 4rem;
}

footer {
  text-align: center;
  padding: 2rem 5%;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ------------------ */
/* Karten & Panels    */
/* ------------------ */
.card {
  padding: 2rem;
  background: var(--card);
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(0, 209, 255, 0.35), transparent 45%);
  pointer-events: none;
}

.card-content {
  position: relative;
}

.card h2 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

/* ------------------ */
/* Buttons & Links    */
/* ------------------ */
.cta {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 1.8rem;
  background: var(--accent);
  border-radius: 999px;
  color: var(--cta);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.cta.mini {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

button,
input[type="submit"] {
  background: var(--accent);
  border: none;
  color: var(--btn);
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

button:hover,
input[type="submit"]:hover,
.cta:hover {
  transform: translateY(-2px);
}

/* ------------------ */
/* Formularelemente   */
/* ------------------ */
label,
input,
select,
textarea {
  font-family: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 10, 20, 0.5);
  color: var(--text);
  margin-top: 0.6rem;
}

textarea {
  resize: vertical;
  min-height: 90px;
  transition: border 0.2s ease;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  outline: none;
}

.field {
  margin-bottom: 1.2rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

/* ------------------ */
/* Embed-Container    */
/* ------------------ */
.embed,
.tile-embed {
  margin-top: 1.5rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

iframe {
  width: 100%;
  border: none;
  min-height: 320px;
  background: #060b16;
}

.embed iframe {
  height: 360px;
  background: #050a16;
}

/* ------------------ */
/* Kachel-Grid        */
/* ------------------ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.tile {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tile.active {
  grid-column: 1 / -1;
  transform: translateY(-0.5rem);
  box-shadow: 0 35px 70px rgba(0, 0, 0, 0.35);
  z-index: 5;
}

.tile.active iframe {
  min-height: 60vh;
}

.tile h3 {
  cursor: pointer;
  margin: 0;
  font-size: 1.25rem;
}

.tile-content {
  transition: opacity 0.2s ease;
}

/* ------------------ */
/* Globale Grids      */
/* ------------------ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* ------------------ */
/* Admin Panel        */
/* ------------------ */
.admin-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-box {
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.stat-box strong {
  display: block;
  font-size: 2rem;
  margin-top: 0.3rem;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th,
.admin-table td {
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

.admin-table th {
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.admin-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.admin-actions button {
  border-radius: 0.8rem;
  border: none;
  padding: 0.45rem 0.7rem;
  background: rgba(0, 209, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.admin-actions button:hover {
  transform: translateY(-1px);
  background: rgba(0, 209, 255, 0.2);
}

.admin-actions button.danger {
  background: rgba(255, 92, 92, 0.25);
}

.admin-actions button.danger:hover {
  background: rgba(255, 92, 92, 0.4);
}

/* ------------------ */
/* Form-Layout (Admin)*/
/* ------------------ */
.create-user-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.create-user-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.create-user-form button {
  width: fit-content;
  align-self: flex-start;
}

/* ------------------ */
/* Tile-Edit Trigger   */
/* ------------------ */
.tile-edit-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 209, 255, 0.12);
  border-radius: 0.8rem;
  padding: 0.4rem 0.9rem;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid rgba(0, 209, 255, 0.2);
  margin-top: 0.5rem;
}

.tile-edit-trigger:hover {
  background: rgba(0, 209, 255, 0.2);
  border-color: rgba(0, 209, 255, 0.6);
}

/* ------------------ */
/* Modal Dialog       */
/* ------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: rgba(8, 10, 24, 0.95);
  border-radius: 1rem;
  padding: 2rem;
  width: min(560px, 90%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 35px 60px rgba(2, 6, 23, 0.7);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ------------------ */
/* Responsive          */
/* ------------------ */
@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .card,
  .modal {
    padding: 1.5rem;
  }

  .cta {
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  body {
    background-position: center;
  }

  .container {
    padding: 1.5rem 0;
  }

  .card {
    padding: 1.2rem;
  }

  .embed iframe {
    min-height: 300px;
  }
}
