/* /frontend/css/hub.tiles.css
   HUB Tile System (Rooms / Team / WAS)
   Muss NACH /frontend/style.css geladen werden.
*/

:root{
  --hub-tile-min: 170px;         /* bestimmt, wie früh umgebrochen wird */
  --hub-tile-gap: 12px;
  --hub-tile-pad: 12px;
  --hub-tile-action-space: 56px; /* Platz unten für Iconbuttons */
  --hub-iconbtn: 38px;
}

/* =========================================================
   1) EINHEITLICHE GRIDS (wie Rooms: früh umbrechen, lesbar)
========================================================= */

#hub-section-rooms #hub-rooms-list.hub-rooms-list,
#hub-team-list-body #hub-team-tiles.wf-tilegrid,
#hub-section-workflows #hub-templates-list.wf-tilegrid{
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(var(--hub-tile-min), 1fr)) !important;
  gap: var(--hub-tile-gap) !important;
  align-items: stretch !important;
}


/* =========================================
   Workflows (HUB Callsystem): Template-Kachel Icons konsistent + größer
   Problem: manche SVGs kommen schon "weiß" oder farbig -> Filter sorgt für einheitliches Monochrome.
========================================= */
#hub-section-workflows #hub-templates-list .calls-tilebtn > .icon{
  display: grid !important;
  place-items: center !important;
  width: 48px !important;
  height: 48px !important;
  margin-bottom: 2px !important;
}

#hub-section-workflows #hub-templates-list .calls-tilebtn > .icon > img.icon-svg{
  width: 28px !important;
  height: 28px !important;
  display: block !important;
  filter: var(--icon-filter-on-primary) !important;
  opacity: .92 !important;
}

/* Action-Buttons (unten): NICHT von den Tile-Icon-Größen beeinflussen */
#hub-section-workflows #hub-templates-list .calls-tile__actions .icon{
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 0 !important;
}

/* Actions-Icons bewusst klein lassen (Top-Icon bleibt groß) */
#hub-section-workflows #hub-templates-list .calls-tile__actions .btn--icon-only img.icon-svg{
  width: 18px !important;
  height: 18px !important;
}
/* Action-Iconbuttons auf farbigen WAS-Kacheln: Iconfarbe konsistent */
#hub-section-workflows #hub-templates-list .btn--icon-only img.icon-svg{
  filter: var(--icon-filter-on-primary) !important;
}

/* Avoid: Iconpicker-Button hover wird zu dunkel */
#hub-section-workflows .icon-picker__btn:hover,
#hub-section-workflows .icon-picker__btn:focus{
  color: inherit !important;
  background: color-mix(in srgb, var(--color-bg-elevated) 78%, transparent) !important;
}

/* UL sauber */
#hub-section-rooms #hub-rooms-list.hub-rooms-list{
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ganz klein -> eine Spalte */
@media (max-width: 420px){
  #hub-section-rooms #hub-rooms-list.hub-rooms-list,
  #hub-team-list-body #hub-team-tiles.wf-tilegrid,
  #hub-section-workflows #hub-templates-list.wf-tilegrid{
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   2) ROOMS (nur Layout; Farben bleiben wie in style.css)
========================================================= */

#hub-section-rooms #hub-rooms-list .hub-room-tile{
  position: relative !important;
  aspect-ratio: 1 / 1 !important;

  padding: var(--hub-tile-pad) !important;
  padding-bottom: calc(var(--hub-tile-action-space) + var(--hub-tile-pad)) !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;

  overflow: hidden !important;
}

/* Actions unten mittig IN der Kachel */
#hub-section-rooms #hub-rooms-list .hub-room-actions{
  position: absolute !important;
  left: 50% !important;
  bottom: var(--hub-tile-pad) !important;
  transform: translateX(-50%) !important;

  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  z-index: 20 !important;
  width: max-content !important;
}

/* Kein Hint-Text im Hub */
#hub-section-rooms #hub-rooms-list .hub-room-action-hint{
  display: none !important;
}

/* =========================================================
   3) TEAM (wie Rooms, nur andere Farbe)
========================================================= */

#hub-team-list-body #hub-team-tiles .hub-team-tilewrap{
  position: relative !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  border-radius: var(--radius-lg) !important;
}

/* Button füllt Kachel + Platz unten für Actions */
#hub-team-list-body #hub-team-tiles .calls-tilebtn{
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box !important;
  border-radius: inherit !important;

  padding: var(--hub-tile-pad) !important;
  padding-bottom: calc(var(--hub-tile-action-space) + var(--hub-tile-pad)) !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  gap: 6px !important;

  /* Mitarbeiter: primary a55 (Fallback falls Variable nicht existiert) */
  background: var(--surface-primary-med-a55, color-mix(in srgb, var(--color-primary) 55%, var(--color-bg-elevated))) !important;
  border: 1px solid var(--color-border-soft) !important;
  color: #fff !important;

  overflow: hidden !important;
}

#hub-team-list-body #hub-team-tiles .calls-icon,
#hub-team-list-body #hub-team-tiles .calls-label,
#hub-team-list-body #hub-team-tiles .calls-label .text-small{
  color: #fff !important;
}

#hub-team-list-body #hub-team-tiles .calls-label{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  max-width: 100% !important;
}

#hub-team-list-body #hub-team-tiles .calls-label .text-small{
  font-weight: 500 !important;
  opacity: .85 !important;
  margin-top: 2px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

/* Actions unten mittig IN der Kachel */
#hub-team-list-body #hub-team-tiles .hub-team-tile-actions{
  position: absolute !important;
  left: 50% !important;
  bottom: var(--hub-tile-pad) !important;
  transform: translateX(-50%) !important;

  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  z-index: 20 !important;
}

/* =========================================================
   4) WAS (Workflows/Templates im Hub) – wie Rooms + Highlight
========================================================= */

#hub-section-workflows #hub-templates-list .calls-tile{
  position: relative !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden !important;
}

/* volle Highlightfläche */
#hub-section-workflows #hub-templates-list .calls-tilebtn{
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box !important;
  border-radius: inherit !important;

  padding: var(--hub-tile-pad) !important;
  padding-bottom: calc(var(--hub-tile-action-space) + var(--hub-tile-pad)) !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  gap: 6px !important;

  background: linear-gradient(
    to bottom right,
    var(--color-primary),
    var(--color-primary-strong, var(--color-primary))
  ) !important;

  border: 0 !important;
  color: var(--color-on-primary, #fff) !important;
}

#hub-section-workflows #hub-templates-list .calls-icon,
#hub-section-workflows #hub-templates-list .calls-label{
  color: inherit !important;
}


/* Actions unten mittig (egal wie die Actions-Box heißt) */
#hub-section-workflows #hub-templates-list .wf-preview-actions,
#hub-section-workflows #hub-templates-list .calls-tile-actions,
#hub-section-workflows #hub-templates-list .hub-template-actions{
  position: absolute !important;
  left: 50% !important;
  bottom: var(--hub-tile-pad) !important;
  transform: translateX(-50%) !important;

  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  z-index: 20 !important;
}

/* =========================================================
   5) ICONBUTTONS – Unified im Hub + 2-Klick rot
========================================================= */
/* =========================================================
   5) ICONBUTTONS – Unified im Hub + 2-Klick rot
========================================================= */

#hub-section-rooms .btn--icon-only,
#hub-section-roles .btn--icon-only,
#hub-section-workflows .btn--icon-only{
  width: var(--hub-iconbtn) !important;
  height: var(--hub-iconbtn) !important;
  padding: 0 !important;

  border-radius: var(--np-iconbtn-radius) !important;
  border: 1px solid var(--np-iconbtn-border) !important;
  background: var(--np-iconbtn-bg) !important;

  display: grid !important;
  place-items: center !important;

  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast) !important;
}

#hub-section-rooms .btn--icon-only:hover,
#hub-section-roles .btn--icon-only:hover,
#hub-section-workflows .btn--icon-only:hover{
  background: var(--np-iconbtn-bg-hover) !important;
  border-color: var(--np-iconbtn-border-hover) !important;
  box-shadow: var(--shadow-primary-outline-soft) !important;
  transform: translateY(-0.5px);
}

#hub-section-rooms .btn--icon-only:active,
#hub-section-roles .btn--icon-only:active,
#hub-section-workflows .btn--icon-only:active{
  background: var(--np-iconbtn-bg-active) !important;
  transform: none;
}

/* Icons konsistent (Theme-Filter) */
#hub-section-rooms .btn--icon-only img.icon-svg,
#hub-section-roles .btn--icon-only img.icon-svg,
#hub-section-workflows .btn--icon-only img.icon-svg{
  width: 18px !important;
  height: 18px !important;
  display: block !important;
  filter: var(--icon-filter-ui) !important;
  opacity: .92 !important;
}

/* Confirm / Armed: rot */
#hub-section-rooms .btn--icon-only.is-confirm,
#hub-section-roles .btn--icon-only.is-confirm,
#hub-section-workflows .btn--icon-only.is-confirm,
#hub-section-rooms .btn--icon-only.is-armed,
#hub-section-roles .btn--icon-only.is-armed,
#hub-section-workflows .btn--icon-only.is-armed{
  border-color: var(--color-danger, #ef4444) !important;
  background: var(--np-iconbtn-danger-bg) !important;
}

#hub-section-rooms .btn--icon-only.is-confirm:hover,
#hub-section-roles .btn--icon-only.is-confirm:hover,
#hub-section-workflows .btn--icon-only.is-confirm:hover,
#hub-section-rooms .btn--icon-only.is-armed:hover,
#hub-section-roles .btn--icon-only.is-armed:hover,
#hub-section-workflows .btn--icon-only.is-armed:hover{
  background: var(--np-iconbtn-danger-bg-hover) !important;
}

#hub-section-rooms .btn--icon-only.is-confirm img.icon-svg,
#hub-section-roles .btn--icon-only.is-confirm img.icon-svg,
#hub-section-workflows .btn--icon-only.is-confirm img.icon-svg,
#hub-section-rooms .btn--icon-only.is-armed img.icon-svg,
#hub-section-roles .btn--icon-only.is-armed img.icon-svg,
#hub-section-workflows .btn--icon-only.is-armed img.icon-svg{
  filter: var(--icon-filter-on-primary) !important;
  opacity: .95 !important;
}

/* =========================================================
   HUB – Unified Tiles (RÄUME / TEAM / WAS)
   Ziel: wie RÄUME (früherer Umbruch, lesbar, Actions unten mittig)
   ========================================================= */

:root{
  --hub-tile-min: 170px;          /* sorgt für früheres Umbrechen */
  --hub-tile-gap: 16px;
  --hub-tile-radius: 18px;
  --hub-action-size: 34px;
  --hub-action-gap: 10px;
}

/* 30/70 Split für die Hub-Form + Liste Karten */
.hub-section__grid--split{
  display: grid;
  grid-template-columns: minmax(280px, 30%) minmax(0, 70%);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px){
  .hub-section__grid--split{
    grid-template-columns: 1fr;
  }
}

/* Alle 3 Listen als Grid wie bei Räumen */
.hub-rooms-list,
#hub-team-tiles,
#hub-templates-list{
  display: grid;
  gap: var(--hub-tile-gap);
  grid-template-columns: repeat(auto-fit, minmax(var(--hub-tile-min), 1fr));
}

/* auf sehr großen Screens max. 6 nebeneinander */
@media (min-width: 1600px){
  .hub-rooms-list,
  #hub-team-tiles,
  #hub-templates-list{
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ---------- TILE-BASE (wie Räume) ---------- */
.hub-room-tile,
#hub-team-tiles .hub-team-tilewrap,
#hub-templates-list .calls-tile{
  position: relative;
  border-radius: var(--hub-tile-radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;

  border: 1px solid var(--color-primary-secondary-border);
  box-shadow: var(--shadow-soft);
}

/* Räume (Background wie bisher hübsch/ruhig) */
.hub-room-tile{
  background: var(--surface-secondary-med-a92);
  padding: 14px 12px calc(14px + var(--hub-action-size) + 10px);
  list-style: none;
}

/* Team (Primary a55) */
#hub-team-tiles .hub-team-tilewrap{
  background: var(--surface-primary-med-a55);
  padding: 0; /* der Button übernimmt Innenlayout */
}

/* WAS (vollflächig Highlight) */
#hub-templates-list .calls-tile{
  background: linear-gradient(to bottom right, var(--color-primary), var(--color-primary-strong));
  border-color: color-mix(in srgb, var(--color-primary) 55%, var(--color-border));
  padding: 0;
}

/* ---------- RÄUME TYPO ---------- */
.hub-room-code{
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  margin-top: 4px;
  text-align: center;
}

.hub-room-name{
  font-weight: 800;
  font-size: 13px;
  line-height: 1.15;
  margin-top: 8px;
  text-align: center;
  padding: 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hub-room-meta{
  font-weight: 400;
  opacity: .75;
  margin-top: 4px;
  text-align: center;
}

/* ---------- TEAM: Button “entkoppeln” von Calls CSS ---------- */
#hub-team-tiles .hub-team-tilewrap .calls-tilebtn{
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;

  padding: 14px 12px calc(14px + var(--hub-action-size) + 10px) !important;
  cursor: pointer;
}

/* Team Text: zweite Zeile NICHT fett + weniger Abstand */
#hub-team-tiles .hub-team-tilewrap .calls-label{
  display: block;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.15;
  padding: 0 10px;
}

#hub-team-tiles .hub-team-tilewrap .calls-label .text-small{
  display: block;
  margin-top: 3px;
  font-weight: 400;   /* <- nicht fett */
  opacity: .75;
}

/* ---------- WAS: Tile Button neutralisieren + Text lesbar ---------- */
#hub-templates-list .calls-tile .calls-tilebtn{
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;

  padding: 14px 12px calc(14px + var(--hub-action-size) + 10px) !important;
  color: #fff;
}

/* ---------- ACTIONS unten mittig (Räume / Team / WAS) ---------- */
.hub-room-actions,
#hub-team-tiles .hub-team-tile-actions,
#hub-templates-list .calls-tile-actions{
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: var(--hub-action-gap);
  width: auto;
}

/* Keine Hint-Texte unter Buttons (du wolltest “clean”) */
.hub-room-action-hint,
#hub-team-tiles .hub-team-tile-actions .text-small{
  display: none !important;
}

/* ---------- ICON BUTTON STYLE (Unified) ---------- */
.hub-room-actions .btn--icon-only,
#hub-team-tiles .hub-team-tile-actions .btn--icon-only,
#hub-templates-list .btn--icon-only{
  width: var(--hub-action-size);
  height: var(--hub-action-size);
  padding: 0;
  border-radius: var(--np-iconbtn-radius);
  border: 1px solid var(--np-iconbtn-border);
  background: var(--np-iconbtn-bg);
  display: grid;
  place-items: center;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.hub-room-actions .btn--icon-only:hover,
#hub-team-tiles .hub-team-tile-actions .btn--icon-only:hover,
#hub-templates-list .btn--icon-only:hover{
  background: var(--np-iconbtn-bg-hover);
  border-color: var(--np-iconbtn-border-hover);
  box-shadow: var(--shadow-primary-outline-soft);
  transform: translateY(-0.5px);
  filter: none;
}

.hub-room-actions .btn--icon-only:active,
#hub-team-tiles .hub-team-tile-actions .btn--icon-only:active,
#hub-templates-list .btn--icon-only:active{
  background: var(--np-iconbtn-bg-active);
  transform: none;
}

/* 2-Klick Confirm bleibt rot – Style nur optisch */
.btn--icon-only.is-confirm,
.btn--icon-only.is-armed{
  border-color: var(--color-danger, #ef4444) !important;
  background: var(--np-iconbtn-danger-bg) !important;
}
/* ------------------------------------------------------------
   Hub > Mitarbeiter: Formularfelder volle Breite (wie Räume/Was)
   Label oben, Input/Select 100%
------------------------------------------------------------ */

#hub-team-create-form .hub-tenant__row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

#hub-team-create-form .hub-tenant__label {
  width: 100%;
  max-width: none;
}

#hub-team-create-form .hub-tenant__value {
  width: 100%;
}

#hub-team-create-form .hub-tenant-input,
#hub-team-create-form input.hub-tenant-input,
#hub-team-create-form select.hub-tenant-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
/* =========================================
   OVERRIDE: HUB ROOMS vollflächig Secondary, ohne Rahmen
   ========================================= */
#hub-section-rooms #hub-rooms-list .hub-room-tile{
  /* Dreamy: keine harte Rahmenlinie, aber sichtbare Abhebung in Light/Dark */
  background: var(--color-primary-secondary) !important;
  border: 0 !important;
  box-shadow: var(--shadow-primary-outline-soft), var(--shadow-soft) !important;
  color: var(--color-on-secondary, #fff) !important;
}

#hub-section-rooms #hub-rooms-list .hub-room-code,
#hub-section-rooms #hub-rooms-list .hub-room-name,
#hub-section-rooms #hub-rooms-list .hub-room-meta{
  color: inherit !important;
}
/* Rooms: alle Texte in der Kachel sollen die On-Color erben */
#hub-section-rooms #hub-rooms-list .hub-room-tile *{
  color: inherit !important;
}
/* Rooms: Icon im Iconbutton passend zur Kachel */
#hub-section-rooms #hub-rooms-list .hub-room-tile .btn--icon-only img,
#hub-section-rooms #hub-rooms-list .hub-room-tile .btn--icon-only img.icon-svg,
#hub-section-rooms #hub-rooms-list .hub-room-tile .btn--icon-only .np-icon,
#hub-section-rooms #hub-rooms-list .hub-room-tile .btn--icon-only .icon-svg,
#hub-section-rooms #hub-rooms-list .hub-room-tile .btn--icon-only svg{
  filter: var(--icon-filter-on-secondary) !important;
  opacity: .95;
}
/* Rooms: Iconbutton auf farbiger Kachel dreamy, aber 2-Klick bleibt unangetastet */
#hub-section-rooms #hub-rooms-list .hub-room-tile .btn--icon-only:not(.is-confirm):not(.is-armed){
  border-color: color-mix(in srgb, currentColor 35%, transparent) !important;
  background: color-mix(in srgb, currentColor 10%, transparent) !important;
}
#hub-section-rooms #hub-rooms-list .hub-room-tile .btn--icon-only:not(.is-confirm):not(.is-armed):hover{
  background: color-mix(in srgb, currentColor 16%, transparent) !important;
}

#hub-team-list-body #hub-team-tiles .hub-team-tilewrap{
  /* Dreamy: nur ganz zarte Kontur + Shadow (passt in Light/Dark) */
  border: 0 !important;
  box-shadow: var(--shadow-primary-outline-soft), var(--shadow-soft) !important;
}
/* =========================================
   FIX: HUB WAS Tiles wie ROOMS (Text mittig, Actions unten)
   Farben bleiben unangetastet.
   ========================================= */

#hub-section-workflows #hub-templates-list .calls-tile{
  position: relative !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
}

/* Button füllt die Kachel + reserviert unten Platz für Actions */
#hub-section-workflows #hub-templates-list .calls-tilebtn{
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box !important;
  border-radius: inherit !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  gap: 6px !important;

  padding: var(--hub-tile-pad, 12px) !important;
  padding-bottom: calc(var(--hub-tile-action-space, 56px) + var(--hub-tile-pad, 12px)) !important;

  /* WICHTIG: KEIN background/border/color hier -> Farben bleiben wie sie sind */
}

/* Label/Icon sauber mittig wie Rooms */
#hub-section-workflows #hub-templates-list .calls-icon{
  display: grid !important;
  place-items: center !important;
}

#hub-section-workflows #hub-templates-list .calls-label{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  line-height: 1.15 !important;
  max-width: 100% !important;
  text-align: center !important;

  padding: 0 10px !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

#hub-section-workflows #hub-templates-list .calls-label .text-small{
  display: block !important;
  margin-top: 3px !important;
  font-weight: 500 !important;
  opacity: .85 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

/* Actions immer unten mittig (egal wie die Box heißt) */
#hub-section-workflows #hub-templates-list .wf-preview-actions,
#hub-section-workflows #hub-templates-list .wf-tile-actions,
#hub-section-workflows #hub-templates-list .calls-tile-actions,
#hub-section-workflows #hub-templates-list .hub-template-actions{
  position: absolute !important;
  left: 50% !important;
  bottom: var(--hub-tile-pad, 12px) !important;
  transform: translateX(-50%) !important;

  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  z-index: 30 !important;
  width: max-content !important;
}
/* =========================================
   HARD FIX: WAS Tiles = ROOM Tile Layout
   (nur Layout/Positionen, KEINE Farben ändern)
   ========================================= */

/* Tile wie Rooms: relativ + quadratisch + overflow */
#hub-templates-list .calls-tile{
  position: relative !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
}

/* Button füllt Tile komplett + reserviert unten Platz */
#hub-templates-list .calls-tile .calls-tilebtn{
  position: relative !important;   /* wichtig, falls Actions IN dem Button liegen */
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  gap: 6px !important;

  padding: var(--hub-tile-pad, 12px) !important;
  padding-bottom: calc(var(--hub-tile-action-space, 56px) + var(--hub-tile-pad, 12px)) !important;

  /* keine background/border/color -> Farben bleiben wie sie sind */
}

/* Falls irgendwo absolute/komische Positionen auf Icon/Label wirken: reset */
#hub-templates-list .calls-icon,
#hub-templates-list .calls-label{
  position: static !important;
  inset: auto !important;
  transform: none !important;
}

#hub-templates-list .calls-icon{
  display: grid !important;
  place-items: center !important;
}

#hub-templates-list .calls-label{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  max-width: 100% !important;
}

/* Actions IMMER unten (egal ob Wrapper inside Button oder daneben) */
#hub-templates-list .calls-tile-actions,
#hub-templates-list .wf-preview-actions,
#hub-templates-list .hub-template-actions,
#hub-templates-list .calls-tile .calls-tile-actions,
#hub-templates-list .calls-tile .wf-preview-actions,
#hub-templates-list .calls-tile .hub-template-actions{
  position: absolute !important;
  left: 50% !important;
  bottom: var(--hub-tile-pad, 12px) !important;
  transform: translateX(-50%) !important;

  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  z-index: 30 !important;
  width: max-content !important;
}
/* =========================================
   FIX: WAS (Vorhandene WAS) – Iconbuttons immer unten
   (Buttons sind direkte Children in .calls-tilebtn)
   Farben bleiben unverändert.
   ========================================= */

#hub-templates-list .calls-tile .calls-tilebtn{
  position: relative !important; /* Anker für absolute Buttons */
}

/* Nur wenn die Iconbuttons DIREKT im Tilebutton liegen */
#hub-templates-list .calls-tile .calls-tilebtn > .btn--icon-only{
  position: absolute !important;
  bottom: var(--hub-tile-pad, 12px) !important;
  z-index: 40 !important;
}

/* 2 Buttons mittig nebeneinander unten platzieren:
   - 2. letzter Button nach links
   - letzter Button nach rechts
*/
#hub-templates-list .calls-tile .calls-tilebtn > .btn--icon-only:nth-last-child(2){
  left: 50% !important;
  transform: translateX(calc(-50% - (var(--hub-action-gap, 10px)/2 + var(--hub-action-size, 34px)/2))) !important;
}

#hub-templates-list .calls-tile .calls-tilebtn > .btn--icon-only:last-child{
  left: 50% !important;
  transform: translateX(calc(-50% + (var(--hub-action-gap, 10px)/2 + var(--hub-action-size, 34px)/2))) !important;
}
/* =========================================================
   FIX: HUB "Vorhandene WAS" – Iconbuttons immer unten
   Robust: positioniert automatisch den Wrapper, der btn--icon-only enthält.
   Farben bleiben unverändert.
   ========================================================= */

/* Anker für absolute Positionierung */
#hub-templates-list .calls-tilebtn{
  position: relative !important;
}

/* CASE A: Buttons liegen in einem Wrapper (div/span/section/...) innerhalb calls-tilebtn */
#hub-templates-list .calls-tilebtn > *:has(.btn--icon-only){
  position: absolute !important;
  left: 50% !important;
  bottom: var(--hub-tile-pad, 12px) !important;
  transform: translateX(-50%) !important;

  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  z-index: 50 !important;
  width: max-content !important;
}

/* CASE B (Fallback): Buttons liegen direkt in calls-tilebtn */
#hub-templates-list .calls-tilebtn > .btn--icon-only{
  position: absolute !important;
  bottom: var(--hub-tile-pad, 12px) !important;
  z-index: 50 !important;
}

#hub-templates-list .calls-tilebtn > .btn--icon-only:nth-last-of-type(2){
  left: calc(50% - 22px) !important;
  transform: translateX(-50%) !important;
}

#hub-templates-list .calls-tilebtn > .btn--icon-only:last-of-type{
  left: calc(50% + 22px) !important;
  transform: translateX(-50%) !important;
}
/* =========================================================
   Pretty Selects (Hub + Callsystem)
   - sicher: nur native <select>-Styling, keine Overlays
   - Farben/Theme kommen aus deinen Variablen (mit Fallbacks)
   ========================================================= */

:root{
  --np-select-bg: var(--color-surface-2, rgba(255,255,255,.06));
  --np-select-bd: var(--color-border, rgba(255,255,255,.14));
  --np-select-bd-hover: rgba(255,255,255,.22);
  --np-select-text: var(--color-text, #fff);
  --np-select-radius: var(--radius-lg, 12px);
  --np-select-ring: var(--color-primary-soft, rgba(236,72,153,.22));
}

/* Scope: Hub + Calls (damit nicht Login o.ä. kaputt geht) */
#hub select:not([multiple]):not([size]),
#calls-center select:not([multiple]):not([size]),
#flow select:not([multiple]):not([size]),
select.hub-tenant-input:not([multiple]):not([size]){

  -webkit-appearance: none;
  appearance: none;

  width: 100%;
  box-sizing: border-box;

  background-color: var(--np-select-bg);
  color: var(--np-select-text);

  border: 1px solid var(--np-select-bd);
  border-radius: var(--np-select-radius);

  padding: 10px 40px 10px 12px; /* rechts Platz für Pfeil */
  line-height: 1.2;

  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  cursor: pointer;

  /* Pfeil */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23ffffff' fill-opacity='0.65' d='M5.6 7.7 10 12.1l4.4-4.4 1.4 1.4L10 14.9 4.2 9.1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

#hub select:not([multiple]):not([size]):hover,
#calls-center select:not([multiple]):not([size]):hover,
#flow select:not([multiple]):not([size]):hover,
select.hub-tenant-input:not([multiple]):not([size]):hover{
  border-color: var(--np-select-bd-hover);
}

#hub select:not([multiple]):not([size]):focus-visible,
#calls-center select:not([multiple]):not([size]):focus-visible,
#flow select:not([multiple]):not([size]):focus-visible,
select.hub-tenant-input:not([multiple]):not([size]):focus-visible{
  outline: none;
  border-color: var(--color-primary, var(--np-select-bd-hover));
  box-shadow: 0 0 0 3px var(--np-select-ring), inset 0 1px 0 rgba(255,255,255,.06);
}

#hub select:disabled,
#calls-center select:disabled,
#flow select:disabled,
select.hub-tenant-input:disabled{
  opacity: .6;
  cursor: not-allowed;
}

/* =========================================
   HOTFIX: Hub-Listen wirken "eingebettet" in Cards
   - mehr Luft + sicherer Grid-Gap, ohne Klassen umzubenennen
   ========================================= */
#hub-section-workflows #hub-team-tiles,
#hub-section-workflows #hub-rooms-list,
#hub-section-workflows #hub-templates-list{
  margin-top: 6px;
}

#hub-section-workflows .card__body{
  gap: var(--space-md);
}



/* =========================================
   Icon Picker: dreamy, kein Außenrahmen, nicht "zu dunkel", Popover immer oben
========================================= */
.icon-picker{
  position: relative;
  z-index: 9998; /* verhindert, dass andere Cards drüber liegen */
}

.icon-picker__btn{
  border: 0 !important;
  background: color-mix(in srgb, var(--color-bg-elevated) 70%, transparent) !important;
  box-shadow: var(--shadow-soft) !important;
}

.icon-picker__btn:hover{
  background: color-mix(in srgb, var(--color-bg-elevated) 82%, transparent) !important;
}

.icon-picker__popover{
  z-index: 10000 !important;
  border: 0 !important;
  box-shadow: 0 26px 70px rgba(2,6,23,0.22) !important;
}

.icon-picker__iconbtn{
  border: 1px solid var(--np-iconbtn-border) !important;
  border-radius: var(--np-iconbtn-radius) !important;
  background: var(--np-iconbtn-bg) !important;
  box-shadow: var(--shadow-soft) !important;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast) !important;
}

.icon-picker__iconbtn:hover{
  background: var(--np-iconbtn-bg-hover) !important;
  border-color: var(--np-iconbtn-border-hover) !important;
  box-shadow: var(--shadow-primary-outline-soft) !important;
  transform: translateY(-0.5px);
}

.icon-picker__iconbtn:active{
  background: var(--np-iconbtn-bg-active) !important;
  transform: none;
}

.icon-picker__iconbtn img{
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  filter: var(--icon-filter-ui) !important;
  opacity: 0.95 !important;
}

html[data-theme="light"] #hub-team-list-body #hub-team-tiles .calls-icon,
html[data-theme="light"] #hub-team-list-body #hub-team-tiles .calls-label,
html[data-theme="light"] #hub-team-list-body #hub-team-tiles .calls-label .text-small{
  color: var(--color-text, #0f172a) !important;
}

html[data-theme="light"] #hub-team-list-body #hub-team-tiles .calls-label .text-small{
  opacity: .78 !important;
}

/* HUB Preset-Listenkacheln: clean, immer konsistent (Text+Icons+Rahmen) */
#hub-presets-list .hub-wf-item{
  border: 0 !important;
  border-radius: 14px !important;
  padding: var(--space-sm) !important;
  gap: var(--space-sm) !important;
}

#hub-presets-list .hub-wf-item--normal{
  background: linear-gradient(to bottom right,
    var(--color-primary-secondary),
    var(--color-primary-secondary-deep, var(--color-primary-secondary))
  ) !important;
  color: var(--color-on-secondary, #fff) !important;
}

#hub-presets-list .hub-wf-item--panic{
  background: linear-gradient(to bottom right,
    var(--color-primary),
    var(--color-primary-strong, var(--color-primary))
  ) !important;
  color: var(--color-on-primary, #fff) !important;
}

#hub-presets-list .hub-wf-item *{
  color: inherit !important;
}

/* Delete-Iconbutton: Iconfilter passend zur Kachel */
#hub-presets-list .hub-wf-item--normal .btn--icon-only img.icon-svg{
  filter: var(--icon-filter-on-secondary) !important;
}
#hub-presets-list .hub-wf-item--panic .btn--icon-only img.icon-svg{
  filter: var(--icon-filter-on-primary) !important;
}

/* Button-Fläche auf farbigen Kacheln: “cloudy” mit currentColor */
#hub-presets-list .hub-wf-item .btn--icon-only:not(.is-confirm){
  border-color: color-mix(in srgb, currentColor 35%, transparent) !important;
  background: color-mix(in srgb, currentColor 10%, transparent) !important;
}
#hub-presets-list .hub-wf-item .btn--icon-only:not(.is-confirm):hover{
  background: color-mix(in srgb, currentColor 16%, transparent) !important;
}
