/* ============================================================
   profimedien toolbox – app.css
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --brand-primary: #A6324D;
  --brand-secondary: #F45E48;
  --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);

  --bg: #f4f5f8;
  --card: #ffffff;
  --text: #111827;
  --text-soft: #374151;
  --muted: #6b7280;
  --muted-light: #9ca3af;

  --ok: #059669;
  --ok-bg: #d1fae5;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #dbeafe;

  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 14px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #64748b;
  --sidebar-active-bg: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  --sidebar-hover-bg: rgba(255,255,255,.06);
  --sidebar-border: rgba(255,255,255,.06);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--brand-secondary); }
img { max-width: 100%; }

/* ---- Layout shell ---- */
.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0,1fr);
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar-head { padding: 24px 18px 12px; }
.brand { display: block; text-decoration: none; }
.brand:hover { text-decoration: none; opacity: .9; }
.brand-logo { width: 100%; max-width: 200px; height: auto; display: block; }
.sidebar-user {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-user-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted); font-weight: 700; }
.sidebar-user-name { font-size: 14px; font-weight: 600; color: #e2e8f0; }
.sidebar-badge {
  display: inline-block;
  width: fit-content;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  padding: 2px 10px;
  color: #94a3b8;
  letter-spacing: .04em;
}

.side-nav {
  padding: 8px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-nav-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sidebar-muted);
  padding: 14px 10px 4px;
}
.side-nav a {
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.side-nav a .bi { font-size: 16px; flex-shrink: 0; }
.side-nav a:hover {
  text-decoration: none;
  background: var(--sidebar-hover-bg);
  color: #e2e8f0;
}
.side-nav a.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 4px 14px rgba(244,94,72,.25);
}

.side-subnav {
  margin: 2px 0 4px 38px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.side-subnav a {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  padding: 7px 10px;
  border-radius: 6px;
}
.side-subnav a .bi { font-size: 13px; }
.side-subnav a:hover { background: rgba(255,255,255,.05); color: #cbd5e1; text-decoration: none; }
.side-subnav a.active-sub { color: #e2e8f0; background: rgba(255,255,255,.07); }

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 18px;
  border-top: 1px solid var(--sidebar-border);
}
.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.logout-btn:hover { text-decoration: none; background: rgba(255,255,255,.06); color: #e2e8f0; }

/* ---- Content area ---- */
.content-area { min-width: 0; background: var(--bg); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 28px; }
.content-area .wrap { margin: 0; max-width: none; }

/* ---- Page header ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.page-header .page-header-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-sm { padding: 16px; border-radius: var(--radius); }
.card h2 { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.primary { background: rgba(166,50,77,.1); color: var(--brand-primary); }
.stat-icon.success { background: var(--ok-bg); color: var(--ok); }
.stat-icon.warning { background: var(--warn-bg); color: var(--warn); }
.stat-icon.info { background: var(--info-bg); color: var(--info); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -.03em; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 3px; }

/* ---- Grid ---- */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }

/* ---- Typography ---- */
h1 { font-size: 26px; font-weight: 800; margin: 0 0 20px; letter-spacing: -.02em; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 16px; }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.small { color: var(--muted); font-size: 13px; }
.text-muted { color: var(--muted); }
.mono { font-family: "SFMono-Regular", Menlo, monospace; }

/* ---- Forms ---- */
form { display: grid; gap: 14px; }
label { font-weight: 600; font-size: 14px; display: grid; gap: 5px; }
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}
.check-row input[type="checkbox"],
.check-row input[type="radio"] { width: auto; margin: 0; accent-color: var(--brand-primary); }
/* ── Angle-Kacheln ──────────────────────────────────────────────────────── */
.angle-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.angle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px 11px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  user-select: none;
  background: var(--bg);
}
.angle-card:hover {
  border-color: #c9a0ad;
  box-shadow: 0 2px 8px rgba(166,50,77,.10);
}
.angle-card--checked {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(166,50,77,.12);
  background: rgba(166,50,77,.03);
}
.angle-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.angle-card-check {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .15s, transform .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.angle-card--checked .angle-card-check {
  opacity: 1;
  transform: scale(1);
}
.angle-card-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  padding-right: 18px; /* Platz für Check-Badge */
}
.angle-card-desc {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted, #6b7280);
  line-height: 1.35;
}

/* Legacy (wird nicht mehr gerendert, schadet aber nicht) */
.angle-row { align-items: flex-start; gap: 9px; }
.angle-row input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.angle-label { display: flex; flex-direction: column; gap: 1px; font-weight: 400; }
.angle-title { font-weight: 700; font-size: 13px; line-height: 1.35; }
.angle-desc { font-size: 12px; font-weight: 400; color: var(--text-muted, #6b7280); line-height: 1.35; }

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
textarea,
select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(166,50,77,.12);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
select { height: 44px; }
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .1s, opacity .15s;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .bi { font-size: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(166,50,77,.25);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(166,50,77,.35); color: #fff; }

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-soft);
  border-color: var(--border);
}
.btn-secondary:hover { background: #e2e8f0; color: var(--text); }

.btn-success {
  background: var(--ok);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5,150,105,.25);
}
.btn-success:hover { background: #047857; color: #fff; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220,38,38,.2);
}
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-soft);
}
.btn-outline:hover { background: #f1f5f9; }

.btn-outline-danger-soft {
  background: transparent;
  color: var(--danger);
  border-color: rgba(220,38,38,.3);
}
.btn-outline-danger-soft:hover { background: var(--danger-bg); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-sm .bi { font-size: 13px; }

.btn-lg {
  padding: 13px 22px;
  font-size: 15px;
  border-radius: var(--radius);
}

/* ── Template card picker (Bild-Vorlagen) ─────────────────────── */
.tpl-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tpl-label-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.tpl-label-link {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tpl-label-link:hover { color: var(--brand-primary); }

.tpl-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.tpl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
  user-select: none;
}
.tpl-card:hover {
  border-color: #c9a0ad;
  box-shadow: 0 2px 8px rgba(166,50,77,.12);
}
.tpl-card--checked {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(166,50,77,.12);
}

.tpl-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.tpl-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  overflow: hidden;
  flex-shrink: 0;
}
.tpl-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tpl-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #cbd5e1;
}
.tpl-card-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0;
  transition: opacity .15s, transform .15s;
  transform: scale(.7);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.tpl-card--checked .tpl-card-check {
  opacity: 1;
  transform: scale(1);
}

.tpl-card-body {
  padding: 7px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}
.tpl-card-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  word-break: break-word;
}
.tpl-card-refs {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  display: flex;
  align-items: center;
  gap: 3px;
}
/* ── end template card picker ──────────────────────────────────── */

.btn-generator-main {
  width: 100%;
  min-height: 52px;
  justify-content: center;
  font-size: 15px;
  border-radius: var(--radius);
  margin-top: 4px;
}

.btn.is-loading { opacity: .8; cursor: wait; pointer-events: none; }
.btn-link-danger {
  background: transparent;
  border: 0;
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-link-danger:hover { text-decoration: underline; }

/* ---- Flash messages ---- */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}
.flash::before { font-family: "bootstrap-icons"; font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.flash.success {
  background: var(--ok-bg);
  color: #065f46;
  border-color: #a7f3d0;
}
.flash.success::before { content: "\F26A"; color: var(--ok); }
.flash.error {
  background: var(--danger-bg);
  color: #991b1b;
  border-color: #fca5a5;
}
.flash.error::before { content: "\F336"; color: var(--danger); }
.flash.warning {
  background: var(--warn-bg);
  color: #92400e;
  border-color: #fde68a;
}
.flash.warning::before { content: "\F33A"; color: var(--warn); }
.flash.info {
  background: var(--info-bg);
  color: #1e40af;
  border-color: #93c5fd;
}
.flash.info::before { content: "\F431"; color: var(--info); }

/* ---- Tables ---- */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}
th {
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafbfc; }
.table-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-actions form { display: inline; margin: 0; }
.table-actions a { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* ---- Status badges & dots ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}
.badge.ok { background: var(--ok-bg); color: #065f46; }
.badge.no { background: var(--danger-bg); color: #991b1b; }
.badge.change { background: var(--warn-bg); color: #92400e; }
.badge.wait { background: #f1f5f9; color: var(--muted); }
.badge.abort { background: #f1f5f9; color: var(--text-soft); }
.badge.done { background: var(--info-bg); color: #1e40af; }

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.status-dot.active { background: var(--ok); box-shadow: 0 0 0 3px rgba(5,150,105,.18); }
.status-dot.waiting_feedback { background: var(--warn); box-shadow: 0 0 0 3px rgba(217,119,6,.18); }
.status-dot.feedback_received { background: var(--info); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.status-dot.overdue_feedback { background: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.status-dot.closed { background: var(--muted-light); box-shadow: 0 0 0 3px rgba(156,163,175,.18); }

/* ---- Round chips ---- */
.round-quick-list { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.round-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-soft);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.round-chip:hover { text-decoration: none; border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.chip-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.chip-status.ok { background: var(--ok-bg); color: #065f46; }
.chip-status.no { background: var(--danger-bg); color: #991b1b; }
.chip-status.change { background: var(--warn-bg); color: #92400e; }
.chip-status.wait { background: #f1f5f9; color: var(--muted); }
.chip-status.abort { background: #f1f5f9; color: var(--text-soft); }
.chip-status.done { background: var(--info-bg); color: #1e40af; }

.more-rounds summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---- Inline layout ---- */
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.action-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.form-actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.save-row .push-left { margin-right: auto; }
.btn-save { min-height: 42px; padding: 0 20px; }

/* ---- Asset cards ---- */
.asset-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.asset-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.asset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.asset-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-actions { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.file-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-soft);
  background: #fff;
  font-size: 15px;
  transition: border-color .15s, background .15s;
}
.file-actions a:hover { text-decoration: none; border-color: var(--border-hover); background: #f8fafc; }

/* ---- Variant / generator ---- */
.generator-card h2 { margin-bottom: 6px; }
.generator-template-note { margin: 0 0 10px; font-size: 13px; color: var(--muted); }

.variant-head-row { margin-bottom: 10px; }
.variant-top-actions { gap: 8px; margin-left: 10px; align-items: center; }
.variant-top-actions .btn { min-height: 36px; padding: 0 11px; font-size: 13px; }
.variant-provider-select { min-width: 130px; }
.variant-format-options { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.variant-format-options .check-row { font-size: 13px; gap: 5px; }
.variant-output {
  margin-top: 6px;
  font-family: inherit;
  background: #f8fafc;
  border-color: var(--border);
  min-height: 90px;
}
.variant-rendered-image {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: #f8fafc;
}
.variant-rendered-image-item { margin-top: 14px; }
.variant-rendered-image-item:first-of-type { margin-top: 0; }
.variant-version-list { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.variant-version-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-version-delete { padding: 4px 9px; min-height: 30px; font-size: 12px; }

.asset-preview {
  display: block;
  width: min(100%, 960px);
  max-height: 560px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

/* ---- Accordion ---- */
.acc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
}
.acc > summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 16px;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: #f8fafc;
  transition: background .15s;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { background: #f1f5f9; }
.acc-body { padding: 16px; display: grid; gap: 12px; }
.acc-body code {
  display: block;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 13px;
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
}

/* ---- Miscellaneous ---- */
.is-hidden { display: none !important; }
.select-spacer { margin-top: 6px; }
.feedback-heading { margin-top: 26px; }

.logo-upload-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}
.branding-logo-preview { display: block; width: 100%; max-width: 320px; height: auto; }
.branding-logo-preview.white-bg {
  background: #1a2540;
  border-radius: 8px;
  padding: 10px;
}

.decision-row {
  display: grid;
  grid-template-columns: minmax(220px,1fr) minmax(300px,2fr);
  gap: 14px;
}

.placeholder-list { display: flex; flex-wrap: wrap; gap: 8px; }
.placeholder-list code {
  display: inline-block;
  width: auto;
  padding: 4px 10px;
  word-break: normal;
  border-radius: 6px;
  font-size: 12px;
}

/* ---- Lightbox ---- */
.lightbox[hidden] { display: none !important; }
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox img {
  max-width: min(92vw,1300px);
  max-height: 86vh;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
}
.lightbox-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 16px;
  text-align: center;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* ---- Campaign / template media ---- */
.thumb-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.thumb-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.campaign-media-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.campaign-media-item:last-child { border-bottom: 0; }
.campaign-media-actions { display: inline-flex; align-items: center; gap: 8px; }
.campaign-media-actions a { color: var(--brand-primary); font-size: 18px; }

/* ---- User management ---- */
.user-row-actions { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.user-pass-form { flex: 1 1 auto; }
.user-pass-inline { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.user-pass-inline input[type="password"] { min-width: 200px; flex: 1 1 auto; }
.user-delete-form { flex: 0 0 auto; }

/* ---- Template toolbar ---- */
.template-toolbar .template-toolbar-grid { align-items: end; }
.template-toolbar .template-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  width: 100%;
  padding-bottom: 1px;
}
.template-toolbar .template-toolbar-actions .btn { min-height: 44px; }

/* ---- Bulk decision ---- */
.bulk-actions { gap: 10px; margin-bottom: 14px; }

/* ---- Spinner ---- */
.bi-spin { animation: bi-spin .85s linear infinite; }
@keyframes bi-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---- Generator ---- */
#generator-context-bar { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
#generator-context-bar .card { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }

/* ---- Public approval page ---- */
.public-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.public-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  padding-top: 16px;
}
.public-brand a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.public-brand-logo { width: 200px; max-width: 100%; height: auto; display: block; }
.public-footer-html {
  max-width: 860px;
  margin: 28px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px 20px 32px;
  border-top: 1px solid var(--border);
}
.public-footer-html p { margin: 0.3rem 0; }

/* ---- Dashboard activity ---- */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: 0; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-text { flex: 1; min-width: 0; font-size: 14px; }
.activity-text strong { font-weight: 700; }
.activity-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.activity-time { font-size: 12px; color: var(--muted-light); flex-shrink: 0; }

.deadline-list { display: flex; flex-direction: column; }
.deadline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.deadline-item:last-child { border-bottom: 0; }
.deadline-item a { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deadline-date { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; flex-shrink: 0; }
.deadline-date.urgent { background: var(--danger-bg); color: var(--danger); }
.deadline-date.soon { background: var(--warn-bg); color: var(--warn); }
.deadline-date.normal { background: var(--ok-bg); color: var(--ok); }

/* ---- Login page ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(166,50,77,.12) 0, transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(244,94,72,.08) 0, transparent 55%),
    #f4f5f8;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.login-logo { display: block; width: 180px; margin: 0 auto 28px; }
.login-title { font-size: 22px; font-weight: 800; text-align: center; margin: 0 0 6px; }
.login-sub { font-size: 14px; color: var(--muted); text-align: center; margin: 0 0 24px; }

/* ---- Section anchors ---- */
[id] { scroll-margin-top: 16px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }
  .side-nav { flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .side-nav a { padding: 8px 10px; font-size: 13px; }
  .side-subnav { margin-left: 0; border-left: 0; padding-left: 0; flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { padding: 8px 10px 12px; }
  .wrap { padding: 16px; }
  .page-header h1 { font-size: 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .decision-row { grid-template-columns: 1fr; }
  .user-row-actions, .user-pass-inline { flex-wrap: wrap; }
  .user-pass-inline input[type="password"] { min-width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 28px 20px; }
}

/* ── Bild-Kacheln (Generator) ── */
.image-tile {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  width: 180px;
  flex-shrink: 0;
  transition: border-color .15s, box-shadow .15s;
}
.image-tile:hover { border-color: var(--brand-primary); box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.image-tile--in-basket {
  border-color: var(--brand-primary);
  border-width: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 15%, transparent);
}
.image-tile img {
  width: 100%;
  display: block;
  cursor: zoom-in;
}
.image-tile-format {
  position: absolute;
  top: 7px;
  left: 8px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  pointer-events: none;
}
.image-tile-badge {
  position: absolute;
  top: 7px;
  right: 8px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 3px;
}
.image-tile-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}
.image-tile-actions a,
.image-tile-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  transition: background .12s, color .12s;
  text-decoration: none;
}
.image-tile-actions a:hover,
.image-tile-actions button:hover { background: var(--border); color: var(--text); }
.image-tile-meta {
  font-size: 10px;
  color: var(--muted-light);
  padding: 3px 8px 5px;
  background: #f8fafc;
}

/* ── Freigabe-Korb ── */
.basket-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.basket-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}
.basket-type-text  { background: #e8f5e9; color: #2e7d32; }
.basket-type-image { background: #e3f2fd; color: #1565c0; }
#basket-count-badge {
  display: none;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  vertical-align: middle;
}
