#setup-screen, #auth-screen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: flex-start; justify-content: center; z-index: 1000; overflow-y: auto; padding: 20px 16px 40px; }
#setup-screen.hidden, #auth-screen.hidden { display: none; }
#loading { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 500; flex-direction: column; gap: 14px; }
#loading.hidden { display: none; }
#app { display: none; }
#app.visible { display: block; }
header { background: #141212; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hdr-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.hdr-actions { display: flex; align-items: center; gap: 10px; }

nav.desktop-nav { display: flex; justify-content: center; gap: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
nav.desktop-nav::-webkit-scrollbar { display: none; }

.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #141212; border-top: 1px solid var(--border); z-index: 50; padding-bottom: var(--safe-b); }
.bottom-nav-inner { display: flex; height: var(--nav-h); padding: 0 4px; }
main { max-width: 1200px; margin: 0 auto; padding: 24px; }
.tab { display: none; }
.tab.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.modal-ov { position: fixed; inset: 0; background: #141212eb; backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-ov.hidden { display: none; }

/* Nouvelles classes pour les barres d'outils */
.cmds-toolbar { width: 100%; justify-content: space-between; }
.cmds-filters { display: flex; gap: 10px; }
.cmds-actions { display: flex; gap: 10px; }

.decl-toolbar { width: 100%; justify-content: space-between; align-items: center; }
.decl-filters { display: flex; gap: 10px; align-items: center; }
.decl-actions { display: flex; gap: 10px; align-items: center; }

@media(max-width: 768px) { 
  .header-inner { padding: 0 16px; } 
  nav.desktop-nav { display: none; } 
  .bottom-nav { display: block; } 
  main { padding: 16px 16px calc(var(--nav-h) + 20px); } 
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } 
  .two-col { grid-template-columns: 1fr; gap: 12px; } 
  .hdr-actions .btn-p { display: none; } 
  
  /* Disposition empilée 100% largeur pour Commandes et Déclarations */
  .cmds-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .cmds-filters { display: flex; width: 100%; gap: 10px; }
  .cmds-filters .inp { flex: 1; width: 100%; }
  .cmds-actions { display: flex; width: 100%; gap: 10px; }
  .cmds-actions button { flex: 1; justify-content: center; }
  
  .decl-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .decl-filters { display: flex; width: 100%; gap: 8px; justify-content: space-between; align-items: center; }
  .decl-filters .inp { flex: 1; min-width: 0; }
  .decl-actions { display: flex; width: 100%; gap: 10px; }
  .decl-actions .inp { flex: 1; }
  .decl-actions button { flex: 1; justify-content: center; }
}