:root { --teal: #008193; --bg: #f3f4f4; --line: #dfe3e4; --text: #222; --muted: #6b7376; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--teal); }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }
code { background: #e8eced; padding: 1px 5px; border-radius: 4px; }
.small { font-size: 14px; } .muted { color: var(--muted); }

/* Anmelden */
.view-login, .view-setup { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.card.login { background: #fff; padding: 32px; border-radius: 12px; width: 100%; max-width: 380px; box-shadow: 0 6px 30px rgba(0,0,0,.08); }
.card.login h1 { margin: 0 0 16px; font-size: 24px; color: var(--teal); }
.card.login label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.card.login input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; color: var(--text); }
.card.login button { width: 100%; padding: 12px; background: var(--teal); color: #fff; border: 0; border-radius: 8px; font-size: 16px; }
.err { background: #fbe6e6; color: #8a1f1f; padding: 8px 12px; border-radius: 8px; }

/* Gerüst */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 20px; }
.bar .grow { flex: 1; }
.bar a { text-decoration: none; font-size: 15px; }
.menu { display: none; background: none; border: 0; font-size: 22px; padding: 0 4px; }
.layout { display: grid; grid-template-columns: 270px 1fr; min-height: calc(100vh - 50px); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 10px 0 40px; position: sticky; top: 50px; align-self: start; max-height: calc(100vh - 50px); overflow-y: auto; }
.side h4 { margin: 18px 20px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.side a { display: block; padding: 7px 20px; text-decoration: none; color: var(--text); font-size: 15px; border-left: 3px solid transparent; }
.side a:hover { background: #f4f7f7; }
.side a.on { border-left-color: var(--teal); background: #eaf4f5; color: var(--teal); font-weight: 600; }
.main { padding: 24px 32px 80px; max-width: 980px; width: 100%; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; position: sticky; top: 50px; z-index: 5; background: var(--bg); padding: 10px 0 14px; margin-bottom: 6px; }
.page-head h1 { margin: 0; font-size: 26px; }
.save { background: var(--teal); color: #fff; border: 0; border-radius: 8px; padding: 10px 22px; font-weight: 600; white-space: nowrap; }
.save.pending { box-shadow: 0 0 0 3px rgba(0,129,147,.25); }
.save.pending::after { content: " •"; }
.save:disabled { opacity: .6; }
.sec-t { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 28px 0 10px; }

.blk { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; margin-bottom: 12px; }
.blk h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--teal); }
.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.field input, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.field input:focus, .field textarea:focus, .rte:focus { outline: 2px solid rgba(0,129,147,.35); border-color: var(--teal); }
.field small, .hint { display: block; color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.sec { background: #fff; color: var(--teal); border: 1px solid var(--teal); border-radius: 7px; padding: 7px 14px; }
.sec:hover { background: #eaf4f5; }
.sec:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 6px; }

.cols-ed { display: grid; gap: 12px; margin-bottom: 12px; }
.cols-ed.cols-2 { grid-template-columns: 1fr 1fr; } .cols-ed.cols-3 { grid-template-columns: repeat(3, 1fr); }
.col-ed { background: #e9eded; border-radius: 12px; padding: 8px; }
.col-ed .blk { margin-bottom: 8px; }

/* Texteditor */
.rte-wrap { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #f6f8f8; border-bottom: 1px solid var(--line); }
.rte-bar button { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 2px 9px; font-size: 14px; }
.rte { min-height: 70px; padding: 10px 12px; }
.rte p { margin: 0 0 10px; }

/* Bilder */
.imgpick { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.imgpick img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; background: #eef1f1; }
.imgpick.empty img { visibility: hidden; border: 1px dashed var(--line); }
.imgpick .lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #eef1f1; }
.tile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.tile.dragging { opacity: .4; }
.tile-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; background: linear-gradient(transparent, rgba(0,0,0,.6)); padding: 14px 4px 4px; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-tools, .tile:focus-within .tile-tools { opacity: 1; }
@media (hover: none) { .tile-tools { opacity: 1; } }
.tile-tools button { background: rgba(255,255,255,.9); border: 0; border-radius: 4px; width: 28px; height: 26px; font-size: 16px; line-height: 1; }
.tile-tools .del { color: #b02020; font-weight: 700; }
.tile.add { border: 2px dashed #b9c4c6; background: #fafbfb; color: var(--teal); font-size: 13px; line-height: 1.3; }
.tile.add span { display: block; font-size: 28px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2a2c; color: #fff; padding: 10px 18px; border-radius: 30px; z-index: 100; transition: opacity .5s; }
.toast.bad { background: #a32020; }
.toast.out { opacity: 0; }
.progress { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: var(--teal); color: #fff; padding: 8px 18px; border-radius: 30px; z-index: 100; }

@media (max-width: 800px) {
  .menu { display: block; }
  .bar { gap: 12px; padding: 10px 14px; }
  .bar strong { font-size: 15px; }
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; top: 50px; left: 0; bottom: 0; width: 280px; max-height: none; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.1); }
  .side-open .side { transform: none; }
  .main { padding: 14px 14px 80px; }
  .page-head h1 { font-size: 21px; }
  .cols-ed.cols-2, .cols-ed.cols-3 { grid-template-columns: 1fr; }
}
