:root {
  color-scheme: dark;
  --bg: #1d2125;
  --surface: #22272b;
  --list-bg: #101204;
  --border: #38414a;
  --text: #b6c2cf;
  --muted: #8c9bab;
  --accent: #e50c7e;
  --accent-dark: #b30a63;
  --danger: #f87168;
  --warning: #f5cd47;
  --success: #4bce97;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3 { color: #fff; }
a { color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),
textarea,
select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }

button {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor: pointer;
}
button:hover { background: rgba(255,255,255,.14); }
button:disabled { opacity: .5; cursor: not-allowed; }

button.primary {
  padding: 10px 16px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.primary:disabled:hover { background: var(--accent); }

button.danger { background: none; border-color: var(--danger); color: var(--danger); }
button.danger:hover { background: rgba(248,113,104,.14); }

.icon-button {
  background: none;
  border: none;
  color: var(--text);
  padding: 4px 8px;
  font-size: 16px;
  line-height: 1;
}
.icon-button:hover { background: rgba(255,255,255,.14); }

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  background: var(--surface);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  width: 100%;
  max-width: 360px;
}
.auth-card h1 { font-size: 20px; margin: 0 0 20px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; }

.brand-logo { display: block; height: 32px; width: auto; }
.auth-card .brand-logo { height: 28px; margin: 0 auto 20px; }

.error-message {
  background: rgba(248,113,104,.14);
  color: var(--danger);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

.hint-link { font-size: 13px; margin-top: 14px; text-align: center; color: var(--muted); }
.hint-link a { color: var(--text); }

.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Google-Button: Googles dunkle Branding-Variante (farbiges G aus google-g.svg bleibt). */
.google {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: #131314;
  color: #e3e3e3;
  border: 1px solid #8e918f;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.google:hover { background: #1f1f20; }
.google img { width: 18px; height: 18px; flex: none; }

.button-link {
  display: block;
  text-align: center;
  padding: 10px 16px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.button-link.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.button-link.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.button-block { width: 100%; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.64);
  display: flex; align-items: center; justify-content: center;
  z-index: 40; padding: 16px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  width: 360px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.modal h2 { font-size: 16px; margin: 0 0 12px; }
.modal input[type=text] { width: 100%; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.muted { color: var(--muted); font-size: 13px; }

img.avatar { object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.settings-image-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.settings-image-actions { display: flex; gap: 8px; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* Vorlagen: Badge auf Vorlagen-Kacheln/-Karten, Reiter im Erstellen-Popover, Auswahl-Dialog */
.template-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,.14);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.template-picker-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.template-picker-tabs button {
  flex: 1 1 auto;
  padding: 6px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  font-weight: 600;
}
.template-picker-tabs button:hover { background: rgba(255,255,255,.08); }
.template-picker-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.template-picker-dialog { width: 420px; }
.template-picker-group { margin-bottom: 16px; }
.template-picker-group:last-child { margin-bottom: 0; }
.template-picker-group h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); }
.template-picker-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.template-picker-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: left;
}
.template-picker-card:hover { border-color: var(--accent); }
.template-picker-swatch { display: block; width: 100%; height: 40px; border-radius: 4px; }
.template-picker-name { font-size: 13px; font-weight: 600; }

@media (max-width: 480px) {
  .template-picker-grid { grid-template-columns: 1fr; }
}

/* Posteingang: Schnellerfassung, Item-Liste, Board-Auswahl-Kette */
.inbox-capture { display: flex; gap: 8px; margin-bottom: 20px; max-width: 480px; }
.inbox-capture input { flex: 1 1 auto; }

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
  max-width: 480px;
}
.inbox-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.inbox-item-handle { flex: 0 0 auto; color: var(--muted); cursor: grab; }
.inbox-item-title { flex: 1 1 auto; overflow-wrap: anywhere; }
.inbox-item-action { flex: 0 0 auto; }
.inbox-item.sortable-ghost { opacity: .4; }
.inbox-empty { color: var(--muted); font-size: 14px; padding: 4px 0; }

.board-picker {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 35;
  width: 260px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  text-align: left;
}
.board-picker-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.board-picker-title { flex: 1 1 auto; font-size: 13px; font-weight: 600; color: var(--text); }
.board-picker-list { display: flex; flex-direction: column; gap: 2px; }
.board-picker-list button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
}
.board-picker-list button:hover { background: rgba(255,255,255,.1); }
.board-picker-empty { margin: 0; padding: 8px; color: var(--muted); font-size: 13px; }

@media (max-width: 767px) {
  .inbox-capture, .inbox-list { max-width: none; }
  .board-picker {
    position: fixed;
    top: 64px;
    left: 16px;
    right: 16px;
    width: auto;
    max-height: calc(100vh - 96px);
  }
}

/* Planer: Verbinden-Hinweis, Gruppen-Überschriften, Agenda-Zeilen */
.planer-banner {
  margin: 0 0 20px;
  padding: 10px 12px;
  background: rgba(245,205,71,.14);
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: 4px;
  font-size: 13px;
}
.planer-banner a { color: var(--warning); font-weight: 600; }

.planer-group { max-width: 640px; margin-bottom: 20px; }
.planer-group-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin: 0 0 8px;
}

.planer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.planer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.planer-item-title { flex: 1 1 auto; overflow-wrap: anywhere; text-decoration: none; font-weight: 600; }
.planer-item-title:hover { text-decoration: underline; }
.planer-item-board { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.planer-item-date { flex: 0 0 auto; }
.planer-empty { color: var(--muted); font-size: 14px; padding: 4px 0; }

@media (max-width: 767px) {
  .planer-group { max-width: none; }
  .planer-item { flex-wrap: wrap; }
  .planer-item-board { order: 3; width: 100%; }
}

.invite-dialog .invite-usage {
  display: flex;
  gap: 16px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.invite-dialog .invite-usage legend { padding: 0 4px; }
.invite-dialog label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.invite-result { display: flex; gap: 8px; margin-top: 12px; }
.invite-result input { flex: 1 1 auto; min-width: 0; }
