/* Host-spezifische Overrides – Basisdesign: _content/BBasic.BBRazor/bb-theme.css
   BBBlazor = helle Seite: dunkle Schrift erzwingen (bb-theme ist dunkel gedacht). */

html, body {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  min-height: 100%;
  height: auto;
  overflow-y: auto;
  pointer-events: auto !important;
}

/* bb-theme setzt .page/.content auf helle Textfarbe – hier überschreiben */
.page,
.page .content,
article.content,
.bb-page,
.bc-shell,
.bc-home-termine,
.bc-term-list {
  color: #0f172a !important;
  pointer-events: auto !important;
}

/*
  Standard-Links im Content (nicht Kacheln).

  Die Ausnahmeliste ist Pflicht, nicht Geschmack: Diese Regel hat fünf Klassen
  plus ein Element und schlägt damit JEDE Regel aus cockpit.css – auch eine mit
  !important, denn bei gleichem Gewicht entscheidet die Spezifität, und
  app.css wird ausserdem später geladen. Ein Element, das kein gewöhnlicher
  Link ist, sondern ein Knopf oder ein Reitereintrag, muss hier hinein, sonst
  bekommt es Hellblau verpasst – auf dunkelblauem Grund unlesbar.
*/
.page a:not(.bc-shell-tile):not(.bc-term-row):not(.bc-term-btn):not(.navbar-brand):not(.cp-btn):not(.cp-leiste-eintrag):not(.cp-leiste-fuss-link):not(.todo-btn):not(.ma-btn) {
  color: #0369a1 !important;
}

.px-4 {
  padding-right: 0.5rem !important;
  padding-left: 0.5rem !important;
}

.page main,
article.content {
  padding-bottom: 1.25rem;
  pointer-events: auto !important;
  position: relative;
  z-index: 1;
}

/* Kein unsichtbares Overlay über dem Inhalt */
.page main > *,
article.content > * {
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
}

/* loading-screen darf nicht dauerhaft über der Seite liegen */
.loading-screen {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  padding: 2rem;
  text-align: center;
  color: #0f172a !important;
}

.bb-blazor-loading {
  min-height: 40vh;
  display: grid;
  place-items: center;
  color: #0f172a !important;
}

/* Kacheln/Termine immer klickbar, auch wenn ein Parent pointer-events verliert */
.bc-shell-tile,
.bc-term-btn,
.bc-term-row,
.bc-cal-agenda-item,
.bc-cal-cal-item {
  pointer-events: auto !important;
  cursor: pointer;
}

/* Kalender-Seite: Höhe bis Viewport, Scroll in der Agenda-Liste */
.bb-page-cal {
  min-height: 0;
  flex: 1;
}
.bb-page-cal .bc-cal {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  height: 100% !important;
}
.bb-page-cal .bc-cal-agenda {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Abschnittstitel: nie gelbe Schrift ohne Untergrund */
.bc-shell-section,
.bc-term-day,
.bc-term-list-title,
.bc-cal-agenda-day {
  color: #0f172a !important;
  background: #facc15 !important;
}

/*
  BBBlazor = heller Host, Formulare/Aktionen-Menü bleiben dunkel (bb-theme).
  Host-Overrides dürfen dort keine dunkle Schrift erzwingen.
*/
.bb-form-card,
.bb-form-body,
.bb-segment-body {
  color: #f1f5f9 !important;
}

.bb-menu-panel,
.bb-menu-panel .bb-menu-title,
.bb-menu-panel .k-treeview,
.bb-menu-panel .k-treeview-leaf,
.bb-menu-panel .k-treeview-leaf-text,
.bb-menu-panel .k-treeview span {
  color: #f8fafc !important;
}

.bb-menu-panel {
  background: #0f172a !important;
}

.k-popup,
.k-popup .k-button,
.k-popup .k-button .k-button-text,
.k-popup .k-list-item,
.k-popup .k-menu-link-text {
  color: #f8fafc !important;
}

.k-popup {
  background: #1e293b !important;
}

/*
  Stammtisch (wie BBMieter): helles Social-Layout in dunkler bb-form-card.
  Einheitlicher Hintergrund, dunkle Schrift, gruene Pill-Buttons inkl. Like.
*/
.bb-form-card:has(.st-root),
.bb-form-body:has(.st-root),
.bb-segment-body:has(.st-root) {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.bb-form-card .st-root,
.bb-form-body .st-root,
.bb-segment-body .st-root {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.bb-form-card .st-root .st-toolbar,
.bb-form-card .st-root .st-composer,
.bb-form-card .st-root .st-filter-bar,
.bb-form-card .st-root .st-card,
.bb-form-card .st-root .st-detail-shell,
.bb-form-card .st-root .st-inbox,
.bb-form-card .st-root .st-empty {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

.bb-form-card .st-root .st-title,
.bb-form-card .st-root .st-card-title-feed,
.bb-form-card .st-root .st-card-title-feed .st-title-link,
.bb-form-card .st-root .st-title-link,
.bb-form-card .st-root .st-teaser-clamp,
.bb-form-card .st-root .st-teaser,
.bb-form-card .st-root .st-form-label,
.bb-form-card .st-root .st-empty,
.bb-form-card .st-root .st-themen-name,
.bb-form-card .st-root p {
  color: #1e293b !important;
  background: transparent !important;
}

.bb-form-card .st-root .st-subtitle,
.bb-form-card .st-root .st-card-author-line,
.bb-form-card .st-root .st-card-author-line .st-author-name,
.bb-form-card .st-root .st-meta-item,
.bb-form-card .st-root .st-form-hint,
.bb-form-card .st-root .st-meta {
  color: #64748b !important;
}

.bb-form-card .st-root button.st-btn-primary,
.bb-segment-body .st-root button.st-btn-primary {
  background: #16a34a !important;
  background-color: #16a34a !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 20px !important;
  box-shadow: none !important;
}

.bb-form-card .st-root button.st-btn-secondary,
.bb-form-card .st-root button.st-btn-ghost,
.bb-form-card .st-root button.st-like-btn,
.bb-segment-body .st-root button.st-btn-secondary,
.bb-segment-body .st-root button.st-like-btn {
  background: #dcfce7 !important;
  background-color: #dcfce7 !important;
  color: #14532d !important;
  border: none !important;
  border-radius: 20px !important;
  box-shadow: none !important;
}

.bb-form-card .st-root .st-tree-shell,
.bb-form-card .st-root .st-tree-shell .k-treeview,
.bb-form-card .st-root .st-tree-shell .k-treeview-item,
.bb-form-card .st-root .st-tree-shell .k-treeview-leaf,
.bb-form-card .st-root .st-tree-shell .k-treeview-leaf-text,
.bb-form-card .st-root .st-tree-shell .k-treeview span,
.bb-form-card .st-root .st-tree-shell .k-treeview-toggle {
  color: #0f172a !important;
  fill: #0f172a !important;
}

.bb-form-card .st-root .st-tree-shell {
  background: #ffffff !important;
  border: 1px solid #94a3b8 !important;
}

.bb-form-card .st-root .st-tree-shell .k-treeview-leaf.k-selected,
.bb-form-card .st-root .st-tree-shell .k-treeview-leaf.k-selected span {
  background: #16a34a !important;
  color: #ffffff !important;
  fill: #ffffff !important;
}