[hidden]{display:none!important}
*{box-sizing:border-box}
:root{font-family:Arial,Helvetica,sans-serif;color:#111827;background:#fff;--sidebar-width:232px;--sidebar-compact:64px}
body{margin:0;font-size:14px;overflow-x:hidden}
.brandbar{height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;color:#3154e8;border-bottom:1px solid #e5e7eb;background:#fff;position:relative;z-index:30}
.brand-left{display:flex;align-items:center;gap:10px}.brandbar strong{font-size:18px}.brandbar>span{font-size:12px;color:#64748b}.menu-button{display:none;width:34px;height:34px;border:0;background:transparent;color:#3154e8;font-size:23px;cursor:pointer}
.app-shell{display:flex;min-height:calc(100vh - 44px)}
.sidebar{width:var(--sidebar-width);flex:none;padding:18px 10px 14px;border-right:1px solid #cbd5e1;background:#fff;display:flex;flex-direction:column;transition:width .2s ease,transform .2s ease;overflow:hidden;z-index:25}
.sidebar-header{display:flex;align-items:center;justify-content:space-between;min-height:40px;margin-bottom:8px}.sidebar h2{margin:0 12px;font-size:15px;color:#64748b;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap}.sidebar-toggle{width:30px;height:30px;flex:none;border:1px solid #d8dee8;background:#fff;color:#3154e8;font-size:22px;line-height:1;cursor:pointer;border-radius:5px}
.nav-item{display:flex;align-items:center;gap:11px;width:100%;min-height:44px;padding:10px 12px;border:0;background:transparent;text-align:left;font-size:15px;border-radius:0;cursor:pointer;white-space:nowrap;overflow:hidden}.nav-item:hover{background:#f1f5f9}.nav-item.active{background:#dbe5ff;color:#244ee8;border-right:3px solid #3154e8;font-weight:700}.nav-icon{display:grid;place-items:center;width:24px;min-width:24px;font-size:20px}.nav-label{overflow:hidden;text-overflow:ellipsis}.sidebar-spacer{flex:1}.version{padding:10px 12px;color:#94a3b8;font-size:12px;line-height:1.5;white-space:nowrap}
body.sidebar-collapsed .sidebar{width:var(--sidebar-compact)}body.sidebar-collapsed .sidebar h2,body.sidebar-collapsed .nav-label,body.sidebar-collapsed .version{display:none}body.sidebar-collapsed .sidebar-header{justify-content:center}body.sidebar-collapsed .sidebar-toggle{transform:rotate(180deg)}body.sidebar-collapsed .nav-item{justify-content:center;padding-left:8px;padding-right:8px}body.sidebar-collapsed .nav-item.active{border-right-width:3px}
.main{flex:1;min-width:0;padding:22px 16px 30px 13px;overflow:hidden}.page-title-row{border-bottom:1px solid #cbd5e1;margin-bottom:16px;padding-bottom:14px}.page-title-row h1,.placeholder h1{margin:0;color:#3154e8;font-size:20px}.page-title-row p{margin:5px 0 0;color:#64748b}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:10px}.toolbar-left,.toolbar-right{display:flex;align-items:center;gap:6px}.tool,.icon-tool{height:37px;min-width:37px;border:1px solid #cbd5e1;background:#eef2f7;color:#64748b;font-size:21px;cursor:pointer}.tool.primary{color:#fff;background:#3154e8;border-color:#3154e8}.tool.danger:not(:disabled){color:#b91c1c}.tool:disabled{opacity:.45;cursor:not-allowed}.search{display:flex;align-items:center;width:280px;height:37px;border:1px solid #cbd5e1;background:#fff;padding:0 9px;gap:8px}.search span{font-size:21px;color:#94a3b8}.search input{width:100%;border:0;outline:0}.icon-tool{background:#fff;color:#3154e8;border:0}.table-wrap{position:relative;overflow:auto;border:1px solid #cbd5e1;min-height:290px}table{width:100%;min-width:1450px;border-collapse:collapse}th,td{padding:11px 10px;border-right:1px solid #d8dee8;border-bottom:1px solid #d8dee8;text-align:left;white-space:nowrap}th{position:sticky;top:0;background:#fff;font-weight:700;z-index:1;cursor:default}th[data-sort]{cursor:pointer}tbody tr:nth-child(odd){background:#fafbfc}tbody tr:hover{background:#eef4ff}tbody tr.selected{background:#dbeafe}.check{width:44px;text-align:center}.piece{font-weight:600}.muted{color:#64748b}.status{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:800;color:#fff;background:#22c55e}.status.low{background:#f59e0b}.status.empty{background:#ef4444}.empty-state{padding:55px;text-align:center;color:#64748b}.pager{display:flex;justify-content:space-between;align-items:center;padding:10px;border:1px solid #cbd5e1;border-top:0}.pager>div{display:flex;align-items:center;gap:8px}.pager select,.pager button{height:30px;border:1px solid #cbd5e1;background:#fff}.pager button{width:30px;color:#3154e8}.pager button:disabled{opacity:.4}.message{margin:0 0 12px;padding:10px 12px;border:1px solid;border-radius:4px}.message.success{color:#166534;background:#dcfce7;border-color:#86efac}.message.error{color:#991b1b;background:#fee2e2;border-color:#fca5a5}.placeholder{display:grid;place-items:center;min-height:500px;text-align:center}.placeholder p{color:#64748b}
.sidebar-overlay{display:none;position:fixed;inset:44px 0 0;z-index:20;border:0;background:rgba(15,23,42,.48)}
.modal{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:20px}.modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.58)}.modal-panel{position:relative;width:min(820px,100%);max-height:calc(100vh - 40px);overflow:auto;padding:22px;background:#fff;box-shadow:0 24px 80px rgba(0,0,0,.3)}.modal-header{display:flex;justify-content:space-between;gap:16px;margin-bottom:20px}.modal-header h2{margin:0;color:#3154e8}.modal-header p{margin:5px 0 0;color:#64748b}.close{border:0;background:transparent;font-size:28px;cursor:pointer}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.form-grid label{display:flex;flex-direction:column;gap:6px;font-weight:700}.form-grid .full{grid-column:1/-1}.form-grid input,.form-grid textarea{padding:10px;border:1px solid #cbd5e1;font:inherit}.form-error{margin-top:14px;padding:10px;color:#991b1b;background:#fee2e2}.modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:18px}.secondary,.primary-action{padding:10px 16px;border:0;font-weight:700;cursor:pointer}.secondary{background:#e2e8f0}.primary-action{color:#fff;background:#3154e8}
@media(max-width:800px){.main{padding:16px 10px}.toolbar{align-items:stretch;flex-direction:column}.toolbar-right{justify-content:space-between}.search{width:100%}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}}
@media(max-width:600px){body.sidebar-collapsed .sidebar{width:min(86vw,290px)}.brandbar{position:sticky;top:0}.menu-button{display:block}.sidebar{position:fixed;left:0;top:44px;bottom:0;width:min(86vw,290px);transform:translateX(-105%);box-shadow:8px 0 25px rgba(15,23,42,.18)}body.mobile-menu-open .sidebar{transform:translateX(0)}body.mobile-menu-open .sidebar-overlay{display:block}.sidebar-toggle{display:none}.sidebar h2,.nav-label,.version,body.sidebar-collapsed .sidebar h2,body.sidebar-collapsed .nav-label,body.sidebar-collapsed .version{display:block}.nav-item,body.sidebar-collapsed .nav-item{justify-content:flex-start;padding:10px 12px}.main{padding:12px 6px}.page-title-row p{display:none}.pager{align-items:flex-start;gap:10px;flex-direction:column}.modal{padding:0}.modal-panel{max-height:100vh;width:100%;min-height:100vh}}

.qr-panel{width:min(720px,100%)}.qr-content{display:grid;grid-template-columns:280px 1fr;gap:24px;align-items:center}.qr-content img{display:block;width:100%;max-width:280px;border:1px solid #d8dee8;background:#fff}.qr-details{min-width:0}.qr-details p{margin:0 0 14px}.qr-help{color:#64748b;line-height:1.5}.qr-details label{display:flex;flex-direction:column;gap:6px;font-weight:700}.qr-details input{width:100%;padding:10px;border:1px solid #cbd5e1;background:#f8fafc}.tool#qr-button:not(:disabled){color:#3154e8;background:#eef2ff}@media(max-width:600px){.qr-content{grid-template-columns:1fr}.qr-content img{margin:auto;max-width:240px}.qr-panel .modal-actions{flex-wrap:wrap}.qr-panel .modal-actions button{flex:1 1 140px}}

/* Sécurité de fermeture des fenêtres modales */
.modal[hidden]{display:none!important}
.modal.is-open{display:flex}

.print-choice-panel{width:min(650px,100%)}.print-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.print-choice-card{display:flex;flex-direction:column;gap:7px;min-height:120px;padding:18px;text-align:left;border:1px solid #cbd5e1;background:#fff;cursor:pointer}.print-choice-card:hover{border-color:#3154e8;background:#f8faff}.print-choice-card.preferred{border:2px solid #3154e8;background:#eef2ff}.print-choice-card strong{font-size:17px;color:#1e3a8a}.print-choice-card span{color:#64748b;line-height:1.45}.label-options{margin-top:16px;padding:14px;background:#f8fafc;border:1px solid #e2e8f0}.label-options label{display:flex;align-items:center;justify-content:space-between;gap:16px;font-weight:700}.label-options select{min-width:120px;padding:8px;border:1px solid #cbd5e1;background:#fff}.label-options p{margin:10px 0 0;color:#64748b;font-size:13px;line-height:1.45}@media(max-width:600px){.print-choice-grid{grid-template-columns:1fr}.label-options label{align-items:stretch;flex-direction:column}.label-options select{width:100%}}


.scan-tool{color:#0f766e!important;background:#ecfeff!important}.scanner-panel{width:min(620px,100%)}#qr-reader{width:100%;min-height:270px;border:1px solid #cbd5e1;background:#f8fafc}#qr-reader video{max-height:430px;object-fit:cover}.scanner-message{margin-bottom:12px;padding:10px 12px;background:#eff6ff;border:1px solid #bfdbfe;color:#1e3a8a}.scanner-message.error{background:#fee2e2;border-color:#fca5a5;color:#991b1b}.scanner-message.success{background:#dcfce7;border-color:#86efac;color:#166534}.scanner-help{margin-top:12px;color:#64748b;line-height:1.45}#qr-reader__dashboard_section_csr button,#qr-reader__dashboard_section_swaplink{padding:9px 12px;margin:5px;border:1px solid #cbd5e1;background:#fff;color:#1e3a8a;cursor:pointer}#qr-reader__scan_region img{max-width:180px}
.scanner-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 12px}.scanner-actions select{min-width:190px;flex:1;padding:9px 10px;border:1px solid #cbd5e1;background:#fff}.file-scan-button{display:inline-flex;align-items:center;justify-content:center;padding:9px 12px;border:1px solid #cbd5e1;background:#fff;color:#1e3a8a;font-weight:700;cursor:pointer}.file-scan-button input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}@media(max-width:600px){.scanner-actions>*{width:100%}.scanner-actions select{min-width:0}}

/* Version 0.8.0 - navigation et emplacements */
.mobile-header{display:none}.app-shell{min-height:100vh}.brand{display:flex;align-items:center;gap:10px;min-height:46px;padding:0 8px 12px;margin-bottom:8px;border-bottom:1px solid #e2e8f0}.brand-icon{display:grid;place-items:center;width:30px;height:30px;flex:none;border-radius:7px;background:#3154e8;color:#fff;font-weight:800}.brand .nav-label{font-size:17px;font-weight:800;flex:1}.brand #sidebar-toggle{width:30px;height:30px;border:1px solid #d8dee8;background:#fff;color:#3154e8;font-size:22px;cursor:pointer}.nav-section-title{padding:8px 12px;color:#94a3b8;font-size:11px;font-weight:800;letter-spacing:.06em}.form-grid select,.toolbar select{padding:9px;border:1px solid #cbd5e1;background:#fff;font:inherit}.form-grid small{font-weight:400;color:#64748b}.location-cell{font-weight:600;color:#334155}.location-toolbar .tool{padding:0 12px;font-size:14px;font-weight:700}.locations-layout{display:grid;grid-template-columns:minmax(320px,42%) 1fr;gap:14px;min-height:560px}.location-tree-card,.location-detail-card{border:1px solid #cbd5e1;background:#fff}.card-title{padding:13px 15px;border-bottom:1px solid #e2e8f0;font-weight:800;color:#334155}.location-tree{padding:8px;max-height:650px;overflow:auto}.location-tree ul{list-style:none;margin:0;padding-left:20px}.location-tree>ul{padding-left:0}.location-tree li{margin:2px 0}.tree-row{display:flex;align-items:center;width:100%;gap:7px;padding:8px 7px;border:0;border-radius:5px;background:transparent;text-align:left;cursor:pointer}.tree-row:hover{background:#f1f5f9}.tree-row.selected{background:#dbeafe;color:#1d4ed8;font-weight:700}.tree-toggle{width:14px;color:#94a3b8}.tree-type{width:24px;text-align:center;font-size:17px}.tree-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-count{min-width:24px;padding:2px 6px;border-radius:999px;background:#e2e8f0;color:#475569;font-size:11px;text-align:center}.location-detail-card{padding:22px}.detail-empty{display:grid;place-items:center;min-height:430px;color:#64748b;text-align:center}.detail-header h2{margin:8px 0 4px;font-size:25px;color:#1e3a8a}.detail-header p{margin:0;color:#64748b}.type-badge{display:inline-block;padding:4px 9px;border-radius:999px;background:#eef2ff;color:#3154e8;font-weight:800;font-size:12px}.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:24px 0}.detail-grid>div{padding:13px;border:1px solid #e2e8f0;background:#f8fafc}.detail-grid dt{font-size:12px;color:#64748b}.detail-grid dd{margin:5px 0 0;font-size:18px;font-weight:800;color:#1e293b}.description-box{margin-bottom:18px;padding:14px;border-left:4px solid #3154e8;background:#f8fafc}.description-box p{margin:7px 0 0;color:#475569;line-height:1.5}.location-modal-panel{width:min(720px,100%)}
body.sidebar-collapsed .brand .nav-label,body.sidebar-collapsed .nav-section-title{display:none}body.sidebar-collapsed .brand{justify-content:center;padding-left:0;padding-right:0}body.sidebar-collapsed .brand-icon{display:none}
@media(max-width:900px){.locations-layout{grid-template-columns:1fr}.location-tree{max-height:380px}.location-detail-card{min-height:300px}}
@media(max-width:700px){.mobile-header{position:sticky;top:0;z-index:40;display:flex;align-items:center;justify-content:space-between;height:48px;padding:0 10px;background:#fff;border-bottom:1px solid #e2e8f0}.mobile-header button{border:0;background:transparent;font-size:23px;color:#3154e8}.mobile-header span{font-size:11px;color:#64748b}.sidebar{position:fixed;top:48px;bottom:0;left:0;width:min(86vw,300px)!important;transform:translateX(-105%);box-shadow:8px 0 25px rgba(15,23,42,.18)}body.mobile-menu-open .sidebar{transform:translateX(0)}.sidebar-overlay{inset:48px 0 0}.brand #sidebar-toggle{display:none}.main{padding:12px 7px}.toolbar-right{flex-wrap:wrap}.toolbar-right #location-filter{width:100%}.locations-layout{min-height:0}.detail-grid{grid-template-columns:1fr}.location-detail-card{padding:15px}.location-toolbar .toolbar-left{flex-wrap:wrap}.location-toolbar .tool{flex:1 1 140px}.form-grid select{width:100%}}

.automatic-field:disabled{background:#eef1f4;color:#59636e;border-color:#cfd5dc;cursor:not-allowed;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}

.qr-code-cell{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;white-space:nowrap}

.linked-files{padding:12px;border:1px solid #dbe3ee;background:#f8fafc}.linked-files-list{display:grid;gap:7px;margin-top:10px}.linked-files-empty{margin:0;color:#64748b;font-weight:400}.linked-file-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:10px;padding:8px 10px;border:1px solid #e2e8f0;background:#fff}.linked-file-row a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#3154e8;font-weight:700}.linked-file-row span{color:#64748b;font-size:12px}.linked-file-delete{padding:6px 9px;border:0;background:#fee2e2;color:#991b1b;font-weight:700;cursor:pointer}@media(max-width:600px){.linked-file-row{grid-template-columns:1fr auto}.linked-file-row span{grid-column:1}.linked-file-delete{grid-column:2;grid-row:1/3}}

.linked-file-download{padding:6px 9px;border:1px solid #cbd5e1;background:#f8fafc;color:#334155!important;text-decoration:none;font-size:12px;font-weight:700;white-space:nowrap}.linked-file-download:hover{background:#eef2ff}

.camera-mode-hint{font-size:12px;color:#64748b;white-space:nowrap}.scanner-panel #qr-reader{min-height:280px}.scanner-panel video{object-fit:cover}@media(max-width:700px){.scanner-panel{width:calc(100vw - 20px);max-height:94vh;overflow:auto}.scanner-actions{display:grid;grid-template-columns:1fr 1fr}.scanner-actions select,.scanner-actions .camera-mode-hint{grid-column:1/-1}.scanner-panel #qr-reader{min-height:320px}}


/* Version 0.9.8 - véritable présentation mobile de la liste */
@media (max-width:700px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  body{font-size:14px}
  .app-shell{display:block;width:100%;min-height:calc(100vh - 48px)}
  .main{display:block;width:100%;max-width:100vw;min-width:0;margin:0;padding:10px!important;overflow:visible}
  #articles-view,#locations-view,#categories-view{width:100%;max-width:100%}
  .page-title-row{margin:0 0 10px;padding:0 0 10px}
  .page-title-row h1,.placeholder h1{font-size:24px;line-height:1.15;white-space:normal}
  .toolbar{display:flex;flex-direction:column;align-items:stretch;width:100%;gap:9px;margin-bottom:10px}
  .toolbar-left{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));width:100%;gap:6px}
  .toolbar-left .tool{width:100%;min-width:0;height:44px;padding:0;font-size:22px}
  #qr-button{font-size:0}
  #qr-button::before{content:'▣';font-size:22px}
  .toolbar-right{display:grid!important;grid-template-columns:minmax(0,1fr) 46px;width:100%;gap:8px}
  .toolbar-right .search{grid-column:1/-1;width:100%;height:44px}
  .toolbar-right #location-filter{grid-column:1;width:100%;height:44px;min-width:0}
  .toolbar-right #refresh-button{grid-column:2;width:46px;height:44px;margin:0;border:1px solid #cbd5e1}
  .table-wrap{width:100%;min-height:0;overflow:hidden;border:1px solid #cbd5e1}
  .table-wrap table{width:100%;min-width:0;table-layout:fixed}
  .table-wrap th,.table-wrap td{padding:11px 7px;white-space:normal;overflow:hidden;text-overflow:ellipsis}
  .table-wrap th:nth-child(n),.table-wrap td:nth-child(n){display:none}
  .table-wrap th:nth-child(1),.table-wrap td:nth-child(1),
  .table-wrap th:nth-child(2),.table-wrap td:nth-child(2),
  .table-wrap th:nth-child(6),.table-wrap td:nth-child(6),
  .table-wrap th:nth-child(7),.table-wrap td:nth-child(7){display:table-cell}
  .table-wrap th:nth-child(1),.table-wrap td:nth-child(1){width:46px;text-align:center}
  .table-wrap th:nth-child(2),.table-wrap td:nth-child(2){width:auto}
  .table-wrap th:nth-child(6),.table-wrap td:nth-child(6){width:64px;text-align:right}
  .table-wrap th:nth-child(7),.table-wrap td:nth-child(7){width:72px;text-align:center}
  .table-wrap .piece{font-size:15px;line-height:1.3;overflow-wrap:anywhere}
  .pager{width:100%;padding:9px;gap:8px}
  .pager>div{width:100%;justify-content:space-between;flex-wrap:wrap}
  .pager label{font-size:12px}
  .sidebar{top:48px!important;width:min(82vw,310px)!important;max-width:310px;transform:translateX(-105%)!important}
  body.mobile-menu-open .sidebar{transform:translateX(0)!important}
  .sidebar-overlay{display:none;inset:48px 0 0!important}
  body.mobile-menu-open .sidebar-overlay{display:block}
  .mobile-header{width:100%;max-width:100vw;gap:8px}
  .mobile-header strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-header span{flex:none;white-space:nowrap}
}

@media (max-width:390px){
  .page-title-row h1{font-size:21px}
  .toolbar-left{grid-template-columns:repeat(3,1fr)}
  .toolbar-left .tool{height:42px}
  .table-wrap th:nth-child(7),.table-wrap td:nth-child(7){display:none}
  .table-wrap th:nth-child(6),.table-wrap td:nth-child(6){width:58px}
}
