/* Retter-Portal v1.3.23 · ausgewogene Sidebar, kompakter Header und Wasserversorgungs-Freigaben */
:root{
  --sidebar-width:258px!important;
  --rp23-sidebar:#07111f;
  --rp23-sidebar-deep:#050c17;
  --rp23-panel:rgba(10,23,40,.88);
  --rp23-panel-strong:rgba(12,27,47,.96);
  --rp23-line:rgba(148,163,184,.14);
  --rp23-line-strong:rgba(148,163,184,.22);
  --rp23-shadow:0 18px 48px rgba(0,0,0,.24);
}

/* Sidebar: schmaler, aber deutlich besser lesbar. */
html body .app-shell{grid-template-columns:var(--sidebar-width) minmax(0,1fr)!important;}
html body .main{margin-left:var(--sidebar-width)!important;}
html body .app-shell--navigation-disabled .main{margin-left:0!important;}
html body .sidebar{
  width:var(--sidebar-width)!important;
  max-width:var(--sidebar-width)!important;
  padding:13px 10px 20px!important;
  background:
    radial-gradient(circle at 8% -5%,rgba(225,29,72,.18),transparent 21rem),
    radial-gradient(circle at 112% 32%,rgba(37,99,235,.10),transparent 20rem),
    linear-gradient(180deg,var(--rp23-sidebar),#081526 48%,var(--rp23-sidebar-deep))!important;
}
html body .sidebar .brand{
  min-height:76px!important;
  margin:0 2px 12px!important;
  padding:4px 7px 15px!important;
  gap:11px!important;
  border-bottom:1px solid rgba(148,163,184,.13)!important;
}
html body .sidebar .brand-logo-wrap{
  width:54px!important;
  min-width:54px!important;
  height:54px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
}
html body .sidebar .brand-logo-wrap::after{display:none!important;}
html body .sidebar .brand-logo-wrap::before{display:none!important;}
html body .sidebar .brand-logo.logo-light,
html body .sidebar .brand-logo.logo-dark{position:static!important;inset:auto!important;margin:0!important;}
html body .sidebar .brand-logo{
  width:54px!important;
  height:54px!important;
  max-width:54px!important;
  max-height:54px!important;
  object-fit:contain!important;
  filter:drop-shadow(0 10px 20px rgba(0,0,0,.34))!important;
}
html body .sidebar .brand-text{
  font-size:1.22rem!important;
  line-height:1.08!important;
  font-weight:950!important;
  letter-spacing:-.025em!important;
}
html body .sidebar .brand-text small,
html body .sidebar .brand-context{
  margin-top:5px!important;
  font-size:.66rem!important;
  line-height:1.25!important;
  letter-spacing:.105em!important;
}
html body .sidebar .nav-section{
  margin:15px 9px 7px!important;
  font-size:.7rem!important;
  letter-spacing:.145em!important;
}
html body .sidebar nav a.sidebar-nav-link{
  min-height:46px!important;
  margin:1px 0!important;
  padding:9px 11px!important;
  gap:11px!important;
  border-radius:13px!important;
  font-size:16.25px!important;
  line-height:1.2!important;
  font-weight:820!important;
}
html body .sidebar .sidebar-nav-icon{
  width:23px!important;
  min-width:23px!important;
  height:23px!important;
}
html body .sidebar .sidebar-nav-icon svg{width:21px!important;height:21px!important;stroke-width:1.9!important;}
html body .sidebar .sidebar-nav-label{min-width:0!important;overflow-wrap:anywhere!important;}
html body .sidebar .nav-count{min-width:27px!important;height:23px!important;font-size:.72rem!important;padding-inline:7px!important;}

/* Header kompakter und optisch an die Sidebar angelehnt. */
html body .topbar{
  min-height:58px!important;
  padding:7px clamp(16px,1.5vw,24px)!important;
  background:rgba(7,16,28,.88)!important;
  border-bottom:1px solid rgba(148,163,184,.13)!important;
  box-shadow:0 10px 30px rgba(2,6,23,.15)!important;
}
html body .topbar-desktop-shell{gap:13px!important;}
html body .topbar-version{min-height:25px!important;padding:3px 8px!important;font-size:.66rem!important;}
html body .department-context-switch,
html body .department-context-static{min-height:38px!important;border-radius:12px!important;}
html body .theme-switch,
html body .topbar-account-info,
html body .topbar-logout .btn{min-height:36px!important;}
html body .topbar-role-badge{padding:6px 9px!important;font-size:.7rem!important;}

/* Der restliche Portalbereich erhält dieselbe ruhige, tiefblaue Produktsprache. */
html body .content{padding:21px clamp(18px,1.8vw,30px) 34px!important;}
html body .content > .page-head,
html body .content > .page-hero{
  min-height:136px!important;
  padding:22px clamp(22px,2.2vw,33px)!important;
  border-radius:23px!important;
  border-color:var(--rp23-line)!important;
  background:
    radial-gradient(circle at 96% 0,rgba(37,99,235,.13),transparent 24rem),
    radial-gradient(circle at 0 0,rgba(225,29,72,.09),transparent 20rem),
    linear-gradient(145deg,var(--rp23-panel-strong),rgba(8,20,36,.78))!important;
  box-shadow:var(--rp23-shadow)!important;
}
html body .content > .page-head h1,
html body .content > .page-hero h1{font-size:clamp(2.2rem,2.75vw,3.25rem)!important;letter-spacing:-.055em!important;}
html body .content > .page-head .eyebrow,
html body .content > .page-hero .eyebrow,
html body .card .eyebrow{
  display:block!important;
  width:auto!important;
  max-width:max-content!important;
  margin:0 0 9px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#fb7185!important;
  font-size:.72rem!important;
  letter-spacing:.15em!important;
}
html body .content > .page-head .muted,
html body .content > .page-hero .muted{margin-top:9px!important;font-size:.95rem!important;}
html body .content > .page-head .actions .btn,
html body .content > .page-hero .actions .btn{min-height:46px!important;border-radius:13px!important;}

html body .card,
html body .stat-card,
html body .toolbar,
html body .pagination,
html body .portal-footer{
  border-color:var(--rp23-line)!important;
  background:linear-gradient(145deg,rgba(10,23,40,.91),rgba(8,19,34,.76))!important;
  box-shadow:0 14px 38px rgba(0,0,0,.20)!important;
}
html body .card{border-radius:20px!important;}
html body .toolbar{border-radius:19px!important;}
html body .table-wrap{border-color:rgba(148,163,184,.12)!important;border-radius:15px!important;}
html body table thead th{background:rgba(148,163,184,.095)!important;}
html body input,
html body select,
html body textarea{background:rgba(4,13,25,.58)!important;border-color:rgba(148,163,184,.16)!important;}
html body .btn{box-shadow:none!important;border-color:rgba(148,163,184,.17)!important;background:rgba(255,255,255,.035)!important;}
html body .btn.primary{background:linear-gradient(135deg,#ef294f,#c8102e)!important;box-shadow:0 12px 28px rgba(225,29,72,.20)!important;}

/* Dateispeicher */
html body .file-upload-limit{display:block!important;margin-top:2px!important;font-size:.79rem!important;line-height:1.45!important;}

/* Wasserversorgung: Quelle, Freigaben und vollständige Filterleiste. */
html body .water-origin-toggle{
  display:grid!important;
  grid-template-columns:auto repeat(3,max-content)!important;
  align-items:center!important;
  gap:7px!important;
  overflow:visible!important;
}
html body .water-origin-toggle .btn{min-width:74px!important;white-space:nowrap!important;}
html body .water-origin-badge,
html body .water-release-badge{
  display:inline-flex!important;
  align-items:center!important;
  min-height:23px!important;
  margin-top:5px!important;
  padding:4px 8px!important;
  border-radius:999px!important;
  font-size:.7rem!important;
  line-height:1!important;
  font-weight:900!important;
  letter-spacing:.02em!important;
  white-space:nowrap!important;
}
html body .water-origin-badge.foreign{background:rgba(245,158,11,.12)!important;border:1px solid rgba(245,158,11,.24)!important;color:#fbbf24!important;}
html body .water-origin-badge.own{background:rgba(16,185,129,.12)!important;border:1px solid rgba(16,185,129,.24)!important;color:#6ee7b7!important;}
html body .water-release-badge{margin-left:5px!important;background:rgba(59,130,246,.12)!important;border:1px solid rgba(59,130,246,.24)!important;color:#93c5fd!important;}
html body .water-detail-origin{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:4px!important;}
html body .water-readonly-notice{border-color:rgba(245,158,11,.24)!important;background:linear-gradient(145deg,rgba(66,42,9,.36),rgba(10,23,40,.84))!important;}
html body .water-readonly-notice p{margin:.45rem 0 0!important;}
html body .form-info-field{display:grid!important;gap:5px!important;padding:13px 14px!important;border:1px solid rgba(245,158,11,.22)!important;border-radius:14px!important;background:rgba(245,158,11,.07)!important;}
html body .form-info-field span{color:var(--muted)!important;font-size:.75rem!important;font-weight:900!important;text-transform:uppercase!important;letter-spacing:.09em!important;}
html body .form-info-field small{color:var(--muted)!important;line-height:1.45!important;}

/* Admin-Freigabemaske */
html body .admin-water-filter{grid-template-columns:1.25fr 1fr 1fr .8fr!important;}
html body .admin-water-bulk-form{display:grid!important;grid-template-columns:minmax(240px,420px) auto!important;justify-content:start!important;}
html body .admin-water-source-list{display:grid!important;gap:11px!important;}
html body .admin-water-source-row{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(250px,360px)!important;gap:18px!important;padding:17px!important;border:1px solid rgba(148,163,184,.13)!important;border-radius:16px!important;background:rgba(4,13,25,.34)!important;}
html body .admin-water-source-title{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important;}
html body .admin-water-source-main p{margin:7px 0 2px!important;}
html body .admin-water-source-main small{color:var(--muted)!important;}
html body .admin-water-source-actions{display:grid!important;gap:9px!important;align-content:start!important;}
html body .admin-water-source-actions form{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;}
html body .admin-water-release-list{display:flex!important;flex-wrap:wrap!important;gap:7px!important;margin-top:11px!important;}
html body .admin-water-release-chip{display:inline-flex!important;align-items:center!important;gap:7px!important;padding:5px 7px 5px 10px!important;border:1px solid rgba(59,130,246,.23)!important;border-radius:999px!important;background:rgba(59,130,246,.10)!important;color:#bfdbfe!important;font-size:.75rem!important;font-weight:850!important;}
html body .admin-water-release-chip button{width:22px!important;height:22px!important;padding:0!important;border:0!important;border-radius:50%!important;background:rgba(255,255,255,.08)!important;color:inherit!important;}

body[data-theme="light"] .card,
body[data-theme="light"] .stat-card,
body[data-theme="light"] .toolbar,
body[data-theme="light"] .pagination,
body[data-theme="light"] .portal-footer,
body[data-theme="light"] .content > .page-head,
body[data-theme="light"] .content > .page-hero{background:linear-gradient(145deg,rgba(255,255,255,.94),rgba(245,249,253,.82))!important;border-color:rgba(71,85,105,.17)!important;box-shadow:0 14px 38px rgba(15,23,42,.08)!important;}
body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea{background:rgba(255,255,255,.86)!important;border-color:rgba(71,85,105,.17)!important;}
body[data-theme="light"] .admin-water-source-row{background:rgba(248,250,252,.82)!important;border-color:rgba(71,85,105,.15)!important;}

@media(max-width:1260px){
  :root{--sidebar-width:248px!important;}
  html body .sidebar nav a.sidebar-nav-link{font-size:15.75px!important;}
  html body .content{padding-inline:20px!important;}
  html body .admin-water-filter{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}

@media(max-width:1100px){
  :root{--sidebar-width:306px!important;}
  html body .main{margin-left:0!important;}
  html body .sidebar{width:min(90vw,var(--sidebar-width))!important;max-width:min(90vw,var(--sidebar-width))!important;}
  html body .topbar{padding:8px 13px!important;}
  html body .content{padding:18px 16px 30px!important;}
  html body .admin-water-source-row{grid-template-columns:1fr!important;}
}

@media(max-width:760px){
  html body .content > .page-head,
  html body .content > .page-hero{padding:20px 17px!important;border-radius:20px!important;}
  html body .content > .page-head h1,
  html body .content > .page-hero h1{font-size:clamp(2rem,10vw,2.85rem)!important;}
  html body .water-origin-toggle{grid-template-columns:1fr 1fr 1fr!important;width:100%!important;}
  html body .water-origin-toggle>span{grid-column:1/-1!important;}
  html body .water-origin-toggle .btn{width:100%!important;min-width:0!important;}
  html body .admin-water-filter{grid-template-columns:1fr!important;}
  html body .admin-water-bulk-form{grid-template-columns:1fr!important;}
  html body .admin-water-source-actions form{grid-template-columns:1fr!important;}
}

@media(max-width:430px){
  :root{--sidebar-width:296px!important;}
  html body .sidebar .brand-logo-wrap,
  html body .sidebar .brand-logo{width:54px!important;min-width:54px!important;height:54px!important;max-width:54px!important;max-height:54px!important;}
  html body .sidebar nav a.sidebar-nav-link{font-size:15.75px!important;}
}
