/* Plan 2.4 / OI-M8: module pages rendered inside base.html (jerox_shell.py).
   Scoped to .module-shell so nothing leaks into the rest of the application.
   Colours only through the theme variables, so all appearance styles and dark mode apply. */
.module-subnav,html .module-subnav{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 18px;padding:0;background:none;border:0;box-shadow:none;position:static;width:auto;height:auto}
.module-subnav a,html .module-subnav a{display:inline-block;padding:8px 13px;margin:0;border:1px solid var(--j2-line);border-radius:var(--j2-nav-radius,9px);background:var(--j2-surface);color:var(--j2-ink);font-weight:600;text-decoration:none}
.module-subnav a:hover,.module-subnav a[aria-current="page"]{background:var(--j2-accent-soft);border-color:var(--j2-accent);color:var(--j2-accent)}
.module-shell{color:var(--j2-ink)}
.module-shell h2,.module-shell h3{margin:22px 0 10px;color:var(--j2-ink)}
.module-shell h2{font-size:18px}.module-shell h3{font-size:16px}
.module-shell p,.module-shell small{color:var(--j2-muted)}
.module-shell section,.module-shell fieldset,.module-shell .r8d-card{background:var(--j2-surface);border:1px solid var(--j2-line);border-radius:var(--j2-radius,14px);padding:var(--j2-card-padding,18px);margin:0 0 18px;box-shadow:var(--j2-shadow);min-width:0}
.module-shell legend{font-weight:700;color:var(--j2-ink);padding:0 6px}
.module-shell table{min-width:0;max-width:100%;width:100%;border-collapse:collapse;background:var(--j2-surface);border:1px solid var(--j2-line);border-radius:var(--j2-radius,14px);margin:0 0 18px;display:block;overflow-x:auto}
.module-shell th,.module-shell td{text-align:left;padding:10px 14px;border-bottom:1px solid var(--j2-line);white-space:nowrap;color:var(--j2-ink)}
.module-shell th{font-size:12px;color:var(--j2-muted);font-weight:700;background:var(--j2-bg)}
.module-shell form{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:6px 0}
.module-shell td form{display:inline-flex;margin:0 6px 0 0}
.module-shell input:not([type=hidden]):not([type=checkbox]):not([type=radio]),.module-shell select,.module-shell textarea{flex:1 1 150px;min-width:0;max-width:100%;padding:9px 11px;border:1px solid var(--j2-line);border-radius:8px;background:var(--j2-surface);color:var(--j2-ink);font:inherit}
.module-shell button{background:var(--j2-accent);color:#fff;border:1px solid var(--j2-accent);border-radius:9px;padding:9px 14px;font-weight:650;cursor:pointer;font-family:inherit}
.module-shell button:hover{filter:brightness(.92)}
.module-shell td form button{padding:6px 10px;font-size:12px}
.module-shell ul{padding-left:18px}
.module-shell ul form button{background:transparent;color:var(--j2-accent);border:0;padding:4px 0;text-align:left}
.module-shell pre{white-space:pre-wrap;word-break:break-all;background:var(--j2-bg);border:1px solid var(--j2-line);border-radius:8px;padding:12px;color:var(--j2-ink)}
.module-shell .r8d-order-line{display:flex;flex-wrap:wrap;gap:8px;width:100%}
@media(max-width:700px){.module-shell form{align-items:stretch}.module-shell form button{flex:1 1 100%}}
.module-shell .r5a-feature-option{display:inline-block;min-width:210px}
.module-shell [hidden]{display:none!important}
/* Stock receipt by scanning (/r8d/scan) */
.module-shell .scan-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.module-shell #scan-code{flex:1 1 260px;font-size:18px;padding:12px 14px}
.module-shell .scan-secondary{background:var(--j2-surface);color:var(--j2-accent);border-color:var(--j2-accent)}
.module-shell .scan-camera{display:flex;flex-direction:column;gap:8px;align-items:flex-start;margin:10px 0}
.module-shell .scan-camera video{width:100%;max-width:520px;border-radius:12px;border:1px solid var(--j2-line);background:#000}
.module-shell .scan-status{min-height:1.4em;font-weight:600;color:var(--j2-ink)}
.module-shell .scan-status.scan-bad{color:var(--jx-danger,#b42318)}
.module-shell .scan-new{border:1px dashed var(--j2-accent);border-radius:12px;padding:12px;margin:8px 0}
.module-shell .scan-new h3{width:100%;margin:0}
.module-shell .scan-new p{width:100%;margin:0}
.module-shell .scan-lines input.scan-qty{max-width:110px;flex:0 0 110px}
.module-shell .scan-check{display:inline-flex;gap:6px;align-items:center}
.module-shell .scan-empty{margin:4px 0 14px}
html[data-j2-theme=dark] .module-shell .scan-status.scan-bad,html[data-j2-style=night] .module-shell .scan-status.scan-bad{color:#ff8a80}
@media(max-width:700px){
 .module-shell table.scan-lines{display:block;border:0;background:none;overflow:visible}
 .module-shell .scan-lines thead{display:none}
 .module-shell .scan-lines tbody{display:block}
 .module-shell .scan-lines tr{display:grid;grid-template-columns:1fr auto;gap:4px 10px;align-items:center;background:var(--j2-surface);border:1px solid var(--j2-line);border-radius:12px;padding:10px 12px;margin:0 0 8px}
 .module-shell .scan-lines td{display:block;border:0;padding:0;white-space:normal;word-break:break-word}
 .module-shell .scan-lines td:nth-child(1){grid-column:1 / -1;color:var(--j2-muted);font-size:12px}
 .module-shell .scan-lines td:nth-child(2){grid-column:1 / -1;font-weight:600}
 .module-shell .scan-lines td:nth-child(4){display:none}
 .module-shell .scan-lines td form,.module-shell .scan-lines td button{width:auto}
}
body[data-jerox2=true] .module-shell table{min-width:0;max-width:100%}
/* §15 mobile: finger-sized header controls, no iOS zoom on focus, no horizontal page scroll (audit tests/e2e/mobile_ux_audit.mjs) */
@media (max-width:900px){
 body[data-jerox2=true] .mobile-menu-toggle{min-height:44px}
 body[data-jerox2=true] .r8h-language-picker a,body[data-jerox2=true] .r5c-bell{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}
 body[data-jerox2=true] .r8h-language-picker{padding-top:0;padding-bottom:0}
 body[data-jerox2=true] :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){font-size:16px}
 body[data-jerox2=true] .mfa-layout{grid-template-columns:minmax(0,1fr)}
 body[data-jerox2=true] .mfa-card{min-width:0;overflow-wrap:anywhere}
 body[data-jerox2=true] :is(a.btn,button.btn,.btn){min-height:44px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}
 body[data-jerox2=true] .grid{grid-template-columns:minmax(0,1fr)}
 body[data-jerox2=true] .grid>.card{min-width:0;overflow-wrap:anywhere}
 body[data-jerox2=true] .card a{overflow-wrap:anywhere}
 body[data-jerox2=true] .card>a,body[data-jerox2=true] .card>p>a:only-child{display:inline-block;padding:12px 0}
 body[data-jerox2=true] .app-topbar{flex-wrap:wrap;row-gap:8px}
 body[data-jerox2=true] .topbar-context{flex:1 1 100%;min-width:0}
 body[data-jerox2=true] .topbar-user{flex:1 1 100%;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:8px;max-width:100%;min-width:0}
 body[data-jerox2=true] .topbar-user>*{flex:0 0 auto}
 body[data-jerox2=true] .j2-theme-toggle{min-height:44px;width:auto}
 body[data-jerox2=true] .j2-style-picker select{min-width:0!important;max-width:150px;min-height:44px}
 body[data-jerox2=true] .r8h-language-picker{gap:0}
 body[data-jerox2=true] details>summary{min-height:44px;display:list-item;padding-block:10px;box-sizing:border-box}
 body[data-jerox2=true] .module-subnav a{min-height:44px;display:inline-flex;align-items:center}
}
/* §15 review B M6: on a phone the header keeps only language, bell and avatar; style and light/dark live on
   /account/appearance (Vzhľad aplikácie) so the work starts higher on the screen */
@media (max-width:600px){
 body[data-jerox2=true] .topbar-user .j2-style-picker,body[data-jerox2=true] .topbar-user .j2-theme-toggle{display:none}
}
/* Audit D-07 (fix ui): a wide table placed directly in a card (technician detail, credit note, credit-note correction)
   scrolls inside the card instead of panning the whole page at 375px */
@media (max-width:760px){
 body[data-jerox2=true] .card>table{display:block;max-width:100%;min-width:0;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
