
:root{
  --bg:#f3f4f6;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#6b7280;
  --border:#e5e7eb;
  --shadow:0 10px 25px rgba(15,23,42,.08);
  --red:#b80b2b;
  --red2:#d10b33;
  --graybtn:#6b7280;
  --radius:18px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}
a{color:inherit}
.container{max-width:1100px;margin:22px auto;padding:0 14px}
.topbar{
  background:linear-gradient(#ffffff, #fbfbfb);
  border-bottom:1px solid var(--border);
  padding:14px 18px;
  display:flex;align-items:center;justify-content:space-between;
}
.logo img{height:40px;width:auto;display:block}
.topbar-right{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.userchip{padding:8px 12px;border:1px solid var(--border);border-radius:999px;background:#fff}
.userchip .role{color:var(--muted)}
.link{color:var(--muted);text-decoration:none}
.link:hover{color:var(--text);text-decoration:underline}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}
.card h1,.card h2{margin:0 0 14px}
.grid{display:grid;gap:14px}
.grid.two{grid-template-columns:1fr 1fr}
.grid.three{grid-template-columns:1fr 1fr 1fr}
@media (max-width:900px){.grid.two,.grid.three{grid-template-columns:1fr}}

label{display:block;font-weight:650;margin:0 0 6px}
.input, select, textarea{
  width:100%;
  padding:14px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  font-size:16px;
  background:#fff;
  outline:none;
}
textarea{min-height:90px;resize:vertical}
.input:focus, select:focus, textarea:focus{border-color:#cbd5e1; box-shadow:0 0 0 4px rgba(2,132,199,.10)}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:14px 16px;border-radius:16px;
  border:0;cursor:pointer;text-decoration:none;
  font-weight:700;font-size:16px;
}
.btn.small{padding:10px 12px;border-radius:14px;font-size:14px}
.btn.red{background:var(--red);color:#fff}
.btn.red:hover{background:var(--red2)}
.btn.gray{background:var(--graybtn);color:#fff}
.btn.gray:hover{filter:brightness(1.05)}
.btn.outline{background:#fff;border:1px solid var(--border);color:var(--text)}
.btn.outline:hover{background:#f9fafb}
.btn.danger{background:#fff;border:1px solid #fecaca;color:#b91c1c}
.btn.danger:hover{background:#fff5f5}

.actions{display:flex;gap:12px;flex-wrap:wrap}
.actions.sticky{
  position:sticky;bottom:10px;background:rgba(243,244,246,.75);
  padding:10px;border-radius:18px;backdrop-filter: blur(8px);
}

.table{
  width:100%;border-collapse:separate;border-spacing:0 10px;
}
.table th{color:var(--muted);font-size:13px;text-align:left;padding:0 10px}
.row{
  background:#fff;border:1px solid var(--border);
  border-radius:16px;box-shadow:0 6px 18px rgba(15,23,42,.06);
}
.table td{padding:12px 10px;vertical-align:middle}
.badge{padding:6px 10px;border-radius:999px;border:1px solid var(--border);font-size:12px;color:var(--muted);background:#fff}
.badge.ok{border-color:#bbf7d0;color:#166534;background:#f0fdf4}
.badge.arch{border-color:#e5e7eb;color:#6b7280;background:#f9fafb}

.flash{margin:12px 0;padding:12px 14px;border-radius:14px;border:1px solid var(--border);background:#fff}
.flash.ok{border-color:#bbf7d0;background:#f0fdf4;color:#166534}
.flash.err{border-color:#fecaca;background:#fff5f5;color:#991b1b}
.flash.info{border-color:#bae6fd;background:#f0f9ff;color:#0c4a6e}

.kpi{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.kpi .big{font-size:28px;font-weight:800}
.muted{color:var(--muted)}
.footer{padding:28px 16px;text-align:center;color:var(--muted)}

@media (max-width:600px){
  .footer{font-size:13px;line-height:1.35;word-break:break-word;overflow-wrap:anywhere}
  .topbar{padding:12px 14px}
  .logo img{height:32px}
  .userchip{max-width:92vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  /* Tabellen am Handy nicht "rauslaufen" lassen */
  .table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .table th,.table td{white-space:nowrap}
}

.thumb{width:56px;height:56px;border-radius:12px;border:1px solid var(--border);object-fit:cover;background:#fff}
.gallery{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
@media (max-width:900px){.gallery{grid-template-columns:repeat(2,1fr)}}
.gpic{width:100%;aspect-ratio:1/1;border-radius:14px;border:1px solid var(--border);object-fit:cover;background:#fff}
.hr{height:1px;background:var(--border);margin:16px 0}

/* Fold / Akkordeon */
details.fold{border:1px solid var(--border);border-radius:18px;padding:14px 16px;background:#fff}
details.fold > summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:10px}
details.fold > summary::-webkit-details-marker{display:none}
details.fold > summary:after{content:'▾';margin-left:auto;color:var(--muted)}
details.fold[open] > summary:after{content:'▴'}
details.fold.inner{margin-top:10px;border-radius:14px;padding:10px 12px;background:var(--bg)}

/* Dropzone (Foto Upload) */
.dropzone{position:relative;border:2px dashed var(--border);border-radius:16px;padding:18px;background:#fff;cursor:pointer;min-height:72px;display:flex;align-items:center;justify-content:center;text-align:center}
.dropzone.drag{border-color:#94a3b8;background:#f8fafc}
.dropzone input[type="file"]{position:absolute;inset:0;opacity:0;cursor:pointer}

/* Modal / Lightbox */
.modal{position:fixed;inset:0;display:none;z-index:50}
.modal.open{display:block}
.modalBack{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.modalBody{position:relative;max-width:920px;margin:6vh auto;background:#fff;border-radius:18px;padding:14px;border:1px solid rgba(255,255,255,.2);box-shadow:0 16px 48px rgba(0,0,0,.35)}
.modalBody img{width:100%;height:auto;max-height:72vh;object-fit:contain;border-radius:14px;border:1px solid var(--border);background:#fff}
.modalClose{position:absolute;top:10px;right:10px;width:40px;height:40px;border-radius:999px;border:1px solid var(--border);background:#fff;font-size:26px;line-height:36px;cursor:pointer}
.modalClose:hover{background:#f9fafb}
@media (max-width:600px){
  .modalBody{margin:10vh 12px;max-width:none}
}

.grid.four{grid-template-columns:repeat(4,1fr)}
@media (max-width:900px){.grid.four{grid-template-columns:1fr}}
