/* Retter-Portal v1.2.78
   - Select-Pfeile in Formularen mit sauberem Innenabstand
   - Tablet-Header gezielt ausrichten, ohne Smartphone- oder Desktop-Header zu verändern */

/* Native Select-Pfeile in Inhaltsformularen nicht direkt am rechten Rand. */
html body .app-shell .main .content select:not([multiple]){
  -webkit-appearance:none!important;
  appearance:none!important;
  padding-right:52px!important;
  background-image:
    linear-gradient(45deg,transparent 50%,currentColor 50%),
    linear-gradient(135deg,currentColor 50%,transparent 50%)!important;
  background-position:
    calc(100% - 29px) 50%,
    calc(100% - 22px) 50%!important;
  background-size:7px 7px,7px 7px!important;
  background-repeat:no-repeat!important;
}

/* Klassische Tabletbreiten sowie große Touch-Tablets im Querformat. */
@media (min-width:761px) and (max-width:1180px),
       (min-width:1181px) and (max-width:1366px) and (hover:none) and (pointer:coarse){
  html body .topbar .topbar-desktop-shell{
    display:grid!important;
    grid-template-columns:minmax(150px,172px) minmax(245px,1fr) max-content!important;
    grid-template-areas:"brand context actions"!important;
    align-items:center!important;
    column-gap:16px!important;
    row-gap:0!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:64px!important;
    padding:9px 14px!important;
  }

  html body .topbar .topbar-tablet-menu{display:none!important;}
  html body .topbar .topbar-title{
    grid-area:brand!important;
    display:flex!important;
    align-items:center!important;
    min-width:0!important;
    height:44px!important;
    margin:0!important;
    padding:0!important;
  }
  html body .topbar .topbar-eyebrow{
    display:flex!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    height:44px!important;
    margin:0!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  html body .topbar .topbar-eyebrow>span:first-child{
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  html body .topbar .topbar-version{
    flex:0 0 auto!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:26px!important;
    height:26px!important;
    margin:0!important;
    padding:0 8px!important;
    line-height:26px!important;
  }

  html body .topbar .topbar-context{
    grid-area:context!important;
    display:flex!important;
    align-items:center!important;
    min-width:0!important;
    height:44px!important;
    margin:0!important;
    padding:0!important;
  }
  html body .topbar .department-context-switch,
  html body .topbar .department-context-static{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr)!important;
    align-items:center!important;
    gap:9px!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
    margin:0!important;
    padding:4px 6px 4px 11px!important;
    border-radius:15px!important;
    overflow:hidden!important;
  }
  html body .topbar .department-context-switch>span,
  html body .topbar .department-context-static>span{
    position:static!important;
    inset:auto!important;
    display:flex!important;
    align-items:center!important;
    width:auto!important;
    min-width:max-content!important;
    max-width:none!important;
    height:36px!important;
    margin:0!important;
    padding:0!important;
    line-height:36px!important;
    white-space:nowrap!important;
  }
  html body .topbar .department-context-switch select,
  html body .topbar .department-context-static strong{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    margin:0!important;
    padding-top:0!important;
    padding-bottom:0!important;
    line-height:36px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  html body .topbar .topbar-actions{
    grid-area:actions!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    min-width:0!important;
    height:44px!important;
    min-height:44px!important;
    margin:0!important;
    padding:0!important;
    gap:8px!important;
    overflow:visible!important;
  }
  html body .topbar .topbar-user-cluster{
    display:flex!important;
    align-items:center!important;
    min-width:0!important;
    height:44px!important;
    min-height:44px!important;
    gap:8px!important;
    overflow:visible!important;
  }
  html body .topbar .theme-switch,
  html body .topbar .topbar-account-info,
  html body .topbar .topbar-logout,
  html body .topbar .topbar-logout .btn{
    align-self:center!important;
    margin-top:0!important;
    margin-bottom:0!important;
  }
  html body .topbar .topbar-account-info{
    min-width:0!important;
    max-width:190px!important;
    height:40px!important;
    min-height:40px!important;
  }
  html body .topbar .user-chip,
  html body .topbar .user-chip.has-role-badge{
    min-width:0!important;
    max-width:104px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
}

/* Schmalere Tablets: zweite, saubere Kontextzeile statt Zusammenquetschen. */
@media (min-width:761px) and (max-width:980px){
  html body .topbar .topbar-desktop-shell{
    grid-template-columns:minmax(150px,1fr) max-content!important;
    grid-template-areas:"brand actions" "context context"!important;
    column-gap:14px!important;
    row-gap:8px!important;
    min-height:106px!important;
    padding-bottom:10px!important;
  }
  html body .topbar .topbar-context{height:44px!important;}
  html body .topbar .department-context-switch,
  html body .topbar .department-context-static{max-width:none!important;}
}
