:root {
  /* Akzent */
  --accent: #b61c3e;
  --accent-weak: rgba(182, 28, 62, 0.12);
  --accent-soft: rgba(182, 28, 62, 0.06);

  /* Light UI */
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #12131a;
  --muted: rgba(18, 19, 26, 0.65);

  --line: rgba(18, 19, 26, 0.1);
  --line-strong: rgba(18, 19, 26, 0.16);

  --shadow: 0 14px 42px rgba(16, 18, 27, 0.1);
  --shadow-soft: 0 10px 26px rgba(16, 18, 27, 0.08);

  --radius: 18px;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Helvetica, Arial, sans-serif;

  background: radial-gradient(
      900px 500px at 12% -10%,
      rgba(182, 28, 62, 0.18),
      transparent 60%
    ),
    radial-gradient(
      900px 520px at 90% 10%,
      rgba(182, 28, 62, 0.1),
      transparent 55%
    ),
    var(--bg);

  color: var(--text);
}

.wrap {
  max-width: var(--max);
  margin: 22px auto;
  padding: 0 16px 26px;

  /* Fix: iOS/Android Overflow durch 100vw/scrollbar-Bugs */
  overflow-x: clip;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.brand-text {
  min-width: 0;
}
.brand-text h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: 0.2px;
}
.sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  margin-bottom: 16px;
  align-items: stretch;

  min-width: 0;
}

.hero-text,
.hero-media {
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;

  min-width: 0;
}

.hero-text {
  padding: 16px;
}
.hero-text h2 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.hero-media {
  display: flex;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

/* Cards / layout */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;

  /* Fix: verhindert, dass Kinder die Card sprengen */
  overflow: hidden;
  min-width: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 16px;
  min-width: 0;
}

.stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

label span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  outline: none;
}

input::placeholder {
  color: rgba(18, 19, 26, 0.4);
}

input:focus,
select:focus {
  border-color: rgba(182, 28, 62, 0.5);
  box-shadow: 0 0 0 4px rgba(182, 28, 62, 0.12);
}

small.muted {
  display: block;
  margin-top: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;

  border: 1px solid rgba(182, 28, 62, 0.28);
  background: linear-gradient(
    180deg,
    rgba(182, 28, 62, 0.96),
    rgba(182, 28, 62, 0.86)
  );
  color: #fff;

  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.1px;
  box-shadow: 0 10px 24px rgba(182, 28, 62, 0.18);

  max-width: 100%;
}

.btn.secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
  font-weight: 700;
  box-shadow: none;
}

.btn:hover {
  filter: brightness(1.02);
}
.btn:active {
  transform: translateY(1px);
}

.btn.tiny {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.btn.danger {
  background: rgba(182, 28, 62, 0.1);
  border-color: rgba(182, 28, 62, 0.25);
  color: var(--accent);
  box-shadow: none;
}

/* Alerts */
.alert {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  margin: 12px 0 16px;
}

.alert.ok {
  background: rgba(18, 150, 80, 0.1);
  border-color: rgba(18, 150, 80, 0.18);
}

.alert.error {
  background: rgba(182, 28, 62, 0.1);
  border-color: rgba(182, 28, 62, 0.2);
  color: #6f1025;
}

/* Table */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  text-align: left;
  font-size: 13px;
  color: var(--muted);

  position: sticky;
  top: 0;

  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-strong);
}

tr:hover td {
  background: var(--accent-soft);
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(182, 28, 62, 0.22);
  background: rgba(182, 28, 62, 0.08);
  color: #711326;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}
.footer {
  margin-top: 14px;
  padding: 6px 2px;
}

/* Inline actions */
.inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: 8px;
}

.actions-col {
  white-space: nowrap;
}

.input.tiny {
  width: 120px;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
}

/* --- Übersicht kompakt: Inhalte auf 2–3 Zeilen begrenzen --- */
/* Standard: Zellen dürfen umbrechen, aber nicht endlos hoch werden */
td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Standort/Notiz: maximal 3 Zeilen (danach ellipsis) */
td:nth-child(3),
td:nth-child(4) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* 3 Zeilen */
  overflow: hidden;
}

/* Zeit-Spalte: bleibt schön kompakt */
td:nth-child(2) .mono {
  line-height: 1.25;
}

/* Name-Spalte: maximal 2 Zeilen */
td:nth-child(1) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* --- Responsive --- */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-media {
    min-height: 190px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Fix: das "grid" Formular (Code-Seite / ggf. andere) darf auf Mobile nicht 2 Spalten erzwingen */
.grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  min-width: 0;
}

@media (max-width: 520px) {
  .logo {
    width: 40px;
    height: 40px;
  }
  .brand-text h1 {
    font-size: 18px;
  }

  /* Buttons auf Mobile full-width */
  .btn {
    width: 100%;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar-actions {
    justify-content: flex-start;
  }

  /* Grid-Formulare: Button unter Input */
  .grid {
    grid-template-columns: 1fr;
  }

  /* Inline-Aktionen in der Tabelle: sauber untereinander */
  .inline {
    display: grid;
    grid-template-columns: 1fr;
    margin-left: 0;
    gap: 10px;
    align-items: stretch;
  }
  .input.tiny {
    width: 100%;
  }
}

/* --- Layout Update: Buchungsformular neben Transporterbild --- */
.hero.hero-booking {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 14px;
  align-items: stretch;
}

.hero-booking-form {
  padding: 16px;
}

/* 2 Spalten im Zeitbereich (nur dort) */
.grid.grid-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

/* Tabelle soll wirklich volle Breite ausnutzen */
.fullwidth {
  width: 100%;
}

/* Responsive: Formular und Bild untereinander */
@media (max-width: 980px) {
  .hero.hero-booking {
    grid-template-columns: 1fr;
  }
  .hero-media {
    min-height: 220px;
  }
}

@media (max-width: 520px) {
  .grid.grid-2cols {
    grid-template-columns: 1fr;
  }
}
