/* ══════════════════════════════════════════════
   PJ REDAKTIONS-HUB – Design System v4.0
   ══════════════════════════════════════════════ */

:root {
  --pj-green: #24A27F;
  --pj-green-dark: #1B7A5F;
  --pj-green-light: #E8F5F0;
  --pj-green-glow: rgba(36, 162, 127, 0.12);
  --bg-page: #F4F6F9;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FAFBFC;
  --text-primary: #1A1F36;
  --text-secondary: #5A6278;
  --text-muted: #8E95A7;
  --border-light: #E5E9F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.04), 0 4px 6px rgba(0,0,0,0.06);
  --radius-sm: 6px;
  --radius-md: 8px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-page);
  height: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ── Login ── */

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-page);
}

.login-card {
  background: var(--bg-card);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.login-card input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: border var(--transition);
  box-sizing: border-box;
}

.login-card input:focus {
  outline: none;
  border-color: var(--pj-green);
  box-shadow: 0 0 0 3px var(--pj-green-glow);
}

#login-form, #setup-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.login-error {
  color: #E53935;
  font-size: 0.8rem;
  min-height: 1rem;
}

/* ── App Layout ── */

#app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.2rem 0.8rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0 1rem;
}

.sidebar-nav {
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.2rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  background: var(--pj-green-glow);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--pj-green-glow);
  color: var(--pj-green);
  border-left-color: var(--pj-green);
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
}

.sidebar-section {
  padding: 0.5rem 1.2rem;
  flex: 1;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.sidebar-footer {
  padding: 0.8rem 1.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

/* ── Main Content ── */

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  background: var(--bg-page);
}

/* ── Page Header ── */

.page-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.page-header svg {
  color: var(--pj-green);
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ── Section Headers ── */

.section-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
  margin-top: 1.2rem;
}

.section-header svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.section-header h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--pj-green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--pj-green-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-page);
  color: var(--text-primary);
}

.btn-danger {
  background: #fff;
  color: #E53935;
  border: 1px solid #FFCDD2;
}

.btn-danger:hover {
  background: #FFEBEE;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-icon.danger:hover {
  color: #E53935;
  border-color: #FFCDD2;
  background: #FFEBEE;
}

/* ── Cards ── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-accent {
  border-top: 3px solid var(--pj-green);
}

/* ── Tabs ── */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 1.2rem;
}

.tab {
  padding: 0.7rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.tab:hover { color: var(--text-secondary); }

.tab.active {
  color: var(--pj-green);
  border-bottom-color: var(--pj-green);
}

/* ── Two-Column Layout ── */

.split-view {
  display: flex;
  gap: 1.5rem;
  height: calc(100vh - 120px);
}

.split-list {
  width: 400px;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.split-detail {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

/* ── Mail List Header ── */

.mail-list-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border-bottom: 2px solid var(--border-light);
  background: var(--bg-page);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ── Mail List Items ── */

.mail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
}

.mail-item:hover {
  background: var(--pj-green-glow);
}

.mail-item.active {
  background: var(--bg-page);
  border-left: 3px solid var(--pj-green);
}

.mail-item.checked {
  background: rgba(36, 162, 127, 0.06);
}

/* ── Checkboxes ── */

.mail-checkbox-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  cursor: pointer;
}

.mail-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--pj-green);
  cursor: pointer;
  margin: 0;
}

.mail-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mail-item-dot.neu { background: #4A9EDE; }
.mail-item-dot.zu_news { background: var(--pj-green); }
.mail-item-dot.zu_messe { background: #E8A838; }
.mail-item-dot.zu_termin { background: #9B59B6; }

.mail-item-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mail-item-subject {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.mail-item-sender {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.mail-item-preview {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mail-item-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.mail-item-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.mail-item:hover .mail-item-actions {
  opacity: 1;
}

/* ── Detail Panel ── */

.detail-header {
  margin-bottom: 1.5rem;
}

.detail-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail-meta .label {
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.detail-body {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 50vh;
  overflow-y: auto;
}

/* ── Attachments ── */

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.attachment-chip:hover {
  border-color: var(--pj-green);
  color: var(--pj-green);
}

.attachment-chip svg {
  width: 14px;
  height: 14px;
}

/* ── Contacts ── */

.contact-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--pj-green-light);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--pj-green-dark);
}

/* ── Status Badge ── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge.offen { background: #FFF3E0; color: #E65100; }
.status-badge.neu { background: #E3F2FD; color: #1565C0; }
.status-badge.zu_news { background: var(--pj-green-light); color: var(--pj-green-dark); }
.status-badge.zu_messe { background: #FFF8E1; color: #F57F17; }
.status-badge.zu_termin { background: #F3E5F5; color: #7B1FA2; }

/* ── Modal / Overlay ── */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  min-width: 360px;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

.modal h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.2rem;
}

/* ── Form Elements ── */

.form-group {
  margin-bottom: 0.8rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.3rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--pj-green);
  box-shadow: 0 0 0 3px var(--pj-green-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Toast / Notifications ── */

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  z-index: 2000;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast.success { background: var(--pj-green); }
.toast.error { background: #E53935; }
.toast.info { background: #1976D2; }

/* ── Messe Tags in Sidebar ── */

.messe-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0.15rem 0.15rem;
  cursor: default;
}

/* ── Spinner ── */

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-dark {
  border-color: var(--border-light);
  border-top-color: var(--pj-green);
}

/* ── Empty State ── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* ── Animations ── */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Scrollbar ── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Utility ── */

.hidden { display: none !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }
.flex { display: flex; }
.gap-05 { gap: 0.5rem; }
.gap-1 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
/* ── News-Factory ── */

.nf-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 0;
}

.nf-tab {
  padding: 0.6rem 1.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.nf-tab:hover { color: var(--text-primary); }
.nf-tab.active {
  color: var(--pj-green);
  border-bottom-color: var(--pj-green);
}

.nf-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nf-radio-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition);
}

.nf-radio-label:has(input:checked) {
  border-color: var(--pj-green);
  background: var(--pj-green-glow);
  color: var(--pj-green-dark);
  font-weight: 600;
}

.nf-radio-label input { accent-color: var(--pj-green); }

.nf-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.nf-copy-block {
  background: #fff;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-light);
  margin-bottom: 0.6rem;
}

.nf-copy-block.nf-copy-accent {
  border-top: 3px solid var(--pj-green);
}

.nf-copy-block.nf-copy-left {
  border-left: 3px solid var(--pj-green);
}

.nf-copy-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nf-copy-count { color: var(--text-secondary); }

.nf-copy-content {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-top: 0.3rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.nf-source-box {
  background: #fff;
  padding: 0.8rem;
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text-secondary);
}

.nf-source-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.3rem 0;
}

.nf-url-preview {
  background: var(--bg-page);
  padding: 0.5rem 0.8rem;
  border-left: 3px solid var(--pj-green);
  font-size: 0.82rem;
}

.nf-url-preview a { color: var(--pj-green); font-weight: 500; }

.nf-compare-box {
  background: var(--bg-page);
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
}

.nf-compare-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.nf-image-box {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0.5rem;
}

.nf-archive-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.nf-archive-summary:hover { background: var(--pj-green-glow); }

.nf-body-h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.8rem 0 0.3rem 0;
  padding: 0;
}

.nf-body-rendered { line-height: 1.7; }

.nf-attachments-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nf-attachment-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.nf-attachment-icon { font-size: 1.3rem; }

.nf-attachment-info { display: flex; flex-direction: column; min-width: 0; }

.nf-attachment-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--pj-green);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nf-attachment-name:hover { text-decoration: underline; }

.nf-attachment-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nf-attachment-preview {
  margin: 0.3rem 0 0.5rem 0;
  padding: 0.3rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
}

/* ── WordPress Integration ── */

.btn-wp {
  background: #0073AA;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-wp:hover { background: #005B8A; }
.btn-wp:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-wp.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.73rem; }

.nf-wp-box {
  background: #F7FBFE;
  border: 1px solid #D4E8F5;
  border-left: 3px solid #0073AA;
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.nf-wp-success {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #1B7A5F;
  padding: 0.4rem 0;
}

.nf-wp-error {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #C62828;
  padding: 0.4rem 0;
}

.nf-wp-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nf-wp-image-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  max-width: 140px;
}

.nf-wp-image-option:hover { border-color: #0073AA; }

.nf-wp-image-option.selected {
  border-color: #0073AA;
  background: #F0F8FF;
}

.nf-wp-image-option input { display: none; }

.nf-wp-image-option img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 3px;
}

.nf-wp-image-none {
  width: 120px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nf-wp-image-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge.archiviert { background: #F4F6F9; color: var(--text-muted); }
.status-badge.veroeffentlicht { background: #E8F5F0; color: #1B7A5F; }

.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Team Table ── */

.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.team-table th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid var(--border-light);
  background: var(--bg-page);
}

.team-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.team-table tr:last-child td {
  border-bottom: none;
}

.team-table tr.inactive td {
  opacity: 0.5;
}

.team-table tr:hover td {
  background: var(--pj-green-glow);
}

/* ── Task Items (Dashboard) ── */

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.12s;
}

.task-item:hover {
  background: var(--bg-hover);
}

.task-item:last-child {
  border-bottom: none;
}

.task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.35rem;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.task-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}


/* ══════════════════════════════════════════════ */
/* MESSE-HUB MODULE                               */
/* ══════════════════════════════════════════════ */

.mh-add-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.mh-add-bar .form-input {
  max-width: 350px;
}

.mh-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mh-tag-pill {
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mh-tag-pill:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.mh-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
}

.mh-tab {
  padding: 0.6rem 1.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
}

.mh-tab:hover { color: var(--text-primary); }

.mh-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.mh-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.mh-radio-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.mh-radio-label input[type="radio"] {
  accent-color: var(--accent);
}

/* Info-Box */
.mh-info-box {
  background: #FFFFFF;
  padding: 0.8rem 1rem;
  border-top: 4px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-top: 0.8rem;
}

.mh-info-box-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.mh-info-row {
  display: flex;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-light);
}

.mh-info-label {
  font-weight: 700;
  color: var(--text-primary);
  min-width: 110px;
  font-size: 0.82rem;
}

.mh-info-value {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* Grid for edit mode */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* Archive */
.mh-archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mh-archive-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.mh-archive-item summary {
  padding: 0.8rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mh-archive-item summary:hover { background: var(--bg-page); }

.mh-archive-body {
  padding: 0 1rem 1rem 1rem;
}

/* ── Messe Output Tabs (Print/Online) ── */
.mh-output-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
}

.mh-output-tab {
  padding: 0.5rem 1.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
}

.mh-output-tab:hover { color: var(--text-primary); }

.mh-output-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Mail Initials Badge ── */
.mail-initials-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 18px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-left: 0.4rem;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Team Avatar Buttons */
.team-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.team-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.team-avatar-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.team-avatar-btn.selected {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transform: scale(1.08);
}

/* Small team badge for lists */
.team-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 16px;
  border-radius: 3px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ── Messe List Tag ── */
.mh-list-messe-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 1.4;
}

/* ── Moved Mail Badge ── */
.mail-moved-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 0.3rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.mail-moved-badge.zu_news { background: #E3F2FD; color: #1565C0; }
.mail-moved-badge.zu_messe { background: #FFF8E1; color: #F57F17; }
.mail-moved-badge.zu_termin { background: #F3E5F5; color: #7B1FA2; }

.mail-item.moved {
  opacity: 0.6;
}
.mail-item.moved:hover {
  opacity: 0.85;
}

/* ── Messe Management Section ── */
.mh-manage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.mh-messe-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.mh-messe-card-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.mh-messe-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   KALENDER / TABS
   ══════════════════════════════════════════════ */

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--pj-green);
  border-bottom-color: var(--pj-green);
}

/* Calendar Grid */
.cal-grid {
  padding: 0;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-light);
}

.cal-header > div {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-header .cal-weekend {
  color: var(--text-muted);
  opacity: 0.6;
}

.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
  min-height: 80px;
  padding: 0.3rem;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  background: #fff;
}

.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell.cal-empty {
  background: var(--bg-page);
}

.cal-cell.cal-weekend-cell {
  background: #FAFBFC;
}

.cal-cell.cal-today {
  background: rgba(36, 162, 127, 0.06);
}

.cal-cell.cal-today .cal-day-num {
  background: var(--pj-green);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-cell.cal-has-entries {
  cursor: pointer;
}

.cal-cell.cal-has-entries:hover {
  background: rgba(36, 162, 127, 0.08);
}

.cal-day-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 2px;
}

.cal-entry {
  font-size: 0.6rem;
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  font-weight: 600;
}
