/* Retter-Portal v1.3.18 – sauberer Löschdialog, reduzierte Testkonten und geschlossene Tabellenkanten. */
:root{
  --rp1318-table-radius:16px;
  --rp1318-table-edge:rgba(100,116,139,.22);
  --rp1318-table-edge-dark:rgba(148,163,184,.16);
}

/* Account-Löschdialog: Symbol und Schließen-Button bilden eine feste Kopfzeile.
   Der X-Button ist dadurch auch in Safari niemals absolut über dem Inhalt oder formularbreit. */
html body .account-delete-modal__topbar{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  width:100%!important;
  min-width:0!important;
  margin:0 0 16px!important;
}
html body .account-delete-modal__topbar .account-delete-modal__icon{
  flex:0 0 54px!important;
  width:54px!important;
  min-width:54px!important;
  max-width:54px!important;
  height:54px!important;
  min-height:54px!important;
  max-height:54px!important;
  margin:0!important;
}
html body .account-delete-modal__topbar .account-delete-modal__close{
  position:static!important;
  inset:auto!important;
  top:auto!important;
  right:auto!important;
  flex:0 0 40px!important;
  display:grid!important;
  place-items:center!important;
  width:40px!important;
  min-width:40px!important;
  max-width:40px!important;
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  margin:0!important;
  padding:0!important;
  border-radius:12px!important;
  line-height:1!important;
}
html body .account-delete-modal__dialog h2{
  margin:0 0 10px!important;
}
html body .account-delete-modal__dialog{
  scrollbar-gutter:stable;
}

/* Testkonten ohne Navigation nutzen die gesamte Breite; es bleibt kein leerer Sidebar-Bereich. */
html body .app-shell.app-shell--navigation-disabled{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;
  min-width:0!important;
}
html body .app-shell.app-shell--navigation-disabled > .main{
  grid-column:1!important;
  width:100%!important;
  min-width:0!important;
}
html body .app-shell.app-shell--navigation-disabled [data-menu-toggle]{
  display:none!important;
}

/* Tabellenkarten: nur eine Kontur, passend geclipte Kopf- und Abschlusszeile. */
@media(min-width:761px){
  html body .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap){
    position:relative!important;
    isolation:isolate!important;
    overflow:auto!important;
    border:1px solid var(--rp1318-table-edge)!important;
    border-radius:var(--rp1318-table-radius)!important;
    background:var(--surface)!important;
    background-image:none!important;
    background-clip:padding-box!important;
    box-shadow:0 18px 46px rgba(15,23,42,.09)!important;
  }
  body[data-theme="dark"] .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap){
    border-color:var(--rp1318-table-edge-dark)!important;
    background:rgb(14,25,43)!important;
    box-shadow:0 20px 48px rgba(0,0,0,.20)!important;
  }
  body[data-theme="light"] .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap){
    background:rgba(255,255,255,.94)!important;
  }
  html body .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap)::before,
  html body .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap)::after{
    content:none!important;
    display:none!important;
  }
  html body .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap) > table{
    margin:0!important;
    border-collapse:separate!important;
    border-spacing:0!important;
    background:transparent!important;
  }
  html body .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap) > table thead th:first-child{
    border-top-left-radius:calc(var(--rp1318-table-radius) - 1px)!important;
  }
  html body .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap) > table thead th:last-child{
    border-top-right-radius:calc(var(--rp1318-table-radius) - 1px)!important;
  }
  html body .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap) > table tbody tr:last-child > td:first-child{
    border-bottom-left-radius:calc(var(--rp1318-table-radius) - 1px)!important;
  }
  html body .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap) > table tbody tr:last-child > td:last-child{
    border-bottom-right-radius:calc(var(--rp1318-table-radius) - 1px)!important;
  }
  html body .app-shell .main .content :is(.table-wrap,.data-table-card,.checks-table-wrap) > table tbody tr:last-child > td{
    border-bottom:0!important;
  }
}

/* Entwicklungsprofile bleiben auf kleinen Breiten ruhig und vollständig bedienbar. */
html body .devtools-menu-check span,
html body .devtools-menu-check small{
  display:block!important;
  min-width:0!important;
}
html body .devtools-menu-check small{
  margin-top:4px!important;
  line-height:1.45!important;
}
html body .devtools-profile-form .check{
  align-items:flex-start!important;
}

@media(max-width:760px){
  html body .account-delete-modal{
    align-items:flex-start!important;
    place-items:start center!important;
    padding:
      max(12px,env(safe-area-inset-top))
      max(12px,env(safe-area-inset-right))
      max(16px,calc(env(safe-area-inset-bottom) + 68px))
      max(12px,env(safe-area-inset-left))!important;
  }
  html body .account-delete-modal__dialog{
    width:100%!important;
    max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 96px)!important;
    padding:18px 16px 16px!important;
    border-radius:20px!important;
  }
  html body .account-delete-modal__topbar{
    margin-bottom:14px!important;
  }
  html body .account-delete-modal__topbar .account-delete-modal__icon{
    flex-basis:50px!important;
    width:50px!important;
    min-width:50px!important;
    max-width:50px!important;
    height:50px!important;
    min-height:50px!important;
    max-height:50px!important;
    border-radius:15px!important;
  }
  html body .account-delete-modal__topbar .account-delete-modal__close{
    flex-basis:40px!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
  }
  html body .account-delete-modal__actions{
    position:static!important;
    padding:0!important;
    background:none!important;
  }
  html body .app-shell.app-shell--navigation-disabled .rp-mobile-header__top{
    grid-template-columns:minmax(0,1fr) auto!important;
  }
  html body .app-shell.app-shell--navigation-disabled .rp-mobile-header__brand{
    justify-content:flex-start!important;
    text-align:left!important;
  }
  html body .devtools-demo-form{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  html body .devtools-demo-form > *{
    width:100%!important;
    min-width:0!important;
  }
}

/* Ohne Menüschalter werden Brand und Logout in der mobilen Kopfzeile neu einsortiert. */
@media(max-width:760px){
  html body .app-shell.app-shell--navigation-disabled .main > .topbar .rp-mobile-header__top{
    grid-template-columns:minmax(0,1fr) auto!important;
  }
  html body .app-shell.app-shell--navigation-disabled .main > .topbar .rp-mobile-header__brand{
    grid-column:1!important;
  }
  html body .app-shell.app-shell--navigation-disabled .main > .topbar form.rp-mobile-header__logout{
    grid-column:2!important;
  }
}

@media(min-width:761px) and (max-width:1180px){
  html body .app-shell.app-shell--navigation-disabled .topbar-desktop-shell{
    grid-template-columns:minmax(220px,1fr) auto!important;
    grid-template-areas:"brand actions" "context context"!important;
  }
}
