/* Shared visual system. Business logic and permission controls stay in their modules. */
:root{--radius:16px;--shadow:0 4px 18px rgba(17,48,69,.045);--js-action-gap:10px;--js-panel-gap:20px}
body{font-family:Inter,"Segoe UI",Arial,sans-serif;line-height:1.45}
.app-shell .sidebar{background:linear-gradient(180deg,#092333,#0e3042);scrollbar-width:thin;scrollbar-color:#416171 transparent;padding-inline:14px}
.sidebar #nav .nav-item,.sidebar .sidebar-bottom .nav-item{font-family:inherit!important;font-size:14px!important;font-weight:600!important;line-height:1.4!important;min-height:46px;padding:11px 12px!important;gap:10px!important;border-radius:11px!important;letter-spacing:0;text-align:left}
.sidebar #nav .v9535-subnav{margin-left:0;width:100%;border-left:0}
.sidebar #nav .nav-item>span:first-child,.sidebar .sidebar-bottom .nav-item>span:first-child{width:22px;flex:0 0 22px;font-size:16px!important;text-align:center}
.sidebar .v958-nav-section{gap:4px;padding-block:14px}
.sidebar .nav-item.active{box-shadow:inset 3px 0 0 #71dbff,0 4px 12px #0002!important}
.sidebar .v958-nav-title{font-weight:700;letter-spacing:.09em;color:#a2bac8}
.main .topbar{height:auto!important;min-height:88px;gap:16px;padding:18px 24px;box-shadow:0 3px 14px #12334a06;flex-wrap:wrap}
.topbar h1{font-size:24px;line-height:1.2;letter-spacing:-.025em}
.topbar p{line-height:1.5}
.main .top-actions{gap:10px!important;min-width:0;flex:1 1 520px;justify-content:flex-end;flex-wrap:wrap!important}
.top-actions .searchbox{flex:1 1 260px!important;min-width:180px!important;max-width:640px!important;margin:0!important;width:auto!important;min-height:44px}
.searchbox input{min-width:0;width:100%!important}
.main .content{padding:24px clamp(14px,2vw,30px) 40px}
.primary,.secondary,.ghost,.danger{font-size:14px;line-height:1.35;min-height:44px;padding:11px 16px;border-radius:10px;transition:background-color .15s,box-shadow .15s}
.primary:hover{filter:brightness(.96)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #1682e6;outline-offset:3px}
.sidebar button:focus-visible{outline-color:#91dfff}
button:disabled{opacity:.55;cursor:not-allowed}
.toolbar,.v9535-page-head{gap:12px!important}
.toolbar{border:1px solid var(--line);background:var(--surface,#fff);border-radius:14px;box-shadow:var(--shadow)}
.toolbar-left,.toolbar-right{gap:10px!important;min-width:0}
.toolbar-left{flex:1 1 320px!important}.toolbar-right{flex:0 1 auto!important}
.entity-card,.widget,.kpi,.v9535-panel{border-radius:16px;box-shadow:var(--shadow)}
.entity-card{padding:20px}.entity-card h3{font-size:17px;line-height:1.4;overflow-wrap:anywhere}
.entity-card .meta{font-size:13px;line-height:1.5}.stat{padding:12px}.stat span{font-size:12px}
.card-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:18px!important}
.form-grid{gap:18px;grid-template-columns:repeat(2,minmax(0,1fr))}.field{min-width:0}
.field label{font-size:12px;line-height:1.4;letter-spacing:.02em;margin-bottom:7px}
.field input:not([type=checkbox]):not([type=radio]):not([type=color]),.field select,.field textarea{min-height:44px;padding:11px 12px;font-size:14px;border-radius:10px;max-width:100%}
.field input[type=checkbox],.field input[type=radio]{width:18px;height:18px;min-height:18px;accent-color:var(--accent)}
.field textarea{min-height:110px;line-height:1.55}
.modal{border-radius:20px;max-height:94dvh}.modal-header{padding:20px 24px}.modal-header h2{line-height:1.3;overflow-wrap:anywhere}
.modal-body{padding:24px;min-height:0}.modal-footer{padding:16px 24px;background:#fafcfe;gap:10px!important;border-radius:0 0 20px 20px}
.modal .close{flex:0 0 44px;width:44px;height:44px;font-size:21px}
.modal .tabs{gap:8px;padding-bottom:8px;scrollbar-width:thin}.modal .tabs button{min-height:44px;border-radius:9px}
.table-wrap{max-width:100%;overscroll-behavior-x:contain}.table-wrap th{padding:14px 16px}.table-wrap td{padding:14px 16px;line-height:1.45}
@media(min-width:1041px){.app-shell{grid-template-columns:250px minmax(0,1fr)!important}}
@media(min-width:821px) and (max-width:1040px){
 .app-shell{grid-template-columns:220px minmax(0,1fr)!important}
 .sidebar .nav-item,.sidebar .nav-item:not(.active){font-size:14px!important;justify-content:flex-start!important}
 .sidebar .v958-nav-title{height:auto;padding:0 12px 6px;margin:0;border:0;font-size:10px}
 .sidebar .v958-nav-title-icon{display:inline-block!important}
 .sidebar .v958-nav-badge{position:static;margin-left:auto;flex-shrink:0}
 .sidebar .brand>div:last-child{display:block!important}
 .sidebar .sidebar-bottom.v958-system{padding-top:16px}
 .topbar>div:first-of-type{flex:1 1 100%}.main .top-actions{justify-content:flex-start}
}
@media(max-width:820px){
 .main .topbar{gap:10px!important;padding:12px!important;position:relative}
 .main .top-actions{flex:1 1 100%!important;gap:8px!important;justify-content:flex-start}
 .top-actions .searchbox{flex:1 1 100%!important;min-width:0!important;max-width:none!important}
 .top-actions .searchbox input{font-size:16px!important}
 .sidebar #nav .nav-item,.sidebar .sidebar-bottom .nav-item{font-size:14px!important}
 .main .content{padding:14px 12px 30px!important}
 .toolbar-left,.toolbar-right{flex:1 1 auto!important;gap:8px!important}
 .toolbar button{min-height:44px}.toolbar-left>b{line-height:1.5}
 .modal-backdrop{padding:10px}.modal{max-width:100%;max-height:96dvh}
 .modal-header,.modal-body,.modal-footer{padding:16px}
 .field input:not([type=checkbox]):not([type=radio]),.field select,.field textarea{font-size:16px}
 .settings-layout{grid-template-columns:minmax(0,1fr)!important}
}
@media(max-width:600px){
 .form-grid{grid-template-columns:minmax(0,1fr)!important}.form-grid .span2{grid-column:1!important}
 .modal-backdrop{padding:0}.modal,.modal.small{width:100vw;max-width:100vw;max-height:100dvh;border-radius:0}
 .modal-footer{border-radius:0;padding-bottom:max(14px,env(safe-area-inset-bottom))}
 .modal-footer>div{width:100%;flex-wrap:wrap;gap:8px}.modal-footer button{min-height:44px}
 .card-grid{grid-template-columns:minmax(0,1fr)!important}.entity-card{padding:16px}
 .dashboard-grid>.widget{grid-column:1/-1}
 .v9535-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(prefers-reduced-motion:reduce){.sidebar,button,.entity-card{transition:none!important;scroll-behavior:auto!important}}
/* Keep header actions in predictable rows, including legacy dynamically inserted controls. */
@media(min-width:821px) and (max-width:1500px){
 .main .topbar{display:flex!important;flex-direction:row!important;align-items:center!important}
 .main .topbar>div:first-of-type{flex:1 1 100%!important}
 .main .top-actions{flex:1 1 100%!important;justify-content:flex-start!important}
 .main .top-actions #newOrderBtn{order:10!important;width:auto!important;flex:0 0 auto!important}
 .main .top-actions #myLocationBtn{order:9}
}
@media(max-width:820px){
 .main .topbar{flex-direction:row!important;text-align:left!important;justify-content:flex-start!important}
 .main .topbar>.mobile-menu-btn{flex:0 0 44px!important;margin:0!important}
 .main .topbar>div:first-of-type{flex:1 1 calc(100% - 64px)!important;text-align:left!important}
 .main .top-actions .v900-user-chip{display:flex!important;max-width:145px;min-height:44px}
 .main .top-actions .v9517-notify{display:block!important}
 .main .top-actions #newOrderBtn{order:10!important}
 .main .top-actions #myLocationBtn{order:9}
}
.sidebar #nav .nav-item>span:not(:first-child):not(.v958-nav-badge),.sidebar .sidebar-bottom .nav-item>span:not(:first-child):not(.v958-nav-badge){font-size:14px!important;font-weight:600!important;line-height:1.4!important;letter-spacing:0}
.sidebar .brand-logo img{width:100%!important;height:100%!important;max-height:100%!important;object-fit:contain!important}
@media(max-width:820px){.sidebar .brand-logo{height:110px!important}.sidebar .v958-nav-title{height:auto;padding:0 12px 6px;margin:0;border:0;font-size:10px}.sidebar .v958-nav-title-icon{display:inline-block!important}}
.modal-backdrop{z-index:200}
@media(max-width:980px){.v9533-order-summary{order:1!important}}
/* Zusatzfenster müssen über der Auftragsakte (200) liegen.
   Mehrere Zusatzfenster haben dieselbe Ebene; das zuletzt angehängte liegt oben. */
#modalRoot>.submodal-backdrop{z-index:220}
#toast{z-index:240}

