*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #f6f5f3;
  --card: #ffffff;
  --ink: #1c1b1a;
  --muted: #7a756e;
  --line: #e5e2dd;
  --accent: #b8860b;
  --accent-bright: #f0b429;
  --accent-ink: #ffffff;
  --danger: #b0413e;
  --ok: #3d7a4f;
  --radius: 10px;
}
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #15181d 0%, #232830 100%);
  border-bottom: 2px solid var(--accent-bright);
  color: #f2efe9;
}
.topbar .brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 600; font-size: 1rem; letter-spacing: 0.02em; min-width: 0;
}
.topbar .brand img { height: 34px; width: auto; display: block; }
.topbar .brand a { color: var(--accent-bright); }
.topbar .brand .crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .btn.secondary { border-color: #4a5058; color: #e8e4dd; background: transparent; }
.topbar .btn.secondary:hover { border-color: var(--accent-bright); color: var(--accent-bright); filter: none; }
.topbar form { margin: 0; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.card h2 { margin-top: 0; font-size: 1.1rem; }

.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
label.field { display: block; font-size: 0.85rem; color: var(--muted); }
label.field span { display: block; margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=password], input[type=date], input[type=number], select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 0.82rem; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 0.75rem; font-weight: 600;
  background: #eee9e2; color: var(--muted);
}
.badge.ok { background: #e2efe6; color: var(--ok); }
.badge.warn { background: #f7e9d8; color: #9a6a1f; }
.badge.danger { background: #f6e2e1; color: var(--danger); }

table.list { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.list th, table.list td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.list tr:hover td { background: #faf8f5; }
.cover-mini { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: #ddd; display: block; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); font-weight: 600; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.linkbox {
  display: flex; gap: 8px; align-items: center; background: #f2efe9;
  border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px;
  font-family: Consolas, monospace; font-size: 0.85rem; word-break: break-all;
}

/* Upload-Zone */
.dropzone {
  border: 2px dashed var(--accent); border-radius: var(--radius); padding: 36px 20px;
  text-align: center; color: var(--muted); cursor: pointer; transition: background 0.15s;
}
.dropzone.drag { background: #f2ece3; }
.progress { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 12px; display: none; }
.progress .bar { height: 100%; width: 0%; background: var(--accent); transition: width 0.2s; }

/* Admin-Bildergrid */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.thumbs .item { position: relative; border-radius: 8px; overflow: hidden; background: #ddd; }
.thumbs .item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.thumbs .item .tools {
  position: absolute; inset: auto 0 0 0; display: flex; gap: 4px; justify-content: space-between;
  padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,0.6));
}
.thumbs .item .tools form { margin: 0; }
.thumbs .item .tools button {
  border: 0; background: rgba(255,255,255,0.9); border-radius: 5px; padding: 3px 8px;
  font-size: 0.75rem; cursor: pointer;
}
.thumbs .fav-flag {
  position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.5); color: #ff7d90;
  border-radius: 99px; padding: 2px 7px; font-size: 0.8rem;
}
.thumbs .cover-flag {
  position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff;
  border-radius: 99px; padding: 2px 8px; font-size: 0.7rem; font-weight: 700;
}

/* ---------- Kunden-Galerie (dunkel, elegant) ---------- */
body.client { background: #141312; color: #ece8e2; }
.client .hero {
  position: relative; min-height: 46vh; display: flex; align-items: flex-end;
  background: #22201e center/cover no-repeat;
}
.client .hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(20,19,18,0.92)); }
.client .hero-inner { position: relative; z-index: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 60px 20px 28px; }
.client .hero h1 { margin: 0 0 4px; font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 600; }
.client .hero .date { color: #cfc8bf; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; }

.client .toolbar {
  position: sticky; top: 0; z-index: 5; background: rgba(20,19,18,0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid #2c2a27;
}
.client .toolbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 20px;
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; font-size: 0.9rem;
}
.client .toolbar-info { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.client .toolbar-actions { display: flex; gap: 8px; align-items: center; }
.client .toolbar .btn { border-color: #4a453f; background: transparent; color: #ece8e2; }
.client .toolbar .btn.primary { background: var(--accent-bright); border-color: var(--accent-bright); color: #1c1b1a; }
.client .notice {
  background: #322a1d; color: #e8d9bd; border: 1px solid #55482f; border-radius: 8px;
  padding: 10px 14px; margin: 16px auto 0; max-width: 1140px; font-size: 0.9rem;
}

.client .masonry { max-width: 1180px; margin: 22px auto; padding: 0 20px; columns: 4 260px; column-gap: 14px; }
.client .photo { position: relative; margin: 0 0 14px; break-inside: avoid; border-radius: 8px; overflow: hidden; background: #22201e; cursor: zoom-in; }
.client .photo img { width: 100%; display: block; }
.client .photo .heart {
  position: absolute; top: 8px; right: 8px; border: 0; cursor: pointer;
  background: rgba(0,0,0,0.45); color: #fff; border-radius: 99px;
  width: 36px; height: 36px; font-size: 1.05rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.85; transition: transform 0.12s;
}
.client .photo .heart:hover { transform: scale(1.15); }
.client .photo .heart.active { color: #ff7d90; background: rgba(0,0,0,0.65); }
.client footer {
  text-align: center; color: #8f887f; padding: 40px 20px 50px; font-size: 0.85rem;
  border-top: 1px solid #26232080; margin-top: 30px;
}
.client footer .logo-mark { width: 170px; max-width: 55%; height: auto; margin-bottom: 4px; opacity: 0.95; }
.client footer .studio-name { color: #ded8cf; font-weight: 600; font-size: 0.95rem; }
a.insta {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--accent-bright); font-weight: 600;
}
a.insta svg { flex-shrink: 0; }
.center-card .logo-mark { width: 160px; max-width: 65%; height: auto; margin-bottom: 14px; }
.center-card .card-logo { width: 76px; height: 76px; border-radius: 14px; margin-bottom: 10px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(10,9,8,0.96);
  display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; }
.lightbox .lb-btn {
  position: absolute; border: 0; background: rgba(255,255,255,0.08); color: #fff;
  border-radius: 99px; cursor: pointer; font-size: 1.3rem;
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
}
.lightbox .lb-btn:hover { background: rgba(255,255,255,0.2); }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-tools { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.lightbox .lb-tools .btn { background: rgba(255,255,255,0.1); border-color: transparent; color: #fff; }

/* zentrierte Info-/Login-Seiten */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.center-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 34px; max-width: 430px; width: 100%; text-align: center; }
body.client .center-card { background: #201e1c; border-color: #35322e; color: #ece8e2; }
body.client .center-card input { background: #141312; border-color: #45413c; color: #ece8e2; }

/* Rechtstexte (Impressum/Datenschutz) */
.legal { max-width: 760px; margin: 0 auto; padding: 48px 22px 30px; }
.legal h1 { font-size: 1.7rem; margin-bottom: 28px; }
.legal h2 { font-size: 1.05rem; margin: 26px 0 8px; color: var(--accent-bright); }
.legal p { color: #c9c3ba; font-size: 0.93rem; line-height: 1.7; margin: 0 0 10px; }
.legal a { color: var(--accent-bright); }
.legal .legal-back { display: inline-block; margin-bottom: 20px; font-size: 0.88rem; color: #8f887f; }
.legal .legal-stand { margin-top: 28px; color: #6e6760; font-size: 0.82rem; }
.legal-footer { text-align: center; padding: 20px; color: #6e6760; font-size: 0.82rem; border-top: 1px solid #26232080; }
.legal-footer a { color: #8f887f; }
.client footer .foot-links { margin-top: 14px; font-size: 0.8rem; }
.client footer .foot-links a { color: #6e6760; }

@media (max-width: 640px) {
  .client .masonry { columns: 2 140px; padding: 0 10px; }
  .wrap { padding: 16px 12px 60px; }
  table.list { font-size: 0.8rem; }
  .hide-mobile { display: none; }

  /* Galerie-Toolbar: Buttons in eigener Zeile, volle Breite, gut antippbar */
  .client .toolbar-inner { padding: 10px 12px; }
  .client .toolbar-info { width: 100%; justify-content: space-between; font-size: 0.85rem; }
  .client .toolbar-actions { width: 100%; }
  .client .toolbar-actions .btn {
    flex: 1 1 0; justify-content: center; text-align: center;
    padding: 11px 8px; font-size: 0.88rem; white-space: nowrap;
  }
}
