/* Unternehmen Plus – Corporate Design nach WJD-Designguide 2022
   Blau #003594 · Türkis #47D7AC · Rot #F9423A · Gelb #FFB81C · Grau #A2AAAD
   Überschriften: Chivo · Fließtext: Bitter */

:root {
  --wj-blue:   #003594;
  --wj-blue-d: #012a76;
  --wj-blue-l: #0b4396;
  --wj-teal:   #47D7AC;
  --wj-teal-d: #2fb992;
  --wj-red:    #F9423A;
  --wj-yellow: #FFB81C;
  --wj-grey:   #A2AAAD;
  --wj-grey-l: #eef1f3;
  --ink:       #17202b;
  --muted:     #667079;
  --line:      #e2e7ec;
  --bg:        #f5f7f9;
  --white:     #fff;
  --radius:    12px;
  --shadow:    0 2px 10px rgba(0,32,90,.07);
  --shadow-lg: 0 10px 30px rgba(0,32,90,.13);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Bitter", Georgia, serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}
h1, h2, h3, h4, .head { font-family: "Chivo", "Segoe UI", sans-serif; font-weight: 700; line-height: 1.15; }
a { color: var(--wj-blue); }
img { max-width: 100%; }

/* ---------- Layout shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex: 0 0 244px;
  background: var(--wj-blue);
  color: #dbe4f5;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  transition: width .2s ease, flex-basis .2s ease, transform .25s ease;
}
.sidebar__brand { padding: 20px 18px 14px; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.sidebar__brand img { width: 40px; height: 40px; background: #fff; border-radius: 9px; padding: 4px; }
.sidebar__brand span { font-family: "Chivo", sans-serif; font-weight: 700; color: #fff; font-size: 18px; }
/* Navigation füllt den Platz zwischen Brand und Fuß und scrollt bei Bedarf intern. */
.nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: 9px;
  color: #cdd8ee; text-decoration: none; font-family: "Chivo", sans-serif; font-size: 15px;
}
.nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav a.active { background: var(--wj-teal); color: #04263f; font-weight: 700; }
.nav a .ic { width: 18px; text-align: center; }
.nav__group { padding: 13px 13px 4px; font-family: "Chivo", sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #8098c6; }
.nav > .nav__group:first-child { padding-top: 4px; }
.app.nav-collapsed .nav__group { display: none; }
.sidebar__foot { margin-top: auto; padding: 14px 16px; font-size: 12px; color: #9fb2d6; border-top: 1px solid rgba(255,255,255,.12); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--white); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  position: sticky; top: 0; z-index: 5;
}
.topbar__title { font-family: "Chivo", sans-serif; font-weight: 700; font-size: 19px; }
.topbar__user { display: flex; align-items: center; gap: 12px; font-size: 14px; min-width: 0; }
.topbar__profile { display: inline-flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; color: var(--ink); }
.topbar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-role { background: var(--wj-grey-l); color: var(--wj-blue); padding: 3px 10px; border-radius: 20px; font-size: 12px; font-family: "Chivo",sans-serif; font-weight: 700; }
.content { padding: 26px 24px 60px; max-width: 1180px; width: 100%; }

/* ---------- Sidebar: Ein-/Ausklappen (Rail) + Burger ---------- */
.sidebar__brand span,
.nav a .lbl,
.sidebar__foot { transition: opacity .12s ease; }

/* Burger / Toggle in der Topbar */
.nav-toggle {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-right: 6px;
  background: transparent; border: 1px solid var(--line); border-radius: 9px;
  color: var(--wj-blue); cursor: pointer; padding: 0;
}
.nav-toggle:hover { background: var(--wj-grey-l); border-color: var(--wj-blue); }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ""; display: block; width: 20px; height: 2px; border-radius: 2px;
  background: currentColor; position: relative;
}
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after  { position: absolute; top: 6px; }

/* Desktop eingeklappt: schmale Leiste, nur größere Icons + Tooltips */
.app.nav-collapsed .sidebar { width: 74px; flex-basis: 74px; }
.app.nav-collapsed .sidebar__brand { justify-content: center; padding: 20px 0 14px; }
.app.nav-collapsed .sidebar__brand span { display: none; }
.app.nav-collapsed .nav a { justify-content: center; gap: 0; padding: 12px 0; }
.app.nav-collapsed .nav a .lbl { display: none; }
.app.nav-collapsed .nav a .ic { width: auto; font-size: 24px; }
.app.nav-collapsed .sidebar__foot { display: none; }

/* Off-Canvas-Overlay (nur mobil sichtbar geschaltet) */
.nav-overlay { display: none; }

/* ---------- Toast (Installations-Hinweis u. a.) ---------- */
.toast-host {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 60; width: min(440px, calc(100% - 24px));
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--wj-teal);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px 14px 14px 16px;
  font-size: 14px; animation: toast-in .28s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.toast.is-hiding { animation: toast-out .2s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(14px); } }
.toast__icon { font-size: 24px; line-height: 1.1; }
.toast__body { flex: 1 1 auto; min-width: 0; }
.toast__body strong { display: block; font-family: "Chivo", sans-serif; font-size: 15px; color: var(--ink); }
.toast__body span { color: var(--muted); }
.toast__actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.toast__close {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px;
}
.toast__close:hover { color: var(--ink); }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__body { padding: 18px 20px; }
.card__head { padding: 15px 20px; border-bottom: 1px solid var(--line); font-family: "Chivo",sans-serif; font-weight: 700; }

/* Einklappbare Karten: <details class="card collapse"> mit <summary class="collapse__head"> */
.collapse > summary { list-style: none; cursor: pointer; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: "Chivo",sans-serif; font-weight: 700; }
.collapse > summary::-webkit-details-marker { display: none; }
.collapse > summary::marker { content: ""; }
.collapse[open] > summary { border-bottom: 1px solid var(--line); }
.collapse__title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.collapse__chev { color: var(--muted); font-size: 12px; transition: transform .15s ease; }
.collapse[open] .collapse__chev { transform: rotate(90deg); }
.collapse__info { font-weight: 400; font-size: 13px; color: var(--muted); }

/* Filter: bereits (vom aktuellen Nutzer) bewertete Pläne ausblenden */
table.hide-evaluated tr[data-evaluated="1"] { display: none; }
.toggle-eval { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; color: var(--ink); }

.stat { position: relative; overflow: hidden; }
.stat .n { font-family: "Chivo",sans-serif; font-weight: 700; font-size: 38px; color: var(--wj-blue); line-height: 1; }
.stat .l { color: var(--muted); font-size: 14px; margin-top: 6px; }
.stat .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--wj-teal); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: "Chivo",sans-serif; font-weight: 700; font-size: 15px;
  padding: 10px 18px; border-radius: 9px; border: 1px solid transparent; text-decoration: none;
}
.btn--primary { background: var(--wj-blue); color: #fff; }
.btn--primary:hover { background: var(--wj-blue-d); }
.btn--teal { background: var(--wj-teal); color: #04263f; }
.btn--teal:hover { background: var(--wj-teal-d); }
.btn--ghost { background: #fff; color: var(--wj-blue); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--wj-blue); }
.btn--danger { background: var(--wj-red); color: #fff; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn.is-loading { cursor: progress; opacity: .92; }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: uplus-spin .7s linear infinite; vertical-align: -2px;
}
@keyframes uplus-spin { to { transform: rotate(360deg); } }

/* ---------- Modal + Progress ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(4,26,64,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: 24px; width: 100%; max-width: 460px; }
.modal h3 { margin: 0 0 14px; font-family: "Chivo", sans-serif; }
.progress { height: 12px; background: var(--wj-grey-l); border-radius: 20px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--wj-teal); width: 0; transition: width .25s ease; }
.progress__label { margin: 10px 0 0; font-size: 14px; }

/* ---------- PDF-Vorschau im Modal ---------- */
.modal--pdf {
  max-width: min(1000px, 100%); width: 100%;
  padding: 0; display: flex; flex-direction: column;
  height: min(90vh, 100%); max-height: 90vh; overflow: hidden;
}
.pdf-modal__head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
}
.pdf-modal__head h3 {
  margin: 0; flex: 1; min-width: 0; font-size: 17px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pdf-modal__actions { display: flex; gap: 8px; flex-shrink: 0; }
.pdf-modal__body { flex: 1; min-height: 0; background: #33404e; }
.pdf-modal__body iframe { width: 100%; height: 100%; border: 0; display: block; }
.pdf-link { color: var(--ink); text-decoration: none; cursor: pointer; }
.pdf-link:hover { color: var(--wj-blue); text-decoration: underline; }

/* ---------- Forms ---------- */
label { display: block; font-family: "Chivo",sans-serif; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: #33404e; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 15px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--wj-blue); box-shadow: 0 0 0 3px rgba(0,53,148,.12); }
.field { margin-bottom: 16px; }
.help { color: var(--muted); font-size: 13px; margin-top: 5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px 0; }
.table-search { max-width: 340px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; font-family: inherit; font-size: 14px; }
.table-search:focus { outline: none; border-color: var(--wj-blue); box-shadow: 0 0 0 3px rgba(0,53,148,.12); }
.table-count { color: var(--muted); font-size: 13px; }
table.data th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.data th.sortable:hover { color: var(--wj-blue); }
table.data th .sort-ind { opacity: .35; font-size: 11px; margin-left: 5px; }
table.data th.sort-asc .sort-ind, table.data th.sort-desc .sort-ind { opacity: 1; color: var(--wj-blue); }
table.data th.sort-asc .sort-ind::after { content: "▲"; }
table.data th.sort-desc .sort-ind::after { content: "▼"; }
table.data th.sort-asc .sort-ind, table.data th.sort-desc .sort-ind { font-size: 0; }
table.data th.sort-asc .sort-ind::after, table.data th.sort-desc .sort-ind::after { font-size: 11px; }
table.data { width: 100%; border-collapse: collapse; background: #fff; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { font-family: "Chivo",sans-serif; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
table.data tr:hover td { background: #fafcfe; }

/* Sponsor-Zelle: Logo (wenn vorhanden) + Name zusammen in der ersten Spalte. */
.sponsor-cell { display: flex; align-items: center; gap: 12px; }
.sponsor-cell__logo {
  flex: 0 0 auto; width: 48px; height: 40px; object-fit: contain;
  border-radius: 8px; background: #fff; border: 1px solid var(--line);
  padding: 3px;
}
.sponsor-cell__logo--empty {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Chivo",sans-serif; font-weight: 700; font-size: 16px;
  color: var(--muted); background: var(--wj-grey-l);
}

/* ---------- Pills ---------- */
.pill { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12px; font-family: "Chivo",sans-serif; font-weight: 700; }
.pill.muted { background: var(--wj-grey-l); color: var(--muted); }
.pill.blue  { background: #e2ecff; color: var(--wj-blue); }
.pill.teal  { background: #d9f6ec; color: var(--wj-teal-d); }
.pill.amber { background: #fff2d6; color: #a9760a; }
.pill.red   { background: #ffe1df; color: #c22c25; }
.pill-select { border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; font-size: 12px; font-family: "Chivo",sans-serif; font-weight: 700; background: #fff; color: var(--wj-blue); cursor: pointer; }
.pill-select:focus { outline: none; border-color: var(--wj-blue); box-shadow: 0 0 0 3px rgba(0,53,148,.12); }

/* ---------- Flash ---------- */
.flash { padding: 13px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash.success { background: #e7f8f0; border-color: #b7e8d2; color: #1a7a52; }
.flash.error   { background: #ffe8e6; border-color: #ffc4bf; color: #b32a22; }
.flash.info    { background: #e7efff; border-color: #c3d6ff; color: var(--wj-blue); }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-wrap: wrap; gap: 10px; }
.tl-step { flex: 1 1 120px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; position: relative; }
.tl-step .ph { font-family: "Chivo",sans-serif; font-weight: 700; font-size: 14px; }
.tl-step .dt { color: var(--muted); font-size: 12px; }
.tl-step.done { border-left: 4px solid var(--wj-teal); }
.tl-step.active { border-left: 4px solid var(--wj-blue); background: #f2f7ff; }
.tl-step.upcoming { border-left: 4px solid var(--wj-grey); opacity: .8; }
.tl-step .tick { position: absolute; top: 10px; right: 12px; font-size: 12px; color: var(--wj-teal-d); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
/* Login-Hero: falls assets/img/pitch-day.jpg vorhanden ist, scheint das Foto
   unter dem blauen WJ-Verlauf durch; sonst greift nur der Verlauf. */
.login-hero {
  background:
    linear-gradient(160deg, rgba(0,53,148,.90) 0%, rgba(1,42,118,.94) 70%),
    url("../img/pitch-day.jpg") center/cover no-repeat,
    linear-gradient(160deg, var(--wj-blue) 0%, var(--wj-blue-d) 70%);
  color: #fff; padding: 54px 50px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.login-hero__circle { position: absolute; width: 340px; height: 340px; border-radius: 50%; background: var(--wj-red); opacity: .16; right: -90px; top: -70px; }
.login-hero__bar { display: inline-block; background: var(--wj-teal); color: #04263f; font-family: "Chivo",sans-serif; font-weight: 700; padding: 6px 14px; border-radius: 4px; margin-bottom: 18px; }
.login-hero h1 { font-size: 40px; margin: 0 0 12px; }
.login-hero p { color: #cbd8f0; max-width: 420px; }
.login-hero__logo { width: 76px; height: 76px; background: #fff; border-radius: 16px; padding: 8px; margin-bottom: 26px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-form .inner { width: 100%; max-width: 360px; }
.login-form h2 { margin: 0 0 4px; }
.login-form .sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }

/* ---------- Misc ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; }
.muted { color: var(--muted); }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.partner-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.partner-bar img { height: 34px; width: auto; filter: grayscale(1); opacity: .7; }
.partner-bar img:hover { filter: none; opacity: 1; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ic { font-size: 34px; }

@media (max-width: 900px) {
  /* Sidebar wird zum Off-Canvas-Drawer, per Burger geöffnet. */
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 45;
    width: 264px; flex-basis: 264px; height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: translateX(0); }

  /* Rail-Modus mobil neutralisieren: im Drawer immer volle Breite + Labels. */
  .app.nav-collapsed .sidebar { width: 264px; flex-basis: 264px; }
  .app.nav-collapsed .sidebar__brand { justify-content: flex-start; padding: 20px 18px 14px; }
  .app.nav-collapsed .sidebar__brand span { display: inline; }
  .app.nav-collapsed .nav a { justify-content: flex-start; gap: 11px; padding: 12px 14px; }
  .app.nav-collapsed .nav a .lbl { display: inline; }
  .app.nav-collapsed .sidebar__foot { display: block; }

  /* Abdunkelnder Hintergrund hinter dem Drawer. */
  .app.nav-open .nav-overlay {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(4,20,50,.5);
  }

  /* Icons mobil etwas größer, komfortablere Touch-Ziele. */
  .nav a { padding: 12px 14px; font-size: 16px; }
  .nav a .ic { width: 24px; font-size: 22px; }

  .grid.cols-4 { grid-template-columns: repeat(2,1fr); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

/* ---------- Bild-Ablage (Drag & Drop) + Avatare ---------- */
.imgdrop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--wj-grey-l);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.imgdrop:hover,
.imgdrop:focus-visible { border-color: var(--wj-blue-l); outline: none; }
.imgdrop.is-drag { border-color: var(--wj-teal); background: #eafaf4; }
.imgdrop__img { max-height: 140px; max-width: 100%; object-fit: contain; border-radius: 8px; }
.imgdrop--round .imgdrop__img {
  width: 120px; height: 120px; object-fit: cover; border-radius: 50%;
}
.imgdrop__placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); font-size: 14px;
}
.imgdrop__icon { font-size: 26px; line-height: 1; }
.imgdrop__hint { max-width: 260px; }
.imgdrop__clear {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: rgba(23,32,43,.6); color: #fff; font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.imgdrop__clear:hover { background: var(--wj-red); }

/* Avatare (Nutzerliste, Topbar, Profil) */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: var(--wj-grey-l); flex: 0 0 auto;
}
.avatar--sm { width: 28px; height: 28px; }
.avatar--lg { width: 72px; height: 72px; }
.avatar--ph {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wj-blue); color: #fff; font-family: "Chivo", sans-serif;
  font-weight: 700; font-size: 16px;
}
.avatar--lg.avatar--ph { font-size: 28px; }

/* ---------- Zuschnitt-Dialog ---------- */
body.modal-open { overflow: hidden; }
.crop-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(1,20,58,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.crop-modal[hidden] { display: none; }
.crop-modal__box {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: min(560px, 100%);
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
}
.crop-modal__head {
  padding: 14px 18px; font-family: "Chivo", sans-serif; font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.crop-modal__stage {
  background: #101a2b; max-height: 60vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.crop-modal__stage img { max-width: 100%; display: block; }
.crop-modal__tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--line);
}
.crop-modal__tools button {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); cursor: pointer; font-size: 17px; line-height: 1;
}
.crop-modal__tools button:hover { border-color: var(--wj-blue-l); background: var(--wj-grey-l); }
.crop-modal__tools input[type="range"] { flex: 1; min-width: 100px; }
.crop-modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line);
}

/* ---------- Formular-Dialoge (Neu/Ändern) ---------- */
.modal-overlay[hidden] { display: none; }
.modal-overlay { animation: modal-fade .16s ease; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal--form { display: flex; flex-direction: column; max-width: 560px; max-height: calc(100vh - 40px); padding: 0; overflow: hidden; animation: modal-pop .2s cubic-bezier(.16,.84,.44,1); }
.modal--form.modal--wide { max-width: 720px; }
@keyframes modal-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.modal__head h3 { margin: 0; font-size: 19px; }
.modal__close { flex: 0 0 auto; background: none; border: 0; cursor: pointer; font-size: 26px; line-height: 1; color: var(--muted); width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.modal__close:hover { background: var(--wj-grey-l); color: var(--ink); }
.modal__body { padding: 20px 22px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 0 0; margin-top: 6px; border-top: 1px solid var(--line); }
.modal__body .field:last-of-type { margin-bottom: 4px; }

/* Bestätigungs-Dialog */
.modal--confirm { max-width: 420px; animation: modal-pop .2s cubic-bezier(.16,.84,.44,1); }
.modal--confirm h3 { display: flex; align-items: center; gap: 10px; }
.modal--confirm p { margin: 0 0 22px; color: #3a4655; }
.modal--confirm .modal__foot { border: 0; padding: 0; margin: 0; }

/* =====================================================================
   Mobile-First-Politur: Listen als Karten + Dialoge als Bottom-Sheet
   ===================================================================== */

/* Stammdaten-Listen (table.data--cards) werden auf schmalen Screens zu
   gestapelten Karten – kein horizontales Scrollen, Aktionen als volle
   Touch-Buttons, Spaltennamen als Labels (data-label). */
@media (max-width: 680px) {
  .data--cards { min-width: 0; }
  .data--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data--cards, .data--cards tbody, .data--cards tr, .data--cards td { display: block; width: auto; }
  .data--cards tr { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; padding: 4px 0; background: #fff; }
  .data--cards tr:hover td { background: transparent; }
  /* Äußere Card flach, damit nur die Zeilen-Karten wirken (kein Rahmen im Rahmen) */
  .card:has(.data--cards) { border: 0; box-shadow: none; background: transparent; }
  .card:has(.data--cards) > .card__head { padding: 2px 2px 12px; border: 0; color: var(--muted); font-family: "Chivo",sans-serif; font-weight: 700; font-size: 14px; }
  .card:has(.data--cards) .table-wrap { overflow: visible; }
  .data--cards td { border: 0; padding: 7px 16px; text-align: left; white-space: normal; }
  .data--cards td[data-label]::before {
    content: attr(data-label); display: block;
    font-family: "Chivo", sans-serif; font-weight: 700; font-size: 11px;
    text-transform: uppercase; letter-spacing: .3px; color: var(--muted); margin-bottom: 2px;
  }
  /* Leere Führungszelle (Logo) ohne Bild nicht als leerer Block zeigen */
  .data--cards td.cell-media:empty { display: none; }
  .data--cards td.cell-media { padding-top: 12px; }
  /* Aktionszelle: Buttons als volle, gut tippbare Reihe */
  .data--cards td.row-actions {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 4px; padding: 12px 14px; border-top: 1px solid var(--line);
    text-align: left;
  }
  .data--cards td.row-actions > .btn,
  .data--cards td.row-actions > form { flex: 1 1 auto; }
  .data--cards td.row-actions form { display: flex !important; }
  .data--cards td.row-actions form .btn { flex: 1 1 auto; }
  .data--cards td.row-actions .btn { justify-content: center; min-height: 42px; }
  /* Reine Icon-Buttons (×, 👁) bleiben schmal statt volle Breite */
  .data--cards td.row-actions > .btn--icon { flex: 0 0 auto; min-width: 46px; }
  .data--cards td[colspan] { text-align: center; }
  /* Zusammengehörige Unterzeile (z. B. „Status setzen" im Ranking, Jury-Details)
     schließt direkt an die Hauptzeilen-Karte an, statt eine eigene Karte zu bilden. */
  .data--cards tr:has(+ .admin-row), .data--cards tr:has(+ .subrow) { margin-bottom: 0; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
  .data--cards tr.admin-row, .data--cards tr.subrow { margin-top: 0; border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
  .data--cards tr.admin-row > td[colspan] { text-align: left; padding-top: 6px; }
  .data--cards tr.admin-row form { flex-wrap: wrap; justify-content: flex-start !important; }
  /* Suchleiste über Karten-Listen volle Breite */
  .table-toolbar { flex-wrap: wrap; }
  .table-search { max-width: none; flex: 1 1 100%; }
}

/* Topbar mobil entschlacken: Titel steht ohnehin als H1 auf der Seite. */
@media (max-width: 600px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar__title { display: none; }
  .topbar__user { gap: 8px; }
  .topbar .badge-role { display: none; }
  .topbar__name { display: none; }
  .topbar__user .btn { flex: 0 0 auto; }
}

/* Formular-/Bestätigungs-Dialoge als Bottom-Sheet auf dem Handy. */
@media (max-width: 600px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal--form {
    max-width: none; width: 100%; max-height: 92vh;
    border-radius: 18px 18px 0 0; animation: sheet-up .26s cubic-bezier(.16,.84,.44,1);
  }
  @keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
  .modal__head { position: sticky; top: 0; background: #fff; z-index: 1; }
  .modal--form .modal__foot {
    position: sticky; bottom: 0; background: #fff;
    padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px));
    margin: 0 -22px -20px; border-top: 1px solid var(--line);
  }
  .modal--form .modal__foot .btn { flex: 1 1 auto; justify-content: center; min-height: 46px; }
  .modal--confirm {
    max-width: none; width: 100%;
    border-radius: 18px 18px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    animation: sheet-up .26s cubic-bezier(.16,.84,.44,1);
  }
  .modal--confirm .modal__foot { flex-wrap: wrap; }
  .modal--confirm .modal__foot .btn { flex: 1 1 auto; justify-content: center; min-height: 46px; }
}

/* ---------- Kompakte Listen (dichte Übersichten, z. B. Businesspläne) ---------- */
.show-sm-inline, .show-sm { display: none; }
table.hide-weak tr[data-weak="1"] { display: none; }
@media (max-width: 680px) {
  .show-sm-inline { display: inline-block; }
  .show-sm { display: block; }
  .hide-sm { display: none; }
  /* data--compact: eine dichte Zeile je Eintrag (Name links, Aktion rechts) */
  .data--compact thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data--compact, .data--compact tbody { display: block; }
  .data--compact tr { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; background: #fff; }
  .data--compact tr:hover td { background: transparent; }
  table.data--compact td { padding: 0; border: 0; white-space: normal; }
  .data--compact td::before { content: none !important; }
  .data--compact td.hide-sm { display: none; }
  .data--compact td.col-primary { flex: 1 1 auto; min-width: 0; }
  .data--compact td.col-primary strong { font-size: 15px; }
  .data--compact td.row-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; border: 0; }
  .data--compact td.row-actions .btn { min-height: 38px; }
  .data--compact td.row-actions .btn--sm { padding: 8px 12px; }
  .data--compact td[colspan] { flex: 1 1 100%; text-align: center; padding: 14px; }
  .data--compact .pill { font-size: 11px; }
}

/* Sicherheitsnetz gegen versehentlichen horizontalen Seiten-Scroll (Mobile) */
input[type="file"] { max-width: 100%; }
.content { overflow-x: clip; }
