/* bibber – app-spezifische Ergänzungen.
   tokens.css + app-shell.css liefern die Shell; hier NUR ergänzen, nie überschreiben. */

.breadcrumb { --bs-breadcrumb-divider: '›'; }

/* App-Name unter dem Thingware-Logo (CD design-system.md: klein, gedämpft) */
#sidebar-app {
  padding: .35rem 1.25rem .75rem;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tw-sidebar-muted);
  border-bottom: 1px solid var(--tw-border-soft);
}
#sidebar-app i { color: var(--tw-accent); margin-right: .4rem; }

/* Gruppen-/Tenant-Selektor in der dunklen Sidebar */
#sidebar-tenant { padding: .75rem 1.25rem; border-bottom: 1px solid var(--tw-border-soft); }
#sidebar-tenant .tenant-static {
  display: flex; align-items: center;
  color: var(--tw-sidebar-text); font-size: .85rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#sidebar-tenant .tenant-static i { color: var(--tw-sidebar-muted); }
#sidebar-tenant .form-select,
#sidebar-tenant .select2-selection {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--tw-border-soft);
  color: #fff;
}
#sidebar-tenant .select2-selection__rendered { color: #fff !important; }
#sidebar-tenant .select2-selection__arrow b { border-color: var(--tw-sidebar-footer) transparent transparent; }

/* Sidebar-Footer: Sprachwahl + Rechtsblock */
#sidebar-footer #lang-switcher {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--tw-border-soft);
  color: #fff;
  font-size: .8rem;
}
#sidebar-footer .btn { width: 100%; text-align: left; }
#sidebar-footer .sidebar-copyright {
  margin-top: .9rem; padding-top: .6rem;
  border-top: 1px solid var(--tw-border-soft);
  font-size: .75rem;
}
#sidebar-footer .sidebar-copyright a,
#sidebar-footer .sidebar-legal a { color: var(--tw-sidebar-footer); text-decoration: none; }
#sidebar-footer .sidebar-copyright a:hover,
#sidebar-footer .sidebar-legal a:hover { color: var(--tw-sidebar-muted); }
#sidebar-footer .cl-icon {
  background: none; border: none; padding: 0 0 0 .35rem;
  color: var(--tw-sidebar-footer); font-size: .75rem;
}
#sidebar-footer .cl-icon:hover { color: var(--tw-sidebar-muted); }
#sidebar-footer .sidebar-legal { font-size: .75rem; margin-top: .15rem; }

/* Drill-down-Karten */
.hierarchy-card { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.hierarchy-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .12) !important; transform: translateY(-1px); }
.hierarchy-card .card-footer button { position: relative; z-index: 1; }

/* Abschnittsüberschrift (CD: Sekundär-Labels ~0.72rem, uppercase) */
.section-label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: #6c757d; margin-bottom: .5rem; }

/* Kennzahl-Kacheln (Lageübersicht, Gerätedetail) */
.kpi-tile { background: var(--tw-content-bg); border-radius: .5rem; padding: .6rem .75rem; height: 100%; border-left: 3px solid transparent; }
.kpi-tile .kpi-label { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: #6c757d; }
.kpi-tile .kpi-value { font-size: 1.35rem; font-weight: 600; line-height: 1.3; }
.kpi-tile .kpi-sub { font-size: .78rem; color: #6c757d; }
.kpi-tile.tone-ok { border-left-color: #198754; }
.kpi-tile.tone-info { border-left-color: #0dcaf0; }
.kpi-tile.tone-warning { border-left-color: #fd7e14; }

/* Meldungs-Symbole in der Geräteliste */
.alert-chip { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.5rem; border-radius: .35rem; font-size: .78rem; }
.device-row { cursor: pointer; }

/* Zähler am Menüpunkt „Meldungen" */
#nav-menu .nav-link { display: flex; align-items: center; }
#nav-menu .nav-count { font-size: .7rem; }

/* Tages-Zeitleiste der Heizprofile */
.timeline { width: 100%; }
.timeline .tl-bar { position: relative; display: flex; height: 22px; border-radius: .35rem; overflow: hidden; background: #e9ecef; }
.timeline-compact .tl-bar { height: 8px; border-radius: 4px; }
.timeline .tl-seg { height: 100%; display: flex; align-items: center; justify-content: center; font-size: .72rem; color: #1a1f2e; border-right: 1px solid rgba(255, 255, 255, .6); }
.timeline .tl-seg:last-child { border-right: none; }
.timeline .tl-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #1a1f2e; }
.timeline .tl-ticks { display: flex; justify-content: space-between; font-size: .65rem; color: #9ba8bb; margin-top: 2px; }

/* Bereichssteuerung */
.area-control .card-header { cursor: pointer; }

/* ── Gebäudekarte mit Foto (v0.16) ───────────────────────────────────────────
   Das Foto füllt den Kopf der Karte; Name und Chips liegen auf einem dunklen
   Verlauf, damit sie auf jedem Bild lesbar bleiben. Ohne Foto: ruhiger Verlauf. */
.building-card { overflow: hidden; border: 0; }
.bcard-media {
  position: relative; height: 150px; color: #fff;
  background: linear-gradient(135deg, #2b3550 0%, #1a1f2e 100%);
}
.bcard-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.bcard-media img.loaded { opacity: 1; }
.bcard-placeholder { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 4.5rem; color: rgba(255, 255, 255, .07); }
.bcard-media.has-image .bcard-placeholder { display: none; }
.bcard-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 14, 24, .82) 0%, rgba(10, 14, 24, .35) 45%, rgba(10, 14, 24, .15) 70%, rgba(10, 14, 24, .45) 100%);
}
.bcard-top { position: absolute; top: .6rem; left: .75rem; right: .75rem; display: flex; gap: .4rem; align-items: center; }
.bcard-bottom { position: absolute; left: .9rem; right: 3.4rem; bottom: .7rem; }
.bcard-title { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.25; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); overflow-wrap: anywhere; }
.bcard-chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; line-height: 1; padding: .3rem .5rem;
  border-radius: 999px; background: rgba(10, 14, 24, .55); color: #fff; backdrop-filter: blur(4px);
}
.bcard-chip.label { text-transform: uppercase; letter-spacing: .06em; }
.bcard-chip.observe { background: rgba(13, 202, 240, .85); color: #062c33; font-weight: 600; }
.bcard-photo-btn {
  position: absolute; right: .6rem; bottom: .6rem; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .9); color: #1a1f2e; display: grid; place-items: center;
  opacity: .85; transition: opacity .15s, transform .15s; z-index: 2;
}
.bcard-photo-btn:hover, .bcard-photo-btn:focus-visible { opacity: 1; transform: scale(1.06); }
/* 3D-Schnellansicht (v0.27): gut erkennbarer Knopf „3D" links neben der Kamera */
.bcard-3d-btn {
  position: absolute; right: 3.1rem; bottom: .6rem; height: 2.1rem; padding: 0 .7rem; border-radius: 999px;
  border: 0; background: #fff; color: #1a1f2e; display: inline-flex; align-items: center; gap: .35rem;
  font-weight: 700; font-size: .85rem; letter-spacing: .02em; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  transition: transform .15s; z-index: 2;
}
.bcard-3d-btn i { color: #3d7be0; font-size: 1rem; }
.bcard-3d-btn.solo { right: .6rem; }
.bcard-3d-btn:hover, .bcard-3d-btn:focus-visible { transform: scale(1.06); }
.bcard-media.has-3d .bcard-bottom { right: 7.6rem; }
.building-card .bcard-stats { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.building-card .bcard-temp { font-size: 1.6rem; font-weight: 600; line-height: 1; }

/* Gebäude-Banner auf den Unterseiten eines Gebäudes */
.building-hero { position: relative; height: 120px; border-radius: var(--tw-card-radius); overflow: hidden; margin-bottom: 1rem; box-shadow: var(--tw-card-shadow); }
.building-hero .bcard-media { height: 100%; }
.building-hero .bcard-title { font-size: 1.35rem; }

/* Geräteliste einer Ebene: eingeklappt, bis man sie braucht */
.device-list-toggle { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; }
.device-list-toggle .fa-chevron-down { transition: transform .2s; }
.device-list-toggle[aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }

/* Foto-Upload */
.image-drop {
  position: relative; min-height: 220px; border: 2px dashed #ced4da; border-radius: .6rem; background: var(--tw-content-bg);
  display: grid; place-items: center; overflow: hidden; cursor: pointer; outline: none;
}
.image-drop:focus-visible, .image-drop.dragging { border-color: var(--tw-accent); background: var(--tw-accent-soft); }
.image-drop img { max-width: 100%; max-height: 320px; display: block; }
.image-drop-empty { color: #6c757d; text-align: center; padding: 1.5rem; }
.image-drop-busy { position: absolute; inset: 0; background: rgba(10, 14, 24, .45); display: grid; place-items: center; }

/* Installationsort-Foto im Gerät */
.device-photo { position: relative; border-radius: .5rem; overflow: hidden; background: var(--tw-content-bg); }
.device-photo img { width: 100%; max-height: 280px; object-fit: cover; display: block; cursor: zoom-in; }
.device-photo-empty { border: 2px dashed #dee2e6; border-radius: .5rem; padding: 1.25rem; text-align: center; color: #6c757d; }
.image-lightbox img { width: 100%; height: auto; border-radius: .4rem; }

/* Geräte-Icons auf Raumkarten (Ventil · Raumfühler · Raumregler) */
.device-icons { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.device-icon {
  display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: .4rem;
  background: var(--tw-content-bg); color: #495057; text-decoration: none; font-size: .85rem;
  border: 1px solid #e9ecef; transition: transform .12s, border-color .12s;
}
.device-icon:hover, .device-icon:focus-visible { transform: translateY(-1px); border-color: var(--tw-accent); color: #1a1f2e; }
.device-icon.is-heating { background: #fff1e6; color: #d9480f; border-color: #ffd8bf; }
.device-icon.is-issue { background: #fff8db; color: #b08800; border-color: #ffe58f; }
.device-icon.is-silent { opacity: .45; }
.device-icon-more { font-size: .75rem; color: #6c757d; align-self: center; }

/* Eigene Geräte-Zeichen (Overview.js) — verhalten sich wie ein Font-Awesome-Icon */
.bb-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; }
