/* Digitale Sammelmappe - Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f3f3f3;
  color: #1f1f1f;
  font-size: 14px;
}

.topbar {
  background: #2b579a;
  color: white;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 10px;
}
.topbar .brand img {
  height: 30px;
  width: auto;
  border-radius: 4px;
}
.topbar h1 { font-size: 16px; font-weight: 600; }
.topbar .user { margin-left: auto; opacity: .85; font-size: 13px; }
.topbar a { color: white; text-decoration: none; opacity: .9; }
.topbar a:hover { opacity: 1; }

.nav-tabs {
  display: flex;
  gap: 4px;
  margin-left: 20px;
}
.nav-tabs a {
  padding: 6px 14px;
  border-radius: 4px;
  opacity: .7;
  transition: all .15s;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-tabs a:hover { background: rgba(255,255,255,.1); opacity: 1; }
.nav-tabs a.active {
  background: rgba(255,255,255,.18);
  opacity: 1;
  font-weight: 500;
}
.nav-badge {
  background: #c94545;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
}

.toolbar {
  background: white;
  border-bottom: 1px solid #e1e1e1;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn {
  padding: 6px 14px;
  border: 1px solid #d0d0d0;
  background: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.btn.primary {
  background: #2b579a;
  color: white;
  border-color: #2b579a;
}
.btn.danger { color: #c94545; }
.btn:hover { background: #f0f0f0; }
.btn.primary:hover { background: #1e4179; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.search {
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  width: 260px;
  font-size: 13px;
  font-family: inherit;
}

.filters {
  background: #fafafa;
  border-bottom: 1px solid #e1e1e1;
  padding: 8px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: #666;
}
.chip {
  background: white;
  border: 1px solid #d0d0d0;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
}
.chip.active {
  background: #2b579a;
  color: white;
  border-color: #2b579a;
}
.chip select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  color: inherit;
}

/* Tabelle */
.table-wrap { background: white; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 14px;
  background: #f5f5f5;
  border-bottom: 1px solid #e1e1e1;
  font-weight: 600;
  font-size: 12px;
  color: #555;
  user-select: none;
}
th.sortable { cursor: pointer; }
th.sortable:hover { background: #eaeaea; color: #2b579a; }
th.sortable.active { color: #2b579a; background: #e8f0fd; }
th.sortable .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.3;
  font-size: 10px;
}
th.sortable.active .sort-arrow { opacity: 1; }
td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
}
tr.done td { color: #999; text-decoration: line-through; }
tr.sm-privat { background: #fafafc; }
tr.sm-privat:hover { background: #f4f4f9; }
tr.clickable:hover { background: #f8faff; cursor: pointer; }
.pn { color: #888; font-size: 12px; font-family: ui-monospace, "Consolas", monospace; }

/* Status */
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.status.Nicht-begonnen { background: #fff4e0; color: #8a5a00; }
.status.Erledigt      { background: #e4f5e4; color: #2d6a2d; }
.status.In-Bearbeitung   { background: #e0ecff; color: #1e4179; }
.status.Zur\00fcckgestellt { background: #f0f0f0; color: #555; }
.status.Wartet        { background: #faf0e0; color: #8a5a00; }

.priority-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.priority-dot.Hoch { background: #c94545; }
.priority-dot.Normal { background: #aaa; }
.priority-dot.Niedrig { background: #d9d9d9; }

.category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  background: #fde5e5;
  color: #8a2020;
}

.footer {
  padding: 12px 20px;
  font-size: 12px;
  color: #777;
  background: #fafafa;
  border-top: 1px solid #e1e1e1;
}

/* Globaler Seiten-Footer (Impressum) */
.site-footer {
  padding: 14px 24px;
  font-size: 11px;
  color: #888;
  background: #fafafa;
  border-top: 1px solid #eaeaea;
  text-align: center;
  line-height: 1.6;
  margin-top: auto;
}
.site-footer a { color: #555; text-decoration: none; margin: 0 8px; }
.site-footer a:hover { color: #2b579a; text-decoration: underline; }
/* Seiten-Layout: Footer klebt unten, Hauptinhalt fuellt dazwischen aus.
   Wichtig: KEIN width:100% hier - Elemente mit margin (z.B. .dropzone)
   wuerden sonst rechts ueberlaufen. Flex-direction:column sorgt schon
   dafuer, dass jedes Kind die volle Breite einnimmt. */
html, body { min-height: 100vh; }
body { display: flex; flex-direction: column; }
body > * { flex-shrink: 0; }
body > .page-wrap,
body > .cal-wrap,
body > .reminders-wrap,
body > .entries { flex: 1 1 auto; }

/* Detail */
.kopf {
  background: white;
  border-bottom: 1px solid #e1e1e1;
  padding: 20px 30px;
}
.kopf .subject {
  font-size: 20px;
  font-weight: 600;
  margin: 8px 0 18px 0;
  color: #1f1f1f;
  border: 1px solid transparent;
  padding: 4px 6px;
  border-radius: 3px;
}
.kopf .subject:hover, .kopf .subject:focus {
  border-color: #d0d0d0;
  outline: none;
}
.kopf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 30px;
}
.field label {
  display: block;
  font-size: 11px;
  color: #777;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.field input, .field select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  font-size: 13px;
  background: white;
  font-family: inherit;
}
.field .reminder {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.field .reminder input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}
.field .reminder input[type="date"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 130px;
}
/* Erinnerungsfeld bekommt etwas mehr Platz im Grid */
#erinnerung_am { min-width: 130px; }
.kopf-grid .field:has(.reminder) { min-width: 200px; }

/* Katalog-Pflege: drei Karten nebeneinander */
.katalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.katalog-box {
  background: #fafbfc;
  border: 1px solid #e5e9f0;
  border-radius: 4px;
  padding: 14px;
  min-width: 0;
}
.katalog-box h4 {
  font-size: 13px;
  color: #2b579a;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.katalog-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  max-height: 320px;
  overflow-y: auto;
}
.katalog-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: white;
  border: 1px solid #eee;
  border-radius: 3px;
  font-size: 13px;
}
.katalog-row.inactive { opacity: 0.5; }
.katalog-row input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 4px;
  font-family: inherit;
  font-size: 13px;
  min-width: 0;
  outline: none;
}
.katalog-row input[type="text"]:focus { background: #f8faff; }
.katalog-row button {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
}
.katalog-row button:hover { color: #c94545; }
.katalog-row .toggle { color: #2b579a; }
.katalog-add {
  display: flex;
  gap: 6px;
}
.katalog-add input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  font-size: 13px;
  font-family: inherit;
}
.katalog-add button {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: bold;
}

/* Admin: Einstellungs-Grid, passt sich der Bildschirmbreite an */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
}
.settings-grid .field {
  min-width: 0;
}

/* Inline-Checkbox mit Text-Label (ohne Uppercase-Formatierung) */
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  min-width: 0;
}
.checkbox-inline .checkbox-text {
  font-size: 13px;
  color: #333;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  user-select: none;
  line-height: 1.3;
  font-weight: normal;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.sammelmappe-header {
  background: white;
  padding: 14px 30px;
  border-bottom: 1px solid #e1e1e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sammelmappe-header h2 { font-size: 15px; font-weight: 600; }
.sammelmappe-header .hint { font-size: 12px; color: #888; }

.dropzone {
  background: white;
  margin: 14px 30px;
  border: 2px dashed #b8c7e0;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  color: #6680a8;
  font-size: 13px;
  transition: background .15s, border-color .15s;
}
.dropzone.drag-over {
  background: #eef5ff;
  border-color: #2b579a;
}
.dropzone .big { font-size: 24px; margin-bottom: 6px; }
.dropzone input[type="text"], .dropzone textarea {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  font-family: inherit;
  font-size: 13px;
}
.dropzone textarea { resize: vertical; min-height: 50px; }
/* Notiz-Editor im Neu-Eintrag (contenteditable statt textarea) */
.dropzone .note-editor {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  color: #333;
}
.dropzone .entry-actions { margin-top: 8px; text-align: right; }
.dropzone .pending-files {
  margin-top: 10px;
  text-align: left;
  font-size: 12px;
  color: #333;
}
.dropzone .pending-files .file-chip {
  display: inline-block;
  background: #eef2f9;
  padding: 3px 8px;
  margin: 2px;
  border-radius: 3px;
}

.entries { padding: 0 30px 30px 30px; }
.entry {
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 12px;
  position: relative;
}
.entry.dragging { opacity: .4; }
.entry .drag-handle {
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  cursor: grab;
  font-size: 18px;
  opacity: 0;
  transition: opacity .15s;
  padding: 4px;
  user-select: none;
}
.entry:hover .drag-handle { opacity: 1; }
.entry .entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
  padding-right: 130px;  /* Platz fuer die rechte Steuerleiste (.entry-controls) */
}
.entry .entry-date {
  font-weight: 600;
  color: #444;
  font-size: 13px;
  border: 1px solid transparent;
  padding: 2px 4px;
  border-radius: 3px;
  flex: 1;
}
.entry .entry-date:hover, .entry .entry-date:focus {
  border-color: #d0d0d0;
  outline: none;
}
.entry .entry-author { font-size: 12px; color: #888; white-space: nowrap; }
.entry .entry-text {
  margin: 6px 0 12px 0;
  color: #333;
  line-height: 1.5;
  border: 1px solid transparent;
  padding: 4px 6px;
  border-radius: 3px;
  min-height: 20px;
  /* Zeilenumbrueche in Altbestands-Notizen (reiner Text) erhalten */
  white-space: pre-wrap;
}
.entry .entry-text:hover, .entry .entry-text:focus {
  border-color: #d0d0d0;
  outline: none;
}
.entry .entry-text:empty::before {
  content: "Notiz hinzufügen...";
  color: #bbb;
}

/* Notiz-Editoren (Neu-Eintrag + Bestand): erlaubte Rich-Text-Formate */
.note-editor { white-space: pre-wrap; }
.note-editor:focus { outline: none; }
.note-editor:empty::before {
  content: attr(data-placeholder);
  color: #bbb;
}
.note-editor p { margin: 0 0 6px 0; }
.note-editor ul, .note-editor ol,
.entry-text ul, .entry-text ol { margin: 4px 0 4px 0; padding-left: 24px; }
.entry-text p { margin: 0 0 6px 0; }

/* ============== MINI RICH-TEXT-TOOLBAR ============== */
.rte-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  align-items: center;
  gap: 2px;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  padding: 4px 6px;
  z-index: 300;
}
.rte-toolbar.show { display: flex; }
.rte-btn {
  background: white;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  color: #333;
  line-height: 1;
}
.rte-btn:hover { background: #eef2f9; border-color: #d8e2f2; }
.rte-sep {
  width: 1px;
  align-self: stretch;
  background: #e1e1e1;
  margin: 2px 4px;
}
.rte-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.rte-swatch-label {
  font-size: 12px;
  color: #888;
  margin-right: 2px;
  user-select: none;
}
.rte-color, .rte-hilite {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0,0,0,.2);
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
}
.rte-color:hover, .rte-hilite:hover {
  outline: 2px solid #2b579a;
  outline-offset: 1px;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.attachment {
  background: #f7f9fc;
  border: 1px solid #e1e6ef;
  border-radius: 4px;
  padding: 10px 12px;
  min-width: 140px;
  max-width: 200px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}
.attachment:hover {
  background: #eef2f9;
  border-color: #b8c7e0;
}
.attachment.dragging {
  opacity: .4;
  border-style: dashed;
  border-color: #2b579a;
}
.attachment .icon { font-size: 22px; margin-bottom: 4px; }
.attachment .name {
  color: #333;
  word-break: break-word;
  line-height: 1.3;
}
.attachment .meta {
  color: #888;
  font-size: 11px;
  margin-top: 3px;
}
.attachment .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255,255,255,.8);
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 11px;
  padding: 1px 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  color: #666;
}
.attachment:hover .remove { opacity: 1; }
.attachment .remove:hover { color: #c94545; }

/* Drop-Kachel am Ende der Anhangs-Liste */
.attachment.add-dropzone {
  background: transparent;
  border: 2px dashed #c5d0e0;
  color: #8a9bb3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  min-width: 100px;
  max-width: 140px;
  text-align: center;
  padding: 8px;
}
.attachment.add-dropzone:hover {
  background: #f0f5ff;
  border-color: #2b579a;
  color: #2b579a;
}
.attachment.add-dropzone.drag-over {
  background: #dce8ff;
  border-color: #2b579a;
  border-style: solid;
  color: #2b579a;
}
.attachment.add-dropzone .plus {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 2px;
  font-weight: 300;
}
.attachment.add-dropzone .label {
  font-size: 11px;
  line-height: 1.2;
}

.entry-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 2;
}
.entry-controls button {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 19px;
  line-height: 1;
  border-radius: 4px;
  transition: color .15s, transform .15s, background .15s;
}
.entry-controls button:hover { background: #f1f1f1; transform: scale(1.1); }
.entry-controls .entry-del:hover { color: #c94545; }

/* Favorit: angepinnter Eintrag */
.entry.is-favorit {
  border-left: 4px solid #f0b429;
  background: #fffbeb;
}
/* Favorit-Stern: Teil der rechten Steuerleiste, gut sichtbar */
.entry-controls .entry-star {
  color: #ccc;
  font-size: 22px;
  user-select: none;
}
.entry-controls .entry-star:hover { color: #f0b429; }
.entry-controls .entry-star.active { color: #f0b429; }
.entry .favorit-info {
  font-size: 11px;
  color: #c97a1f;
  font-style: italic;
  margin-bottom: 6px;
}

/* Privat: Eintrag mit Schloss-Kennzeichnung */
.entry.is-privat {
  background: #f8f8fa;
  border-left: 4px solid #888;
}
.entry.is-privat.is-favorit {
  border-left: 4px solid #f0b429;
  background: #fffbf0;
}
.privat-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #666;
  background: #eee;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 8px;
  font-weight: 500;
}

/* ============== MULTI-SELECT FILTER ============== */
.multi-filter {
  position: relative;
  display: inline-block;
}
.multi-filter.detail-multi {
  display: block;
  width: 100%;
}
.multi-filter.detail-multi .chip-button {
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 13px;
  background: white;
  position: relative;
}
.multi-filter.detail-multi .chip-button::after {
  content: '▾';
  position: absolute;
  right: 10px;
  color: #888;
}
.multi-filter.detail-multi.has-selection .chip-button::after { color: white; }
.multi-filter.detail-multi .multi-dropdown {
  min-width: 260px;
  max-width: 420px;
  white-space: nowrap;
}
.multi-filter.detail-multi .multi-dropdown label {
  white-space: normal;
}
.multi-filter .chip-button {
  background: white;
  border: 1px solid #d0d0d0;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-family: inherit;
  color: #555;
}
.multi-filter.has-selection .chip-button {
  background: #2b579a;
  color: white;
  border-color: #2b579a;
}
.multi-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  padding: 8px 0;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
}
.multi-filter.open .multi-dropdown { display: block; }
.multi-dropdown label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  line-height: 1.3;
}
.multi-dropdown label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0;
}
.multi-dropdown label:hover { background: #f0f5ff; }
.multi-dropdown .divider {
  height: 1px;
  background: #eee;
  margin: 6px 0;
}
.multi-dropdown .clear-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 4px 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  color: #c94545;
  cursor: pointer;
}
.multi-dropdown .clear-btn:hover { background: #fdf3f3; }

/* ============== EIGENER DATEPICKER ============== */
/* Aufgewertetes Datumsfeld: ganzes Feld klickbar, zeigt DD.MM.YYYY */
.datepicker-input {
  cursor: pointer;
  background: white;
}
.datepicker-input:focus {
  outline: none;
  border-color: #2b579a;
}

.dp-popup {
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  padding: 10px;
  z-index: 250;
  width: 252px;
  user-select: none;
  font-size: 13px;
}
.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.dp-head .dp-title {
  font-weight: 600;
  color: #1f1f1f;
  font-size: 13px;
}
.dp-nav {
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #2b579a;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 8px;
  font-family: inherit;
}
.dp-nav:hover { background: #eef2f9; border-color: #d8e2f2; }

.dp-grid {
  display: grid;
  grid-template-columns: 30px repeat(7, 1fr);
  gap: 1px;
}
.dp-cell {
  text-align: center;
  padding: 5px 0;
  border-radius: 3px;
  font-size: 12px;
}
.dp-wd {
  color: #777;
  font-weight: 600;
  font-size: 11px;
}
/* Kalenderwochen-Spalte: links, abgesetzt */
.dp-kw-head {
  color: #2b579a;
  font-weight: 600;
  font-size: 10px;
}
.dp-kw {
  color: #aaa;
  font-size: 11px;
  background: #f5f5f5;
  border-right: 1px solid #e1e1e1;
}
.dp-day {
  cursor: pointer;
  color: #1f1f1f;
}
.dp-day:hover { background: #eef2f9; }
.dp-day.dp-other { color: #c0c0c0; }
.dp-day.dp-today {
  font-weight: 700;
  color: #c97a1f;
  box-shadow: inset 0 0 0 1px #f0b429;
}
.dp-day.dp-selected {
  background: #2b579a;
  color: white;
  font-weight: 600;
}
.dp-day.dp-selected:hover { background: #1e4179; }

.dp-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  border-top: 1px solid #eee;
  padding-top: 8px;
}
.dp-today-btn, .dp-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 3px;
}
.dp-today-btn { color: #2b579a; }
.dp-today-btn:hover { background: #eef2f9; }
.dp-clear-btn { color: #c94545; }
.dp-clear-btn:hover { background: #fdf3f3; }

/* ============== API-TOKENS (Outlook-Add-in) ============== */
.token-create {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.token-create .btn { height: 31px; }
/* Einmalige Klartext-Anzeige eines frisch erstellten Tokens */
.token-reveal {
  background: #fffbeb;
  border: 1px solid #f0b429;
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.token-reveal-head {
  font-size: 14px;
  font-weight: 600;
  color: #1f1f1f;
  margin-bottom: 10px;
}
.token-reveal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.token-code {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .5px;
  background: white;
  border: 1px solid #e0d5a8;
  border-radius: 4px;
  padding: 10px 14px;
  color: #1e4179;
  word-break: break-all;
  user-select: all;
}
.token-reveal-warn {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #8a5a00;
}
.token-inactive { color: #999; }
.token-inactive td { color: #999; }

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-bg.show { display: flex; }
.modal {
  background: white;
  border-radius: 6px;
  padding: 24px;
  min-width: 420px;
  max-width: 90vw;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.modal h2 { font-size: 16px; margin-bottom: 16px; }
.modal .field { margin-bottom: 12px; }
.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .2s;
  z-index: 200;
}
.toast.show { opacity: 1; }
.toast.error { background: #c94545; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}
.empty-state .big-icon { font-size: 48px; margin-bottom: 12px; }

/* Faelligkeits-Markierung in Uebersicht */
tr.ueberfaellig td:nth-child(5) {
  color: #c94545;
  font-weight: 600;
}
tr.heute td:nth-child(5) {
  color: #c97a1f;
  font-weight: 600;
}
.due-label {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.due-label.overdue { background: #fde0e0; color: #c94545; }
.due-label.today   { background: #faeacd; color: #8a5a00; }

/* Such-Trefferzeile unter dem Tabelleneintrag */
tr.treffer-row td { padding-top: 0; border-bottom: 1px solid #f0f0f0; }
tr.treffer-row:hover { background: #f8faff; cursor: pointer; }
.treffer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #777;
  border-left: 2px solid #d8e2f2;
  padding: 4px 0 4px 10px;
}
.treffer .treffer-item {
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.treffer .treffer-quelle { color: #2b579a; font-weight: 600; }
.treffer mark {
  background: #fff1a8;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

/* ============ KALENDER ============ */
.cal-wrap {
  padding: 24px;
  width: 100%;
}
.cal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.cal-header h2 { font-size: 18px; font-weight: 600; }
.cal-header .nav {
  display: flex;
  gap: 4px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: #e1e1e1;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}
.cal-weekday {
  background: #f5f5f5;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  text-align: left;
}
.cal-day {
  background: white;
  min-height: 110px;
  padding: 6px 8px;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.cal-day:hover { background: #f8faff; }
.cal-day.other-month { background: #fafafa; color: #bbb; }
.cal-day.today { background: #fff9e6; }
.cal-day.today .cal-daynum { color: #c97a1f; font-weight: 700; }
.cal-day.is-weekend { background: #fafbfd; }
.cal-daynum {
  font-size: 12px;
  color: #888;
  font-weight: 500;
  margin-bottom: 4px;
}
.cal-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.cal-event {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #e0ecff;
  color: #1e4179;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-left: 3px solid #2b579a;
}
.cal-event:hover { background: #cfe0ff; }
.cal-event.prio-Hoch { border-left-color: #c94545; background: #fde5e5; color: #8a2020; }
.cal-event.prio-Hoch:hover { background: #f9cccc; }
.cal-event.art-erinnerung { background: #fff4e0; color: #8a5a00; border-left-color: #f0a020; }
.cal-event.art-erinnerung:hover { background: #fce9c4; }
.cal-event.done { opacity: .45; text-decoration: line-through; }
.cal-event .icon { margin-right: 3px; }
.cal-more {
  font-size: 10px;
  color: #777;
  padding: 1px 6px;
  cursor: pointer;
}

/* Tagesliste unter dem Kalender */
.cal-daylist {
  margin-top: 20px;
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  padding: 14px 18px;
  display: none;
}
.cal-daylist.show { display: block; }
.cal-daylist h3 { font-size: 14px; margin-bottom: 10px; }
.cal-daylist .item {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.cal-daylist .item:last-child { border: none; }
.cal-daylist .item:hover { background: #f8faff; }

/* Generischer Seitenrahmen - nutzt die volle Bildschirmbreite */
.page-wrap {
  padding: 24px;
  width: 100%;
}

/* ============ ERINNERUNGEN ============ */
.reminders-wrap {
  padding: 24px;
  width: 100%;
}
.reminder-section {
  margin-bottom: 24px;
}
.reminder-section h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.reminder-section h2 .count {
  background: #e1e1e1;
  color: #555;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 10px;
}
.reminder-section.overdue h2 .count { background: #fde0e0; color: #c94545; }
.reminder-section.today h2 .count { background: #faeacd; color: #8a5a00; }
.reminder-section.week h2 .count { background: #e0ecff; color: #1e4179; }

.reminder-list {
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  overflow: hidden;
}
.reminder-item {
  display: grid;
  grid-template-columns: 30px 110px minmax(0, 1fr) 160px 280px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
@media (max-width: 900px) {
  .reminder-item {
    grid-template-columns: 30px 110px minmax(0, 1fr);
    grid-template-rows: auto auto;
    row-gap: 6px;
  }
  .reminder-item > .actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.reminder-item:last-child { border: none; }
.reminder-item:hover { background: #f8faff; }
.reminder-item .when {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}
.reminder-item .when.overdue { color: #c94545; font-weight: 600; }
.reminder-item .when.today { color: #c97a1f; font-weight: 600; }
.reminder-item .betreff { font-weight: 500; }
.reminder-item .betreff .pn {
  display: block;
  font-size: 11px;
  color: #888;
  font-weight: 400;
  margin-top: 2px;
}
.reminder-item .actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.reminder-item .actions .btn {
  padding: 4px 10px;
  font-size: 12px;
}
