/* Retter-Portal v1.3.7 – ruhige, hochwertige Glasoptik.
   Die überzeichnete v1.3.6-Lichtbrechung wird bewusst zurückgenommen.
   Struktur, Abstände und Breakpoints bleiben unverändert. */
:root{
  --rp137-glass:rgba(255,255,255,.76);
  --rp137-glass-strong:rgba(255,255,255,.88);
  --rp137-glass-soft:rgba(248,250,252,.62);
  --rp137-glass-line:rgba(100,116,139,.20);
  --rp137-glass-highlight:rgba(255,255,255,.72);
  --rp137-shadow:0 18px 52px rgba(15,23,42,.10),inset 0 1px 0 rgba(255,255,255,.72);
  --rp137-shadow-soft:0 9px 25px rgba(15,23,42,.07),inset 0 1px 0 rgba(255,255,255,.55);
}
body[data-theme="dark"]{
  --rp137-glass:rgba(10,20,35,.80);
  --rp137-glass-strong:rgba(13,25,43,.90);
  --rp137-glass-soft:rgba(20,34,55,.70);
  --rp137-glass-line:rgba(148,163,184,.15);
  --rp137-glass-highlight:rgba(255,255,255,.075);
  --rp137-shadow:0 20px 56px rgba(0,0,0,.30),inset 0 1px 0 rgba(255,255,255,.065);
  --rp137-shadow-soft:0 10px 28px rgba(0,0,0,.19),inset 0 1px 0 rgba(255,255,255,.045);
}
@media(prefers-color-scheme:dark){
  body[data-theme="system"]{
    --rp137-glass:rgba(10,20,35,.80);
    --rp137-glass-strong:rgba(13,25,43,.90);
    --rp137-glass-soft:rgba(20,34,55,.70);
    --rp137-glass-line:rgba(148,163,184,.15);
    --rp137-glass-highlight:rgba(255,255,255,.075);
    --rp137-shadow:0 20px 56px rgba(0,0,0,.30),inset 0 1px 0 rgba(255,255,255,.065);
    --rp137-shadow-soft:0 10px 28px rgba(0,0,0,.19),inset 0 1px 0 rgba(255,255,255,.045);
  }
}

html body{
  background:
    radial-gradient(circle at 8% -8%,rgba(200,16,46,.085),transparent 31rem),
    radial-gradient(circle at 93% 2%,rgba(37,99,235,.075),transparent 34rem),
    linear-gradient(145deg,var(--bg),var(--bg2))!important;
}
html body:before{opacity:.34!important}

/* Nur große Flächen sind echtes Glas. Verschachtelte Elemente bleiben ruhig. */
html body :is(
  .card,.stat-card,.toolbar,.pagination,.page-head,.page-hero,.login-card,
  .rp55-focus-card,.rp55-own-card,.rp55-table-card,.rp55-kpi-card,.rp55-dash-hero,
  .admin-panel,.admin-card,.admin-account-card,.admin-overview-card,.admin-command-nav,
  .form-subcard,.smart-person-picker,.detail-item,.info-grid>div,.table-wrap
){
  background-image:none!important;
  background:linear-gradient(180deg,var(--rp137-glass-strong),var(--rp137-glass))!important;
  border-color:var(--rp137-glass-line)!important;
  box-shadow:var(--rp137-shadow)!important;
  -webkit-backdrop-filter:blur(18px) saturate(1.08)!important;
  backdrop-filter:blur(18px) saturate(1.08)!important;
}

html body :is(
  .rp55-own-metrics article,.rp55-focus-grid article,.rp55-priority-list a,
  .timeline-item,.department-chip,.person-choice,.admin-inline-assignment-list article,
  .admin-current-link,.check,.calendar-day,.youth-day,.admin-command-nav a,
  .dashboard-grid article,.stat-grid article
){
  background-image:none!important;
  background:var(--rp137-glass-soft)!important;
  border-color:var(--rp137-glass-line)!important;
  box-shadow:var(--rp137-shadow-soft)!important;
  -webkit-backdrop-filter:blur(10px) saturate(1.04)!important;
  backdrop-filter:blur(10px) saturate(1.04)!important;
}

/* Header und Sidebar: dunkel, klar und ohne bunte Nebelwand. */
html body .topbar{
  background-image:none!important;
  background:color-mix(in srgb,var(--rp137-glass-strong) 94%,transparent)!important;
  border-bottom-color:var(--rp137-glass-line)!important;
  box-shadow:0 11px 34px rgba(2,8,23,.10),inset 0 -1px 0 var(--rp137-glass-highlight)!important;
  -webkit-backdrop-filter:blur(20px) saturate(1.08)!important;
  backdrop-filter:blur(20px) saturate(1.08)!important;
}
html body .sidebar{
  background-image:none!important;
  background:linear-gradient(180deg,#070e1a 0%,#0a1423 54%,#0d192a 100%)!important;
  border-right-color:rgba(148,163,184,.11)!important;
  box-shadow:14px 0 42px rgba(2,6,23,.26),inset -1px 0 0 rgba(255,255,255,.035)!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
html body .sidebar .brand{
  background-image:none!important;
  background:rgba(255,255,255,.035)!important;
  border-color:rgba(148,163,184,.11)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.045)!important;
}
html body .sidebar nav a:hover{
  background-image:none!important;
  background:rgba(148,163,184,.075)!important;
  border-color:rgba(148,163,184,.10)!important;
  box-shadow:none!important;
  transform:translateX(1px)!important;
}
html body .sidebar nav a.active{
  background-image:none!important;
  background:linear-gradient(135deg,#df1238,#b50f30)!important;
  border-color:rgba(255,255,255,.12)!important;
  box-shadow:0 12px 30px rgba(200,16,46,.24),inset 0 1px 0 rgba(255,255,255,.17)!important;
}

/* Formulare sind lesbar und nicht milchig. */
html body :is(input,select,textarea){
  background-image:none!important;
  background:color-mix(in srgb,var(--surface-2) 91%,transparent)!important;
  border-color:var(--rp137-glass-line)!important;
  box-shadow:inset 0 1px 2px rgba(15,23,42,.08)!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
body[data-theme="dark"] :is(input,select,textarea){
  background:rgba(9,20,36,.84)!important;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.27)!important;
}
html body :is(input,select,textarea):focus{
  border-color:color-mix(in srgb,var(--primary) 64%,var(--rp137-glass-line))!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 13%,transparent),inset 0 1px 2px rgba(15,23,42,.06)!important;
}
html body .smart-select-results{
  background-image:none!important;
  background:var(--rp137-glass-strong)!important;
  border-color:var(--rp137-glass-line)!important;
  box-shadow:0 22px 58px rgba(2,8,23,.24),inset 0 1px 0 var(--rp137-glass-highlight)!important;
  -webkit-backdrop-filter:blur(20px) saturate(1.06)!important;
  backdrop-filter:blur(20px) saturate(1.06)!important;
}

/* Buttons: poliert, aber nicht plastisch überzeichnet. */
html body .btn{
  background-image:none!important;
  background:linear-gradient(180deg,var(--rp137-glass-strong),var(--rp137-glass-soft))!important;
  border-color:var(--rp137-glass-line)!important;
  box-shadow:var(--rp137-shadow-soft)!important;
  -webkit-backdrop-filter:blur(10px) saturate(1.04)!important;
  backdrop-filter:blur(10px) saturate(1.04)!important;
}
html body .btn:hover{
  transform:translateY(-1px)!important;
  border-color:color-mix(in srgb,var(--primary) 28%,var(--rp137-glass-line))!important;
  box-shadow:0 13px 32px rgba(15,23,42,.12),inset 0 1px 0 var(--rp137-glass-highlight)!important;
}
html body .btn.primary{
  background-image:none!important;
  background:linear-gradient(135deg,#e3133d,#b70f31)!important;
  border-color:rgba(255,255,255,.12)!important;
  box-shadow:0 13px 32px rgba(200,16,46,.25),inset 0 1px 0 rgba(255,255,255,.20)!important;
}
html body .btn.danger:not(.primary){
  background-image:none!important;
}

html body :is(.pill,.status,.role,.secure-pill){
  background-image:none!important;
  background:var(--rp137-glass-soft)!important;
  border-color:var(--rp137-glass-line)!important;
  box-shadow:inset 0 1px 0 var(--rp137-glass-highlight)!important;
  -webkit-backdrop-filter:blur(8px)!important;
  backdrop-filter:blur(8px)!important;
}

/* Tabellen benötigen Kontrast statt zusätzlicher Lichtreflexe. */
html body .table-wrap{
  background-image:none!important;
  background:var(--rp137-glass)!important;
}
html body table thead th{
  background-image:none!important;
  background:color-mix(in srgb,var(--rp137-glass-strong) 94%,var(--surface-2))!important;
  border-bottom-color:var(--rp137-glass-line)!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
html body table tbody td{
  background:transparent!important;
}
html body table tbody tr:hover td{
  background:color-mix(in srgb,var(--primary) 5%,transparent)!important;
}

html body.admin-surface .admin-command-nav{
  background-image:none!important;
  background:linear-gradient(180deg,var(--rp137-glass-strong),var(--rp137-glass))!important;
  border-color:var(--rp137-glass-line)!important;
  box-shadow:var(--rp137-shadow)!important;
}
html body.admin-surface .admin-command-nav a.is-active{
  background-image:none!important;
  background:linear-gradient(135deg,#df1238,#ad102f)!important;
  box-shadow:0 10px 26px rgba(200,16,46,.22)!important;
}

@supports not ((-webkit-backdrop-filter:blur(2px)) or (backdrop-filter:blur(2px))){
  html body :is(.card,.toolbar,.pagination,.page-head,.page-hero,.admin-panel,.admin-card,.admin-command-nav,.table-wrap){
    background:var(--surface)!important;
  }
}
@media(prefers-reduced-transparency:reduce){
  html body :is(.card,.toolbar,.pagination,.page-head,.page-hero,.admin-panel,.admin-card,.admin-command-nav,.table-wrap){
    background:var(--surface)!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
}
