/* ---------- Buttons (Pills — Leitstand 2.0) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: .01em;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .05s;
  font-family: inherit;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
/* Pills nie vertikal strecken (Flex-Container mit align-items:stretch) */
.btn { max-height: 46px; align-self: center; }
.form-grid > .btn, .card > .btn { align-self: stretch; }
/* Nur der interne Veranstaltungs-Dialog. components.css laedt auf JEDER Seite:
   ein blankes `.form-grid { max-width }` traf sonst alle Admin-Einstellungen,
   /login und /login/2fa mit. `.table-actions` deckt admin.css bereits ab. */
.internal-surface .form-grid { max-width: 42rem; }
.internal-surface .form-grid textarea { min-height: 110px; width: 100%; resize: vertical; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary-dark) 35%, transparent);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--surface-3); color: var(--text-strong); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-soft); border-color: var(--surface-soft); }
.btn-ghost { background: transparent; color: var(--text-strong); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--surface-soft); }
/* Rot-Wash-Variante: sanfte Auswahl/CTA ohne Vollfarbe. */
.btn-wash {
  background: var(--primary-wash);
  color: var(--primary-soft);
  border: 1px solid var(--primary-ring);
  font-weight: 700;
}
.btn-wash:hover { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.inline-form { margin: 0; }

/* ---------- Pills / Chips ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--primary-wash);
  color: var(--primary-soft);
  border: 1px solid var(--primary-ring);
  white-space: nowrap;
}
.pill-solid { background: var(--primary); color: #fff; border-color: transparent; }
.pill-alarm { background: transparent; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.pill-ok { background: var(--ok-wash); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.pill-muted { background: transparent; color: var(--text-soft); border: 1px solid var(--line); }

/* Status-Chip mit LED (Topbar, Leitstand) */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ok);
  background: var(--ok-wash);
  border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  white-space: nowrap;
}
.status-chip .led {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 80%, transparent);
}
.status-chip--alarm {
  color: var(--primary-soft);
  background: var(--primary-wash);
  border-color: var(--primary-ring);
}
.status-chip--alarm .led {
  background: var(--primary);
  box-shadow: 0 0 8px color-mix(in srgb, var(--primary) 80%, transparent);
  animation: led-pulse 1.4s ease-in-out infinite;
}
@keyframes led-pulse { 50% { opacity: .35; } }

/* ---------- Cards ---------- */
.card,
.post-card,
.article-card,
.empty-card,
.stat-card {
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.card, .article-card, .empty-card { padding: 22px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { margin: 0; font-size: 1.05rem; }

/* Kachel-Label: rote Kerbe + Uppercase-Microlabel (Leitstand-Signatur) */
.tile-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.tile-label::before {
  content: "";
  width: 3px;
  height: 12px;
  background: var(--primary);
  border-radius: 2px;
  flex: 0 0 auto;
}
.tile-label .tile-link {
  margin-left: auto;
  color: var(--primary-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.tile-label .tile-link:hover { color: var(--text-strong); }

/* Kennzahlen-Kacheln (Dashboard, Settings-Hub) */
.stats-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 18px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
}
.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.stat-card strong {
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
}
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.list-plain a { color: var(--text); padding: 4px 0; display: inline-block; }
.list-plain a:hover { color: var(--text-strong); }

/* ---------- Alerts ---------- */
.alert {
  margin: 0 0 14px;
  padding: 11px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}
.alert-error {
  background: var(--primary-wash);
  border-color: var(--primary-ring);
  color: #ffd9dd;
}
.alert-success {
  background: var(--ok-wash);
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  color: #d9f5e6;
}

/* ---------- Kategorie-Badges (Einsatzart/Alarmstufe, Info, Veranstaltung) ---------- */
.cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1em;
  height: 2em;
  padding: 0 .65em;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .03em;
  line-height: 1;
  vertical-align: middle;
}
.cat-badge--brand         { background: var(--primary); color: #fff; }
.cat-badge--technisch     { background: #1e5fa8; color: #fff; }
.cat-badge--schadstoff    { background: #2e7d32; color: #fff; }
.cat-badge--veranstaltung { background: #d9ab1f; color: #15171b; }
.cat-badge--info          { background: var(--surface-3); color: var(--text); border: 1px solid var(--line); }

/* ---------- Cookie-Consent + Klick-zum-Laden ---------- */
.consent-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 1200; width: min(720px, calc(100vw - 24px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: var(--radius-lg, 16px);
  background: var(--surface, #12151b); border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45); color: var(--text);
}
.consent-banner-text { flex: 1 1 260px; font-size: 14px; line-height: 1.5; color: var(--text-soft, #cfd6e0); }
.consent-banner-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.consent-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px; min-height: 160px;
  background: var(--surface-2, #171b22); border: 1px dashed var(--line); border-radius: var(--radius, 12px);
  color: var(--text-soft, #cfd6e0);
}
.consent-ph-text { margin: 0; font-weight: 600; }
.consent-ph-note { margin: 0; font-size: 12px; color: var(--muted); }
.consent-ph-note a { color: var(--primary-soft, #ff8a94); }

/* ===== Nextcloud-Dateibrowser (intern, Modul n2) ===== */
.ncfb-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft);
}
.ncfb-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.ncfb-crumb {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  color: var(--text-soft); text-decoration: none; font-size: 14px;
  max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.ncfb-crumb:hover { background: var(--surface-3); color: var(--text-strong); }
.ncfb-crumb.is-current { background: var(--primary-wash); color: var(--primary-soft); }
.ncfb-sep { color: var(--muted); }
.ncfb-count { color: var(--muted); font-size: 13px; white-space: nowrap; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.ncfb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ncfb-item {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.ncfb-item:hover { border-color: var(--primary-ring); background: var(--surface-3); }
.ncfb-icon { flex: 0 0 auto; display: inline-flex; color: var(--text-soft); }
.ncfb-item.is-folder .ncfb-icon { color: var(--accent); }
.ncfb-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncfb-item:hover .ncfb-name { color: var(--text-strong); }
.ncfb-meta { flex: 0 0 auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ncfb-dl { flex: 0 0 auto; display: inline-flex; color: var(--muted); }
.ncfb-item:hover .ncfb-dl { color: var(--primary-soft); }
.ncfb-up { background: transparent; border-style: dashed; color: var(--text-soft); }
.ncfb-empty {
  padding: 22px 12px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-soft); border-radius: var(--radius);
}

/* ===== Datei-Browser: Upload (Drag & Drop + Button) ===== */
.ncfb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ncfb-upload-btn { display: inline-flex; align-items: center; gap: 6px; }
.ncfb.is-dragover { outline: 2px dashed var(--primary-ring); outline-offset: 6px; border-radius: var(--radius); background: var(--primary-wash); }
.ncfb-hint { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.ncfb-date { flex: 0 0 auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.ncfb-progress {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 10px 12px; border: 1px dashed var(--line-soft); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
}
/* display:flex schlägt sonst das hidden-Attribut (Backup-Seite blendet per hidden um). */
.ncfb-progress[hidden] { display: none; }
.ncfb-progress-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncfb-progress-bar { flex: 1 1 120px; height: 6px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.ncfb-progress-fill { display: block; width: 0; height: 100%; border-radius: var(--radius-pill); background: var(--primary); transition: width .2s ease; }
.ncfb-progress-info { flex: 0 1 auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ncfb-progress.is-done { border-style: solid; border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.ncfb-progress.is-done .ncfb-progress-fill { background: var(--ok); }
.ncfb-progress.is-done .ncfb-progress-info { color: var(--ok); }
.ncfb-progress.is-error { border-style: solid; border-color: var(--primary-ring); }
.ncfb-progress.is-error .ncfb-progress-info { color: var(--primary-soft); white-space: normal; }

/* ===== Nextcloud-Module (intern): geteilte Listen/Karten im Leitstand-Look ===== */
.ncl-status {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 6px; padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 13px; color: var(--text-soft); background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.ncl-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.ncl-status.is-ok .ncl-status-dot { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.ncl-status.is-warn .ncl-status-dot { background: var(--warn); box-shadow: 0 0 6px var(--warn); }

.ncl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ncl-item {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
}
.ncl-item.is-holiday { background: transparent; border-style: dashed; }
.ncl-icon { flex: 0 0 auto; display: inline-flex; color: var(--text-soft); }
.ncl-time {
  flex: 0 0 auto; min-width: 150px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.ncl-time strong { color: var(--text-strong); font-weight: 600; margin-left: 6px; }
.ncl-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
a.ncl-title:hover { color: var(--text-strong); text-decoration: underline; }
.ncl-date { flex: 0 0 auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ncl-pill {
  flex: 0 0 auto; padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 12px; color: var(--text-soft); background: var(--surface-3);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.ncl-pill.is-accent { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ncl-pill.is-ok { color: var(--ok); background: var(--ok-wash); }
.ncl-links { flex: 0 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: right; }
.ncl-links a { color: var(--text-soft); font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncl-links a:hover { color: var(--primary-soft); }
.ncl-avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-wash); color: var(--primary-soft);
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.ncl-empty {
  padding: 22px 12px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-soft); border-radius: var(--radius); margin: 0;
}
.ncl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ncl-card {
  padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  background: var(--card-grad); display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.ncl-card h3 { margin: 0; font-size: 15px; color: var(--text-strong); }
.ncl-card p { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.5; }
.ncl-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; flex-wrap: wrap; }
