/* Mensings LIVE V19 – Bugfix zu V18, keine Daten-/SQL-Änderung.
   Fix 1: Meldungsfenster über Abdunklung statt darunter (Body-Portal).
   Fix 2: Kopfzeile mit stabiler Position bei jedem Seitenwechsel.
   Fix 3: Vier identisch gestaltete Meldungsschalter. */

/* Die Meldungen liegen nach dem Start direkt unter body und verlassen
   den z-index-Stapelkontext der Alert-Leiste. */
#maV17NoticeBackdrop{
  position:fixed!important;inset:0!important;z-index:1800!important;
  background:rgba(3,13,25,.70)!important;
}
#maV17NoticeBackdrop[hidden]{display:none!important}
body>#workshopBellPopup,body>#maActivityPopup{
  position:fixed!important;top:50%!important;left:50%!important;
  right:auto!important;bottom:auto!important;transform:translate(-50%,-50%)!important;
  z-index:1810!important;margin:0!important;
  width:min(730px,calc(100vw - 32px))!important;
  max-height:min(80vh,780px)!important;overflow:auto!important;
  padding:22px!important;background:#172c44!important;color:#f4f9ff!important;
  border:1px solid #7094b4!important;border-radius:17px!important;
  box-shadow:0 24px 80px #000b!important;
}
body>#workshopBellPopup.hidden,body>#maActivityPopup.hidden{display:none!important}
body>#workshopBellPopup .bell-popup-title,body>#maActivityPopup .ma-activity-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  position:sticky;top:-22px;z-index:2;padding:8px 0 12px;
  background:#172c44!important;color:#f4f9ff!important;
}
body>#workshopBellPopup #workshopBellRows,body>#maActivityPopup #maActivityRows{
  max-height:58vh;overflow-y:auto;overscroll-behavior:contain;padding-right:5px;
}
body>#workshopBellPopup #workshopBellClose,body>#maActivityPopup #maActivityClose{
  min-width:43px;min-height:40px;flex:none;
}
html[data-skin="classic"] body>#workshopBellPopup,
html[data-skin="classic"] body>#maActivityPopup{
  background:#fff!important;color:#17314b!important;border-color:#b7cadc!important;
}
html[data-skin="classic"] body>#workshopBellPopup .bell-popup-title,
html[data-skin="classic"] body>#maActivityPopup .ma-activity-head{
  background:#fff!important;color:#17314b!important;
}

/* Alle vier Meldungstasten: identische Größe, Rahmen, Schrift und Farbe.
   Keine Neuordung beim Wechsel von Übersicht / Kalender / Auftrag. */
.ma-v16-alertbar{
  min-height:90px!important;
  display:flex!important;align-items:center!important;
  width:calc(100% - 54px)!important;
}
.ma-v16-alertbar #maNotificationDock{
  width:100%;min-width:0;display:flex!important;
  flex-wrap:wrap!important;align-items:center!important;
  justify-content:flex-start!important;gap:10px!important;
}
.ma-v16-alertbar #maNotificationDock #workshopBell,
.ma-v16-alertbar #maNotificationDock #maActivityWork,
.ma-v16-alertbar #maNotificationDock #maActivityLeave,
.ma-v16-alertbar #maNotificationDock #maV18InvoiceBell{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  box-sizing:border-box!important;
  flex:0 0 auto!important;width:auto!important;
  min-width:220px!important;max-width:none!important;
  min-height:57px!important;margin:0!important;
  padding:13px 18px!important;
  font-size:16px!important;line-height:1.2!important;font-weight:800!important;
  white-space:nowrap!important;text-align:center!important;
  background:#2c405a!important;border:1px solid #d1a34a!important;
  border-radius:12px!important;color:#ffe6ac!important;box-shadow:none!important;
}
.ma-v16-alertbar #maNotificationDock #workshopBell:hover,
.ma-v16-alertbar #maNotificationDock #maActivityWork:hover,
.ma-v16-alertbar #maNotificationDock #maActivityLeave:hover,
.ma-v16-alertbar #maNotificationDock #maV18InvoiceBell:hover{
  background:#355575!important;border-color:#f1c15b!important;
}
.ma-v16-alertbar #maNotificationDock .ma-notify-label{white-space:nowrap!important}

/* Alter flex-wrap ließ die Verwaltungsaktionen spontan in eine zweite
   Zeile springen, sobald neue Benachrichtigungen oder Firmeninfos kamen. */
body>header.ma-v16-brandbar{
  display:grid!important;
  grid-template-columns:minmax(240px,1fr) max-content!important;
  grid-template-areas:'brand admin'!important;
  gap:16px!important;align-items:center!important;
  flex-wrap:initial!important;
}
body>header.ma-v16-brandbar .ma-v16-brand{
  grid-area:brand!important;min-width:0!important;
  width:auto!important;max-width:none!important;
}
body>header.ma-v16-brandbar #adminTopActions{
  grid-area:admin!important;min-width:0!important;width:auto!important;
  max-width:none!important;display:flex!important;flex-wrap:nowrap!important;
  align-items:center!important;justify-content:flex-end!important;
  justify-self:end!important;gap:10px!important;
}
body>header.ma-v16-brandbar #adminTopActions>.ma-v11-menu,
body>header.ma-v16-brandbar #adminTopActions>button{
  flex:0 0 auto!important;white-space:nowrap!important;
}
@media(max-width:1150px){
  body>header.ma-v16-brandbar{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:'brand' 'admin'!important;
  }
  body>header.ma-v16-brandbar #adminTopActions{
    justify-self:start!important;justify-content:flex-start!important;
    flex-wrap:wrap!important;
  }
}
@media(max-width:820px){
  .ma-v16-alertbar{width:calc(100% - 28px)!important;min-height:0!important}
  .ma-v16-alertbar #maNotificationDock{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .ma-v16-alertbar #maNotificationDock #workshopBell,
  .ma-v16-alertbar #maNotificationDock #maActivityWork,
  .ma-v16-alertbar #maNotificationDock #maActivityLeave,
  .ma-v16-alertbar #maNotificationDock #maV18InvoiceBell{
    width:100%!important;min-width:0!important;max-width:none!important;
    min-height:48px!important;font-size:12px!important;
    padding:10px 7px!important;white-space:normal!important;
  }
  .ma-v16-alertbar #maNotificationDock .ma-notify-label{white-space:normal!important}
  body>header.ma-v16-brandbar #adminTopActions{gap:7px!important}
  body>header.ma-v16-brandbar #adminTopActions>button,
  body>header.ma-v16-brandbar #adminTopActions>.ma-v11-menu button{font-size:12px!important;padding:9px 10px!important}
  body>#workshopBellPopup,body>#maActivityPopup{width:calc(100vw - 22px)!important;max-height:86vh!important;padding:15px!important}
}
@media print{
  #maV17NoticeBackdrop,body>#workshopBellPopup,body>#maActivityPopup{display:none!important}
}
