/* Wooplex ERP v4.2.0 – einheitliche Kontextnavigation
   Referenz: Produktmenü. Gilt für alle Arbeitsbereiche. */
.context-sidebar{
    height:100vh;
    max-height:100vh;
    position:sticky;
    top:0;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    min-width:0;
    box-sizing:border-box;
    background:#fff;
    border-right:1px solid #e2e8f0;
}
.context-menu-head{
    flex:0 0 auto;
    padding:18px 14px 11px;
    border-bottom:1px solid #e8edf4;
    background:#fff;
    z-index:2;
    min-width:0;
}
.context-menu-head strong{
    display:block;
    margin:0;
    font-size:.78rem;
    line-height:1.25;
    letter-spacing:.075em;
    text-transform:uppercase;
    color:#475569;
    overflow-wrap:anywhere;
}
.context-menu-head small{
    display:block;
    margin-top:4px;
    color:#94a3b8;
    font-size:.72rem;
    line-height:1.25;
    text-transform:none;
    letter-spacing:0;
}
.context-menu-scroll{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    padding:10px 9px 24px;
    scrollbar-gutter:stable;
    scrollbar-width:thin;
    scrollbar-color:#cbd5e1 transparent;
    overscroll-behavior:contain;
}
.context-menu-scroll::-webkit-scrollbar{width:8px}
.context-menu-scroll::-webkit-scrollbar-track{background:transparent}
.context-menu-scroll::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px;border:2px solid #fff}
.context-group{
    margin:0 0 7px;
    border:1px solid #e6ebf2;
    border-radius:11px;
    background:#fbfcfe;
    overflow:hidden;
    min-width:0;
}
.context-group>summary{
    list-style:none;
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
    cursor:pointer;
    padding:10px 10px;
    font-size:.83rem;
    line-height:1.25;
    font-weight:750;
    color:#334155;
    user-select:none;
    transition:background .15s ease,color .15s ease;
    box-sizing:border-box;
}
.context-group>summary::-webkit-details-marker{display:none}
.context-group>summary::after{
    content:'›';
    margin-left:auto;
    flex:0 0 auto;
    font-size:1.1rem;
    line-height:1;
    color:#94a3b8;
    transform:rotate(0deg);
    transition:transform .15s ease;
}
.context-group[open]>summary::after{transform:rotate(90deg)}
.context-group>summary:hover{background:#f1f5f9;color:#173b67}
.context-group[open]>summary{background:#eef4fb;color:#173b67;border-bottom:1px solid #e1e8f0}
.context-group>summary>span{
    width:19px;
    flex:0 0 19px;
    text-align:center;
    color:#64748b;
    font-weight:800;
}
.context-group-links{padding:5px 5px 7px;min-width:0}
.context-sidebar .context-link{
    display:flex;
    align-items:flex-start;
    gap:7px;
    width:100%;
    min-width:0;
    box-sizing:border-box;
    margin:2px 0;
    padding:8px 8px;
    border-radius:8px;
    font-size:.83rem;
    line-height:1.28;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:normal;
}
.context-sidebar .context-link span{
    width:19px;
    flex:0 0 19px;
    text-align:center;
    line-height:1.28;
}
.context-sidebar .context-link.active{box-shadow:inset 3px 0 0 #2563eb}
.context-sidebar .context-create{margin-top:2px}

/* Verhindert seitliche Ausbrüche bei langen Menübezeichnungen. */
.context-sidebar a,.context-sidebar summary,.context-sidebar strong,.context-sidebar small{max-width:100%}

/* Bestehende Massen-Suchmasken bleiben unverändert nutzbar. */
.mass-search-grid{display:grid!important;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;align-items:end}
.mass-search-grid label{min-width:0}.mass-search-grid input,.mass-search-grid select{width:100%}
.filter-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.price-missing{display:inline-block;padding:3px 7px;border-radius:999px;font-size:12px;font-weight:700;background:rgba(180,70,70,.12)}

/* Systemwerkzeuge v4.2.0 */
.system-tools-actions{margin-bottom:18px}
.system-tools-actions .card{margin-bottom:0}
.system-tools-primary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    flex-wrap:wrap;
}
.system-tools-primary h2{margin:0 0 5px}
.system-tools-primary p{margin:0;max-width:760px}
.system-tools-primary form{margin:0;flex:0 0 auto}
.system-tools-primary .button{min-width:150px}
.system-tools-info{margin-top:18px}
.system-tools-info code{white-space:normal;overflow-wrap:anywhere}

@media(max-width:1100px){.mass-search-grid{grid-template-columns:repeat(2,minmax(160px,1fr))}}
@media(max-width:900px){
    .context-sidebar{height:auto;max-height:none;position:static;overflow:visible}
    .context-menu-scroll{max-height:none;overflow:visible;padding-bottom:12px}
    .context-menu-head{position:static}
    .context-group>summary{padding:9px 10px}
}
@media(max-width:720px){
    .mass-search-grid{grid-template-columns:1fr}
    .system-tools-primary{align-items:stretch}
    .system-tools-primary form,.system-tools-primary .button{width:100%}
}
