/* Neutrale dunkle Flächen, Akzent aus dem Los-Muertos-Logo. Rot bleibt für Warnungen und Löschen. */
:root {
  color-scheme: dark;
  --bg: #111214;
  --content: #17181b;
  --panel: #212226;
  --panel-2: #2b2c31;
  --border: #34353b;
  --text: #eef0f5;
  --muted: #a3a6ae;
  --accent: #3fb4ec;
  --accent-hover: #6bc6f2;
  --accent-soft: rgba(63, 180, 236, .16);
  --on-accent: #0b1220;
  --radius-lg: 14px;
  --green: #66bb6a;
  --yellow: #fbc02d;
  --orange: #ff8a50;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 'Segoe UI', Roboto, Arial, sans-serif;
}

h1, h2, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; }
h2 { font-size: 18px; font-weight: 600; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: Consolas, 'Courier New', monospace; font-weight: 600; letter-spacing: .03em; }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }

/* --- Bedienelemente --- */

button, input, select, textarea { font: inherit; color: inherit; }

button {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  cursor: pointer;
  white-space: nowrap;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: #ff8a80; border-color: #5c2b2b; }
button.danger:hover:not(:disabled) { border-color: #ff8a80; }
button.danger-solid { background: #b71c1c; border-color: #b71c1c; color: #fff; font-weight: 600; }

input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
textarea { min-height: 76px; resize: vertical; }
select { cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.checks { margin: 0 0 14px; padding: 0; border: 0; }
.checks legend { margin-bottom: 6px; padding: 0; font-size: 13px; color: var(--muted); }
/* Auswahl als runde Chips. Ausgewählt färbt sich der ganze Chip im Akzent. */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0 8px 8px 0;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background-color .15s, border-color .15s;
}
.check:hover { border-color: var(--muted); }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.rights { display: flex; flex-wrap: wrap; gap: 6px; }
td .check { min-height: 32px; margin: 0; padding: 4px 12px 4px 8px; font-size: 13px; white-space: nowrap; }

/* Eigene Kästchen statt der Browser-Standardform */
.check input[type='checkbox'],
.check input[type='radio'] {
  appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 2px solid var(--muted);
  border-radius: 5px;
  background: transparent no-repeat center / 12px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.check input[type='radio'] { border-radius: 50%; }
.check input:focus-visible { outline: none; }
.check input[type='checkbox']:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6 9.6 3.6' fill='none' stroke='%230b1220' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check input[type='radio']:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--panel-2);
}

/* Schalter für Ein und Aus */
.check input[role='switch'] {
  width: 34px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 10px 50%, var(--text) 6px, transparent 6.5px) var(--border);
}
.check input[role='switch']:checked {
  background: radial-gradient(circle at 24px 50%, var(--on-accent) 6px, transparent 6.5px) var(--accent);
}

.form-error {
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 1px solid #5c2b2b;
  border-radius: var(--radius);
  background: #2a1616;
  color: #ffb4ab;
}

/* --- Login --- */

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
a.discord-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: #5865f2;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
a.discord-login:hover { background: #4752c4; }
.password-login { margin-top: 4px; }
.password-login summary { margin-bottom: 12px; color: var(--muted); font-size: 13px; cursor: pointer; }
.discord-tag { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.discord-tag .icon { color: #8b95f5; }
.discord-tag.muted .icon { color: var(--muted); }
.discord-search { max-width: none; }
.member-list { list-style: none; max-height: 320px; margin: 0 0 12px; padding: 0; overflow-y: auto; }
button.member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-bottom: 4px;
  text-align: left;
  white-space: normal;
}
button.member.active { border-color: var(--accent); }
.member-name { min-width: 0; overflow-wrap: anywhere; }
.auth-logo { display: block; width: 180px; height: 180px; margin: 0 auto 16px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card .muted { margin-bottom: 20px; }
.auth-card button.primary { width: 100%; }

/* --- Rahmen --- */

.shell {
  display: grid;
  grid-template: 'top top' auto 'side content' 1fr / 230px minmax(0, 1fr);
  height: 100vh;
}
.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.brand img { display: block; width: 38px; height: 38px; }
.whoami { display: flex; align-items: center; gap: 10px; }
button.logout { display: inline-flex; align-items: center; gap: 6px; }

nav { grid-area: side; padding: 4px 10px 16px; overflow-y: auto; }
.nav-group { margin-bottom: 14px; }
.nav-label {
  padding: 4px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
nav a .icon { color: var(--muted); }
nav a:hover { background: var(--panel); }
nav a[aria-current='page'] { background: var(--accent-soft); font-weight: 600; }
nav a[aria-current='page'] .icon { color: var(--accent); }

.content {
  grid-area: content;
  min-width: 0;
  overflow-y: auto;
  border-top-left-radius: 18px;
  background: var(--content);
}
main { max-width: 1180px; margin: 0 auto; padding: 28px 24px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* --- Kennzahlen als Filter --- */

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
button.tile, a.tile {
  display: block;
  height: auto;
  padding: 12px 16px;
  text-align: left;
  background: var(--panel);
  white-space: normal;
}
a.tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
a.tile:hover { border-color: var(--muted); }
button.tile[aria-pressed='true'] { background: var(--panel-2); border-color: var(--text); }
.tile b { display: block; font-size: 28px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.red b { color: #ff8a80; }
.tile.yellow b { color: var(--yellow); }
.tile.green b { color: var(--green); }

.toolbar { margin-bottom: 12px; max-width: 360px; }

/* --- Tabellen --- */

.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td select { width: auto; min-height: 34px; padding: 4px 8px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
th.right { text-align: right; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill.defect { color: #ff8a80; }
.pill.due { color: var(--orange); }
.pill.soon { color: var(--yellow); }
.pill.ok { color: var(--green); }
.pill.neutral { color: var(--muted); }
.pill.danger { color: #ff8a80; }

.defect-text { margin-top: 4px; color: #ffb4ab; font-size: 13px; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 14px; }
.empty p:last-child { margin-bottom: 0; }

/* --- Übersicht --- */

.icon { display: block; flex-shrink: 0; fill: currentColor; }
.icon-badge {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.overview-head { margin-bottom: 20px; }
.overview-head h1 { font-size: 26px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.stat {
  display: block;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}
.stat:hover { background: var(--panel-2); }
.stat-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.stat-head span { flex: 1; min-width: 0; }
.stat b { display: block; margin: 6px 0 4px; font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-warn { color: #ff8a80; }

.widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 14px; }
.widget {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 320px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.widget-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.widget-head h2 { font-size: 15px; }
.widget-head a {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
}
.widget-head a:hover { text-decoration: underline; }
.widget-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.widget-body > * { flex: 1; }
.widget-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.widget-note { margin-top: 8px; }
.widget-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

button.round {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px 5px 10px;
  border-radius: 999px;
}

.overview-list { list-style: none; margin: 0; padding: 0; }
.overview-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.overview-list li:first-child { border-top: 0; }
.overview-row-text { min-width: 0; overflow-wrap: anywhere; }
.overview-list li > :last-child:not(.overview-row-text) { flex-shrink: 0; }

.ring-row { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.ring {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--panel) 80%, transparent 81%),
    conic-gradient(var(--accent) var(--share), var(--panel-2) 0);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.carousel-wrap { display: flex; flex-direction: column; min-height: 0; }
.carousel {
  position: relative;
  flex: 1;
  min-height: 190px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel-2);
}
.carousel > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
button.carousel-open { position: absolute; inset: 0; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; }
button.carousel-open:disabled { cursor: default; }
.carousel-info {
  position: absolute;
  inset: auto 0 0;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85));
  color: #fff;
  text-align: center;
  pointer-events: none;
}
.carousel-info b { display: block; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
button.carousel-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  transform: translateY(-50%);
}
button.carousel-arrow:hover { background: rgba(0, 0, 0, .85); }
.carousel-arrow.prev { left: 8px; }
.carousel-arrow.next { right: 8px; }
.carousel-dots { flex: 0 !important; display: flex; justify-content: center; gap: 2px; margin-top: 6px; }
/* Der Knopf ist größer als der sichtbare Punkt, damit er sich gut treffen lässt */
.carousel-dots button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
}
.carousel-dots button::after { content: ''; width: 8px; height: 8px; border-radius: 4px; background: var(--muted); opacity: .5; }
.carousel-dots button.active::after { width: 16px; background: var(--accent); opacity: 1; }

.quick { padding: 14px 16px; border-radius: var(--radius-lg); background: var(--panel); }
.quick h2 { margin-bottom: 12px; font-size: 15px; }
.quick-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.quick-item, button.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 8px 4px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: inherit;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}
.quick-item:hover, button.quick-item:hover { background: var(--panel-2); }

/* --- Dealermap --- */

.map {
  height: 380px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #143d66;
}
.map.small { height: 240px; }

.shot {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  margin-bottom: 8px;
  border-radius: var(--radius);
  background: var(--bg);
}
.shot-missing {
  margin-bottom: 8px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.shot-link { display: inline-block; margin-bottom: 14px; color: var(--accent); font-size: 13px; }

button.location-preview {
  display: block;
  width: 280px;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  white-space: normal;
}
button.location-preview:hover .location-name { text-decoration: underline; }
.location-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 4px;
  border-radius: 6px;
  background: var(--bg);
}

/* --- Bewerber --- */

.applicants { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.applicant {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.applicant h2 { margin-bottom: 12px; overflow-wrap: anywhere; }
.applicant-meta { margin: 12px 0; }
.applicant .actions { margin-top: auto; }

/* --- Munitions-Pakete --- */

.packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.package {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
button.package-image { display: block; padding: 0; border: 0; background: none; }
.package-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
}
.package-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.package-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); max-width: 780px; }

.bell { position: relative; min-width: 38px; padding: 6px 8px; }
.bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.package .actions { margin-top: auto; }

/* --- Vorschau für die Admin-Leitung --- */

.preview-panel {
  position: fixed;
  inset: 60px 16px auto auto;
  width: min(320px, calc(100vw - 32px));
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
.preview-panel h2 { margin-bottom: 6px; font-size: 16px; }
.preview-panel .primary { width: 100%; }
.preview-rights { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.preview-rights .check { margin: 0; }
.check:has(input:disabled), .check:has(input:disabled) input { opacity: .5; cursor: default; }
.check:has(input:disabled):hover { border-color: var(--border); }
button.preview-active { border-color: var(--yellow); color: var(--yellow); }

.preview-banner {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #3a2f0b;
  color: #ffe08a;
  font-size: 14px;
}
.preview-banner span { flex: 1; }
.preview-banner button { min-height: 30px; padding: 3px 12px; }

/* --- Fraktionen --- */

.faction-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* --- Fight-Tracking --- */

.fights { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.fight { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-lg); background: var(--panel); }
.fight-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fight-head h2 { font-size: 16px; overflow-wrap: anywhere; }
.fight-slots { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.fight-bar { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.fight-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.fight-people { list-style: none; margin: 0; padding: 0; }
.fight-people li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.fight-people li:first-child { border-top: 0; }
.fight-empty { margin: 0; }
.fight-actions { justify-content: flex-start; }
.fight-actions select.fight-result { width: auto; min-height: 36px; }

/* --- Abmeldungen und Beschwerden --- */

.absence-group { margin-bottom: 22px; }
.absence-group > h2 { margin-bottom: 10px; font-size: 15px; color: var(--muted); }
.applicant .package-pills { margin-bottom: 8px; }

.complaints { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
video.clip { display: block; width: 100%; max-height: 360px; margin-bottom: 10px; border-radius: var(--radius); background: #000; }
.clip-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}
.clip-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-link:hover span { text-decoration: underline; }
.complaint-text { margin-bottom: 8px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 140px;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.dropzone .icon { color: var(--accent); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.filled { align-items: stretch; cursor: default; }
.dropzone.filled video.clip { margin-bottom: 8px; }
.dropzone-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; text-align: left; }
.dropzone-file span { min-width: 0; overflow-wrap: anywhere; }

/* --- Preisliste --- */

.price-group { margin-bottom: 18px; }
.price-group h2 { margin-bottom: 8px; font-size: 15px; color: var(--muted); }
td.right, th.right { text-align: right; }
.price-toolbar { display: flex; gap: 8px; max-width: 560px; }
.price-toolbar select { width: auto; flex-shrink: 0; }
button.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 0;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}
button.sort-button:hover { color: var(--text); }
button.sort-button.active { color: var(--accent); }
.sort-arrow { font-size: 13px; opacity: .6; }
.sort-button.active .sort-arrow { opacity: 1; }
.money { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: middle;
}
.money.black::before { background: #8a8d96; box-shadow: 0 0 0 2px #2b2c31, 0 0 0 3px #8a8d96; }
.money.green::before { background: var(--green); }

/* --- Lager --- */

.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.box { display: flex; flex-direction: column; padding: 14px; border-radius: var(--radius-lg); background: var(--panel); }
.box-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.box-title { flex: 1; min-width: 0; }
.box-title h2 { font-size: 15px; overflow-wrap: anywhere; }
button.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: transparent;
  background: none;
  color: var(--muted);
}
button.icon-button:hover:not(:disabled) { border-color: var(--border); color: var(--text); }
button.icon-button.danger:hover:not(:disabled) { color: #ff8a80; }

.box-items { list-style: none; margin: 0 0 10px; padding: 0; }
.box-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.box-items li:first-child { border-top: 0; }
.box-item-name { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.stepper { display: flex; align-items: center; flex-shrink: 0; }
.stepper button {
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 0;
}
.stepper button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stepper button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper button.stepper-value {
  min-width: 56px;
  border-left: 0;
  border-right: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.box-empty { margin-bottom: 10px; }
.box-item-qty { flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.box-add { display: flex; gap: 6px; margin-top: auto; }
.box-add input { min-height: 34px; }
.box-add input.amount { width: 84px; flex-shrink: 0; }
.box-add button { display: grid; place-items: center; min-width: 38px; min-height: 34px; padding: 0; }

.webhook-switch { min-height: 30px; margin: 0 0 0 auto; padding: 3px 10px 3px 8px; font-size: 13px; }

/* --- Webhooks --- */

.card.webhook { max-width: 620px; }
.webhook-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.card.webhook h2 { margin-bottom: 0; }

/* --- Konto --- */

.card {
  max-width: 460px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.card h2 { margin-bottom: 14px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* --- Dialog --- */

dialog {
  width: calc(100% - 32px);
  max-width: 520px;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}
dialog.wide { max-width: 1040px; }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 18px 20px; }
.intro { margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.modal-foot .spacer { flex: 1; }

.secret {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.secret code { flex: 1; font: 600 16px Consolas, 'Courier New', monospace; overflow-wrap: anywhere; user-select: all; }

.section-title { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }

#toast {
  position: fixed;
  inset: auto 16px 16px auto;
  margin: 0;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
}
#toast.error { border-color: #ff8a80; color: #ffb4ab; }

/* --- Schmale Fenster: Menü wandert nach oben --- */

@media (max-width: 900px) {
  .shell { display: block; height: auto; }
  .content { overflow: visible; border-radius: 0; }
  nav { display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 0 12px 10px; overflow: visible; }
  .nav-group { display: contents; }
  .nav-label { display: none; }
  nav a { gap: 8px; margin: 0; padding: 6px 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
}

/* --- Handy --- */

@media (max-width: 760px) {
  main { padding: 16px; }
  .who-name, .logout-text { display: none; }
  .topbar { padding: 8px 12px; }
  .whoami { gap: 6px; }
  .tiles, .tiles.three { grid-template-columns: repeat(2, 1fr); }
  .toolbar { max-width: none; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .applicants, .packages, .boxes, .complaints, .fights { grid-template-columns: 1fr; }
  .widgets { grid-template-columns: minmax(0, 1fr); }
  .widget { min-height: 0; }

  thead { display: none; }
  table, tbody, tr, td { display: block; }
  tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  tr:last-child { border-bottom: 0; }
  td { padding: 4px 0; border: 0; }
  td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    color: var(--muted);
  }
  .actions { justify-content: flex-start; padding-top: 6px; }
  td.right { text-align: left; }
  .price-toolbar { flex-direction: column; }
  .price-toolbar select { width: 100%; }
}
