/* PES 35 – responsive Darstellung Studienleitung / Investorverwaltung.
   Reine CSS-Darstellung, keine Funktionslogik. */
html,body{max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
*,*::before,*::after{box-sizing:border-box}
img,svg,canvas,video{max-width:100%;height:auto}
button,input,select,textarea{max-width:100%;min-width:0}
input,select,textarea{font-size:16px}
.dashboard-page,.dashboard-main,.tab,.panel,.modal-card,.filters,.metric-card,.aggregate-card,.participant-card{min-width:0}
h1,h2,h3,h4,p,span,strong,label,td,th{overflow-wrap:anywhere}

.participant-table-wrap,[class*="table-wrap"]{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.participant-table-wrap table,[class*="table-wrap"] table{width:max-content;min-width:100%;max-width:none}
.lateral-total-insight,.lateral-total-improvement,.direction-details{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.fixation-direction-table,.fixation-threshold-table,.mini-table{width:max-content;min-width:100%;max-width:none}

@media(max-width:1024px){
  .topbar-inner,.dashboard-main{padding-left:16px;padding-right:16px}
  .panel,.loading-card,.error-card{padding:22px 18px}
  .panel-heading{gap:12px}
}

@media(max-width:760px){
  body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
  .topbar{position:relative}
  .topbar-inner{padding:14px 10px 16px}
  .brand-row{white-space:normal;min-width:0;line-height:1.2}
  .brand-mark{min-width:68px;height:48px;border-radius:14px;font-size:1.15rem}
  .dashboard-nav{margin-top:14px;padding:8px;border-radius:16px}
  .dashboard-primary-nav{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .dashboard-system-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .nav-item{min-width:0;min-height:66px;padding:8px 5px;font-size:.8rem;white-space:normal;overflow-wrap:anywhere}
  .dashboard-system-actions .system-action{white-space:normal;min-width:0;text-align:center}
  .dashboard-main{padding:14px 8px calc(36px + env(safe-area-inset-bottom))}
  .panel,.loading-card,.error-card{padding:17px 13px;border-radius:16px}
  .panel-heading,.aggregate-card-head,.measurement-detail-head,.measurement-current-head,.baseline-section{flex-direction:column;align-items:stretch}
  .count-badge,.measurement-state{align-self:flex-start;white-space:normal}
  .metric-grid,.aggregate-values,.measurement-values,.detail-grid,.download-grid,.measurement-selector,.measurement-secondary-values{grid-template-columns:1fr!important}
  .filters{grid-template-columns:1fr!important;padding:12px}
  .primary-button,.secondary-button{width:100%}
  .modal{padding:0;align-items:stretch}
  .modal-card{width:100%;max-width:100%;min-height:100dvh;max-height:none;border-radius:0;padding:18px 12px calc(20px + env(safe-area-inset-bottom))}
  .modal-close{position:fixed;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));width:48px;height:48px}
  .participant-title-row{padding-right:58px}
  .measurement-number-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .measurement-stepper{grid-template-columns:1fr 1fr}
  .login-shell{padding:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
  .login-card{width:100%;padding:22px 16px;border-radius:18px}
}

@media(max-width:440px){
  .dashboard-primary-nav,.dashboard-system-actions{grid-template-columns:1fr}
  .nav-item{min-height:52px;flex-direction:row;justify-content:flex-start;padding:9px 12px;text-align:left}
  .dashboard-system-actions .system-action{justify-content:flex-start;text-align:left}
  .metric-card,.aggregate-card{padding:14px 12px}
  .measurement-number-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .measurement-stepper{grid-template-columns:1fr}
  .measurement-step-label{grid-column:auto;grid-row:auto;text-align:left}
  .measurement-step-button{grid-row:auto;width:100%}
  .participant-card{padding:14px 12px}
  .password-row{grid-template-columns:1fr}
  .show-password{min-height:46px}
}

@media(max-width:340px){
  .measurement-number-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .brand-mark{min-width:60px;padding:0 10px}
  .panel,.loading-card,.error-card{padding-left:10px;padding-right:10px}
}

@media(max-height:620px) and (orientation:landscape){
  .topbar{position:relative}
  .topbar-inner{padding-top:8px;padding-bottom:10px}
  .dashboard-nav{margin-top:8px}
  .modal-card{min-height:100dvh}
}
