/* socialplanWerk Web-App. Farben und Formen folgen der iPhone-App. */
:root {
  --blue: #007aff;
  --blue-ink: #0062cc;
  --ink: #1c1c1e;
  --muted: #62626d;
  --bg: #f2f3f7;
  --card: #ffffff;
  --soft: #eef0f4;
  --line: #e1e4ea;
  --red: #d92d20;
  --orange: #c2570c;
  --green: #1f8f3a;
  --tint-purple: #f6e6f9;
  --tint-gray: #eeeff2;
  --tint-green: #e5f5e9;
  --tint-blue: #e0efff;
  --tint-orange: #fdf0e1;
  --shadow: 0 20px 60px rgba(15, 35, 80, .22);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --blue: #3d9bff;
    --blue-ink: #6db4ff;
    --ink: #f2f2f7;
    --muted: #a3a3b0;
    --bg: #0b0c10;
    --card: #191b22;
    --soft: #22252e;
    --line: #2c303a;
    --red: #ff6b5e;
    --orange: #ffa94d;
    --green: #4cd471;
    --tint-purple: #2c1d31;
    --tint-gray: #22242b;
    --tint-green: #16291c;
    --tint-blue: #14263d;
    --tint-orange: #33240f;
    --shadow: 0 20px 60px rgba(0, 0, 0, .6);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .wordmark, .tile b { font-family: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif; }
h1 { font-size: 1.7rem; margin: 0 0 .2rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0; font-weight: 700; }
h3 { font-size: .8rem; margin: 0 0 .4rem; font-weight: 600; color: var(--muted); text-transform: none; }
p { margin: 0 0 .6rem; }
a { color: var(--blue-ink); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.only-mobile { display: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.btn { display: inline-block; text-decoration: none; background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: .55rem 1.1rem; font-weight: 600; }
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; padding: .8rem 1rem; font-size: 1.02rem; }
.btn.ghost { background: var(--soft); color: var(--blue-ink); }
.btn.danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.small { padding: .3rem .75rem; font-size: .88rem; }
.link { background: none; border: 0; padding: 0; color: var(--blue-ink); font-weight: 500; }
.link:hover { text-decoration: underline; }
.icon-btn { background: none; border: 0; padding: .35rem; border-radius: 10px; color: var(--blue-ink); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--soft); }
.icon-btn svg { width: 20px; height: 20px; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; }

input[type=text], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: .6rem .75rem;
}
textarea { resize: vertical; min-height: 5.5rem; line-height: 1.45; }
label.field { display: block; margin-bottom: .9rem; }
label.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }

/* Schriftzug */
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 500; color: var(--ink); text-decoration: none; }
.wordmark b { font-weight: 800; color: var(--blue); }
.mark { width: 34px; height: 34px; border-radius: 10px; background: var(--blue); display: grid; place-items: center; flex: none; }
.mark svg { width: 20px; height: 20px; }

/* Anmeldung */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(420px, 100%); padding: 28px; }
.login .wordmark { margin-bottom: 1.2rem; }

/* Gerüst */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.side .wordmark { padding: 0 8px 18px; font-size: 1.15rem; }
.nav a { display: flex; align-items: center; gap: 10px; padding: .55rem .7rem; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: var(--soft); }
.nav a[aria-current=page] { background: var(--tint-blue); color: var(--blue-ink); }
.side .foot { margin-top: auto; padding: 8px; font-size: .82rem; color: var(--muted); }
main { padding: 28px clamp(16px, 4vw, 40px) 60px; max-width: 1080px; width: 100%; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); z-index: 5; }
  .side .wordmark, .side .foot { display: none; }
  .nav { display: flex; flex: 1; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; font-size: .7rem; padding: .35rem .4rem; }
  main { padding-bottom: 110px; }
  .only-mobile { display: block; }
}

/* Karten und Listen */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.section { margin-bottom: 26px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; }
.banner { border-radius: 12px; padding: .7rem .9rem; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.banner.error { background: var(--tint-orange); color: var(--orange); }
.banner.ok { background: var(--tint-green); color: var(--green); }
.banner.fail { background: color-mix(in srgb, var(--red) 12%, var(--card)); color: var(--red); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { border: 0; text-align: left; border-radius: 18px; padding: 14px; display: block; }
.tile svg { width: 22px; height: 22px; display: block; margin-bottom: 6px; }
.tile b { display: block; font-size: 2rem; line-height: 1.1; font-weight: 800; }
.tile span { color: var(--muted); font-size: .92rem; }
.tile.purple { background: var(--tint-purple); } .tile.purple svg { color: #b03ed6; }
.tile.gray { background: var(--tint-gray); } .tile.gray svg { color: var(--muted); }
.tile.green { background: var(--tint-green); } .tile.green svg { color: var(--green); }
.tile.blue { background: var(--tint-blue); } .tile.blue svg { color: var(--blue); }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; text-align: center; min-height: 64px; cursor: pointer; }
.day small { display: block; color: var(--muted); font-size: .72rem; }
.day.today { background: var(--tint-blue); border-color: transparent; }
.day.today strong { color: var(--blue-ink); }
.day.selected { box-shadow: inset 0 0 0 2px var(--blue); }
.day.empty { visibility: hidden; }
.dots { display: flex; gap: 3px; justify-content: center; height: 7px; margin-top: 3px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month .weekday { text-align: center; font-size: .78rem; color: var(--muted); padding-bottom: 2px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.rows { padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 12px 14px; }
.row-main:hover { background: var(--soft); }
.thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex: none; background: var(--soft); }
.row-text { flex: 1; min-width: 0; }
.row-text .body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; font-size: .82rem; color: var(--muted); }
.row .icon-btn { margin-right: 8px; }
.badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: #fff; font-size: .68rem; font-weight: 800; flex: none; }
.badge.facebook { background: #1778f2; } .badge.instagram { background: #d42e87; } .badge.linkedin { background: #0a66c2; } .badge.whatsapp { background: #1aa854; }
.state { font-size: .78rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; white-space: nowrap; flex: none; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 5px; font-size: .82rem; color: var(--muted); }
.stats span { display: inline-flex; align-items: center; gap: 4px; }
.stats svg { width: 14px; height: 14px; }
.empty-note { color: var(--muted); padding: 14px; }

/* Dialoge */
dialog { border: 0; padding: 0; border-radius: 22px; background: var(--bg); color: var(--ink); box-shadow: var(--shadow); width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog#sheet { width: min(560px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 14, 24, .5); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.dlg-head h2 { font-size: 1.1rem; }
.dlg-actions { display: flex; gap: 8px; align-items: center; }
.dlg-body { padding: 16px; overflow: auto; }
.group { margin-bottom: 18px; }
.group > .card { padding: 14px; }
.hint { font-size: .82rem; color: var(--muted); margin: .4rem .2rem 0; }
.counter { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); padding-top: 8px; }
.counter .over { color: var(--red); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: var(--soft); border: 0; border-radius: 999px; padding: .25rem .7rem; font-size: .86rem; color: var(--blue-ink); }
.account { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.account:first-child { border-top: 0; }
.account input { width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.account .grow { flex: 1; min-width: 0; }
.media { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.media figure { margin: 0; position: relative; width: 96px; }
.media img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; display: block; background: var(--soft); }
.media .tools { display: flex; justify-content: space-between; margin-top: 3px; }
.media .tools button { background: var(--soft); border: 0; border-radius: 8px; width: 28px; height: 26px; line-height: 1; }
.target { padding: 9px 0; border-top: 1px solid var(--line); }
.target:first-child { border-top: 0; }
.target .line { display: flex; align-items: center; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.comment { padding: 8px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }
details summary { cursor: pointer; font-weight: 600; }
.version { border-top: 1px solid var(--line); padding: 10px 0; }
.version .text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Posteingang */
.count { background: #1aa854; color: #fff; font-size: .74rem; font-weight: 700; border-radius: 999px; padding: .05rem .45rem; min-width: 1.3rem; text-align: center; flex: none; }
.nav a .count { margin-left: auto; }
.chat { display: flex; flex-direction: column; gap: 8px; min-height: 240px; }
.bubble-row { display: flex; }
.bubble-row.out { justify-content: flex-end; text-align: right; }
.bubble { display: inline-block; text-align: left; max-width: 34rem; padding: .5rem .8rem; border-radius: 16px; background: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-row.out .bubble { background: color-mix(in srgb, #1aa854 24%, var(--card)); }
.chat-foot { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--card); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
code { font-size: .85em; background: var(--soft); padding: .1rem .35rem; border-radius: 6px; overflow-wrap: anywhere; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .nav a .count { position: absolute; margin: -6px 0 0 22px; } .nav a { position: relative; } }

/* Vorschau */
.preview { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.preview .who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; }
.preview .text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.preview img { width: 100%; border-radius: 8px; display: block; }
.preview .first { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.copybox { background: var(--soft); border-radius: 10px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 8px; }
