/* Retter-Portal v1.3.27 · rechter Portalbereich stärker an Sidebar angenähert, Rechte-Modul bereinigt, Mobile/Tablet verbessert */
:root{
  --rp27-line:rgba(148,163,184,.17);
  --rp27-line-soft:rgba(148,163,184,.10);
  --rp27-surface:linear-gradient(145deg,rgba(9,22,38,.985),rgba(7,18,31,.965))!important;
  --rp27-surface-alt:linear-gradient(145deg,rgba(10,25,43,.98),rgba(8,20,35,.96))!important;
  --rp27-highlight-red:rgba(225,29,72,.10);
  --rp27-highlight-blue:rgba(37,99,235,.12);
  --rp27-shadow:0 18px 44px rgba(1,7,18,.24);
}

/* Hauptbereich deutlich stärker an Sidebar-Flächenlogik angepasst */
html body .content > .page-head,
html body .content > .page-hero,
html body .content > .card,
html body .content > .toolbar,
html body .content > .pagination,
html body .content > .portal-footer,
html body .content > .table-wrap,
html body .content > .admin-panel,
html body .content > .admin-card,
html body .content > .entity-card,
html body .content > .billing-status-card{
  border-color:var(--rp27-line)!important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.040),transparent 32%),
    radial-gradient(circle at 100% 0,var(--rp27-highlight-blue),transparent 24rem),
    radial-gradient(circle at 0 0,var(--rp27-highlight-red),transparent 21rem),
    linear-gradient(145deg,rgba(9,22,38,.985),rgba(7,18,31,.965))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.026),var(--rp27-shadow)!important;
}
html body .content > :is(.page-head,.page-hero,.card,.toolbar,.pagination,.portal-footer,.table-wrap,.admin-panel,.admin-card,.entity-card,.billing-status-card){
  position:relative!important;
  overflow:visible!important;
}
html body .content > :is(.page-head,.page-hero,.card,.toolbar,.pagination,.portal-footer,.table-wrap,.admin-panel,.admin-card,.entity-card,.billing-status-card)::before{
  content:""!important;
  position:absolute!important;
  left:0!important;right:0!important;top:0!important;height:1px!important;
  background:linear-gradient(90deg,rgba(251,113,133,.30),rgba(148,163,184,.08) 26%,rgba(37,99,235,.24))!important;
  pointer-events:none!important;
}
html body .content > .toolbar{padding:14px 16px!important;gap:12px!important;}
html body .content > .page-head,html body .content > .page-hero{min-height:104px!important;}
html body .content > .page-head h1,html body .content > .page-hero h1{font-size:clamp(1.9rem,2.1vw,2.45rem)!important;}
html body .content > .page-head .hero-actions,.content > .page-hero .hero-actions{display:flex!important;flex-wrap:wrap!important;gap:10px!important;}
html body .content > .card .card-head,
html body .content > .table-wrap .card-head{padding-bottom:12px!important;margin-bottom:14px!important;border-bottom:1px solid var(--rp27-line-soft)!important;}

/* Formflächen, Filter und Buttons mit derselben Konturensprache wie Sidebar */
html body .content input,
html body .content select,
html body .content textarea,
html body .content .smart-person-picker,
html body .content .smart-select-field{
  border-color:var(--rp27-line)!important;
  background:linear-gradient(180deg,rgba(6,17,30,.94),rgba(7,19,33,.88))!important;
}
html body .content input:focus,
html body .content select:focus,
html body .content textarea:focus{
  border-color:rgba(251,113,133,.45)!important;
  box-shadow:0 0 0 3px rgba(225,29,72,.10),inset 0 1px 0 rgba(255,255,255,.03)!important;
}
html body .content .btn:not(.primary){
  background:linear-gradient(180deg,rgba(16,37,62,.95),rgba(10,24,41,.92))!important;
  border-color:var(--rp27-line)!important;
}
html body .content .btn.primary{
  background:linear-gradient(135deg,#ef3154,#c8102e)!important;
  border-color:rgba(251,113,133,.34)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 12px 28px rgba(225,29,72,.22)!important;
}

/* Rechte-Modul: die unsauberen Zusatzkästen aufräumen */
html body .content .rights-workbench-card,
html body .content .rights-explainer-card,
html body .content .rights-grid > .card{
  border-radius:20px!important;
}
html body .content .rights-department-switch,
html body .content .rights-assign-form,
html body .content .rights-unlinked-details,
html body .content .rights-unlinked-notice{
  position:relative!important;
  border:1px solid var(--rp27-line)!important;
  border-radius:20px!important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.036),transparent 28%),
    radial-gradient(circle at 100% 0,rgba(37,99,235,.10),transparent 18rem),
    linear-gradient(145deg,rgba(11,26,45,.96),rgba(8,20,35,.94))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02),0 14px 36px rgba(1,7,18,.18)!important;
}
html body .content .rights-department-switch{margin-top:14px!important;padding:14px 16px!important;}
html body .content .rights-department-switch > label,
html body .content .rights-assign-form > label{
  display:grid!important;gap:8px!important;font-weight:880!important;color:#dbe4ef!important;
}
html body .content .rights-department-switch > label > select{margin-top:2px!important;}
html body .content .rights-assign-form{
  grid-template-columns:minmax(250px,1fr) minmax(250px,1fr) auto!important;
  gap:16px!important;
  align-items:end!important;
  margin-top:14px!important;
  padding:16px!important;
}
html body .content .rights-assign-form .smart-select-field{
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  border-radius:0!important;
}
html body .content .rights-assign-form .smart-select-field::after{top:42px!important;right:14px!important;}
html body .content .rights-assign-form .smart-select-field label{
  display:grid!important;
  gap:8px!important;
  padding:0!important;
  font-size:.96rem!important;
  color:#dbe4ef!important;
  font-weight:880!important;
}
html body .content .rights-assign-form .smart-select-field input[data-smart-select-search],
html body .content .rights-assign-form .smart-select-field select[data-smart-select-native]{
  min-height:54px!important;
  border-radius:14px!important;
}
html body .content .rights-assign-form .btn.primary{
  min-width:170px!important;
  min-height:54px!important;
  align-self:end!important;
}
html body .content .rights-unlinked-details{margin-top:16px!important;overflow:hidden!important;}
html body .content .rights-unlinked-details summary{padding:18px 20px!important;}
html body .content .rights-unlinked-details .rights-unlinked-list{padding:0 20px 20px!important;}

/* Tabellen und Listen im Hauptbereich etwas näher an Sidebar-Optik */
html body .content .table-wrap,
html body .content .card.table-wrap{
  border-radius:20px!important;
  border:1px solid var(--rp27-line)!important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.038),transparent 26%),
    radial-gradient(circle at 100% 0,rgba(37,99,235,.10),transparent 20rem),
    linear-gradient(145deg,rgba(8,21,36,.98),rgba(6,17,29,.96))!important;
}
html body .content table thead th{
  background:linear-gradient(180deg,rgba(39,55,77,.88),rgba(23,39,60,.82))!important;
}
html body .content table tbody tr{
  background:linear-gradient(90deg,rgba(8,20,35,.95),rgba(8,19,33,.90))!important;
}
html body .content table tbody tr:nth-child(even){
  background:linear-gradient(90deg,rgba(11,26,45,.95),rgba(9,23,39,.90))!important;
}

/* Tablet */
@media(max-width:1100px){
  html body .content{padding:18px 16px 26px!important;}
  html body .content > .page-head,
  html body .content > .page-hero,
  html body .content > .card,
  html body .content > .toolbar,
  html body .content > .table-wrap,
  html body .content > .pagination,
  html body .content > .portal-footer{border-radius:18px!important;}
  html body .content > .toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:stretch!important;}
  html body .content > .toolbar > *{width:100%!important;}
  html body .content .rights-assign-form{grid-template-columns:1fr!important;align-items:stretch!important;}
  html body .content .rights-assign-form .btn.primary{width:100%!important;min-width:0!important;}
  html body .content .rights-grid{grid-template-columns:1fr!important;}
}

/* Mobile: Tabellen als saubere Karten, Toolbars/Formulare wirklich nutzbar */
@media(max-width:760px){
  html body .content{padding:14px 12px 22px!important;}
  html body .content > .page-head,
  html body .content > .page-hero{padding:18px 16px!important;gap:14px!important;align-items:stretch!important;}
  html body .content > .page-head .hero-actions,
  html body .content > .page-hero .hero-actions,
  html body .content > .page-head > .btn,
  html body .content > .page-hero > .btn{width:100%!important;}
  html body .content > .toolbar{grid-template-columns:1fr!important;padding:13px!important;}
  html body .content > .toolbar .btn{width:100%!important;}
  html body .content :is(.form-grid,.grid.two,.grid.three,.grid.four){grid-template-columns:1fr!important;}
  html body .content .rights-department-switch,
  html body .content .rights-assign-form,
  html body .content .rights-unlinked-details,
  html body .content .rights-unlinked-notice{border-radius:18px!important;}
  html body .content .rights-department-switch{padding:14px!important;}
  html body .content .rights-assign-form{padding:14px!important;gap:14px!important;}
  html body .content .rights-unlinked-details summary{padding:16px!important;gap:12px!important;}

  html body .content .table-wrap,
  html body .content .card.table-wrap{
    overflow:visible!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html body .content .table-wrap::before,
  html body .content .card.table-wrap::before{display:none!important;content:none!important;}
  html body .content .table-wrap table.responsive-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    background:transparent!important;
  }
  html body .content .table-wrap table.responsive-table thead{display:none!important;}
  html body .content .table-wrap table.responsive-table tbody{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  html body .content .table-wrap table.responsive-table tbody tr{
    display:block!important;
    border:1px solid var(--rp27-line)!important;
    border-radius:18px!important;
    padding:8px 14px!important;
    background:
      linear-gradient(180deg,rgba(255,255,255,.036),transparent 24%),
      radial-gradient(circle at 100% 0,rgba(37,99,235,.10),transparent 16rem),
      linear-gradient(145deg,rgba(11,25,43,.97),rgba(8,20,35,.95))!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.02),0 12px 30px rgba(1,7,18,.16)!important;
  }
  html body .content .table-wrap table.responsive-table tbody td{
    display:grid!important;
    grid-template-columns:minmax(104px,38%) minmax(0,1fr)!important;
    gap:10px!important;
    align-items:start!important;
    padding:11px 0!important;
    border-bottom:1px solid var(--rp27-line-soft)!important;
    background:transparent!important;
    min-width:0!important;
  }
  html body .content .table-wrap table.responsive-table tbody tr td:last-child{border-bottom:0!important;}
  html body .content .table-wrap table.responsive-table td::before{
    display:block!important;
    color:#8fa0b5!important;
    font-size:.66rem!important;
    line-height:1.2!important;
    font-weight:900!important;
    letter-spacing:.08em!important;
    text-transform:uppercase!important;
  }
  html body .content .table-wrap table.responsive-table td.mobile-action-cell,
  html body .content .table-wrap table.responsive-table td.actions,
  html body .content .table-wrap table.responsive-table td.table-actions{
    display:block!important;
    padding-top:14px!important;
    border-bottom:0!important;
  }
  html body .content .table-wrap table.responsive-table td.mobile-action-cell::before,
  html body .content .table-wrap table.responsive-table td.actions::before,
  html body .content .table-wrap table.responsive-table td.table-actions::before{display:none!important;content:none!important;}
  html body .content .table-wrap table.responsive-table td.mobile-action-cell .btn,
  html body .content .table-wrap table.responsive-table td.actions .btn,
  html body .content .table-wrap table.responsive-table td.table-actions .btn{width:100%!important;}
  html body .content .table-wrap table.responsive-table td.mobile-full-row{
    display:block!important;
    padding:16px 0 4px!important;
    text-align:left!important;
  }
  html body .content .table-wrap table.responsive-table td.mobile-full-row::before{display:none!important;content:none!important;}
  html body .content .table-wrap table.responsive-table .pill,
  html body .content .table-wrap table.responsive-table .status,
  html body .content .table-wrap table.responsive-table .role{justify-self:start!important;}
}

@media(max-width:430px){
  html body .content .table-wrap table.responsive-table tbody tr{padding:8px 12px!important;border-radius:16px!important;}
  html body .content .table-wrap table.responsive-table tbody td{grid-template-columns:1fr!important;gap:4px!important;padding:10px 0!important;}
  html body .content .table-wrap table.responsive-table td::before{font-size:.64rem!important;letter-spacing:.05em!important;}
}

body[data-theme="light"] .content > .page-head,
body[data-theme="light"] .content > .page-hero,
body[data-theme="light"] .content > .card,
body[data-theme="light"] .content > .toolbar,
body[data-theme="light"] .content > .pagination,
body[data-theme="light"] .content > .portal-footer,
body[data-theme="light"] .content > .table-wrap,
body[data-theme="light"] .content .rights-department-switch,
body[data-theme="light"] .content .rights-assign-form,
body[data-theme="light"] .content .rights-unlinked-details,
body[data-theme="light"] .content .rights-unlinked-notice{
  background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(244,248,252,.95))!important;
}
