/* NotaDF responsive restoration v8.2
   Desktop keeps the original v8 panel geometry. Only small screens use a drawer. */
:root{--nd-sidebar:288px;--nd-gap:clamp(14px,2.2vw,30px)}
html,body{max-width:100%;overflow-x:hidden}body{min-width:320px}
.nav-toggle,.nav-overlay{display:none}
.table-scroll{max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
.card,.modern-dashboard,.modern-dashboard>*,.profile-layout>*{min-width:0;max-width:100%}

/* Standalone tools share the same visual structure without a second offset. */
.nd-sidebar{width:var(--nd-sidebar)!important}
.nd-app{width:auto!important;min-height:100vh;margin-left:var(--nd-sidebar)!important;padding:1px 0}
.nd-app>.wrap,.nd-app>.shell{width:auto!important;max-width:1250px!important;margin:34px auto!important;padding:0 var(--nd-gap) 55px!important}
.nd-app .top{position:static!important;inset:auto!important;height:auto!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important}

@media(max-width:1100px) and (min-width:901px){
  .modern-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .modern-lower,.profile-layout{grid-template-columns:1fr!important}
}

@media(max-width:900px){
  .nav-toggle{display:grid!important;place-items:center;position:fixed;z-index:260;left:14px;top:12px;width:44px;height:44px;padding:0!important;border:1px solid #d5e3e8!important;border-radius:12px!important;background:#fff!important;color:#123b52!important;box-shadow:0 8px 25px #0a2d4524!important;font-size:0!important}
  .nav-toggle:before{content:"";width:20px;height:14px;border-top:2px solid currentColor;border-bottom:2px solid currentColor;background:linear-gradient(currentColor,currentColor) center/20px 2px no-repeat}
  .nav-overlay{position:fixed;z-index:235;inset:0;background:#061c2c99;backdrop-filter:blur(2px)}
  body.nav-open .nav-overlay{display:block}

  body>.wrap:has(>.top){display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:78px 14px 42px!important;background:#f3f7fa!important}
  body>.wrap:has(>.top)>.top{position:fixed!important;z-index:230!important;left:0!important;right:0!important;top:0!important;height:68px!important;min-height:68px!important;margin:0!important;padding:10px 14px 10px 70px!important;border:0!important;border-bottom:1px solid #dce6eb!important;border-radius:0!important;background:#fff!important}
  body>.wrap:has(>.top)>.nav{display:flex!important;position:fixed!important;z-index:250!important;left:0!important;top:0!important;bottom:0!important;width:min(288px,86vw)!important;min-height:100vh!important;margin:0!important;padding:92px 12px 24px!important;border-radius:0!important;background:#0c2b45!important;transform:translateX(-105%);transition:transform .22s ease;overflow-y:auto!important;box-shadow:18px 0 45px #061d2d55!important}
  body.nav-open>.wrap:has(>.top)>.nav{transform:translateX(0)}
  body>.wrap:has(>.top)>.nav:before{display:block!important;top:17px!important;font-size:21px!important}
  body>.wrap:has(>.top)>.nav .side-foot{position:static!important;display:flex!important;margin-top:auto!important}
  body>.wrap:has(>.top)>:not(.top):not(.nav){margin:18px 0 0!important}
  .top-env{display:none!important}.top-company{min-width:0!important;margin:0 auto 0 0!important;padding:0!important;border:0!important}.top-company strong{display:block;max-width:45vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-user>span{display:none}

  .nd-sidebar{position:fixed!important;z-index:250!important;left:0!important;top:0!important;bottom:0!important;width:min(288px,86vw)!important;transform:translateX(-105%);transition:transform .22s ease;box-shadow:18px 0 45px #061d2d55!important}
  body.nav-open .nd-sidebar{transform:translateX(0)}
  .nd-app{width:100%!important;margin-left:0!important;padding-top:70px!important}
  .nd-app>.wrap,.nd-app>.shell{width:100%!important;max-width:none!important;margin:0!important;padding:18px 14px 45px!important}
  .nd-app .top{position:static!important;padding:0!important;background:transparent!important}

  .modern-kpis,.modern-lower,.profile-layout,.search-panel,.grid{grid-template-columns:1fr!important}
  .wide{grid-column:1!important}.modern-welcome,.active-company,.nd-page-head{align-items:flex-start!important;flex-direction:column!important}.modern-welcome .actions,.delivery-actions{width:100%;justify-content:flex-start!important;flex-wrap:wrap}.active-company label{width:100%;min-width:0!important}.cert-state{width:100%;padding:12px 0!important;border-left:0!important;border-top:1px solid #e0e8ec}
  .card{padding:18px!important}.table-scroll{width:100%}.actions{flex-wrap:wrap!important}
  body:has(.simple-invoice)>.wrap{padding:78px 12px 40px!important}.simple-invoice .wizard-layout{padding:12px!important}.simple-invoice .wizard-main{padding:18px 14px!important}
}

@media(max-width:560px){
  .modern-kpis{grid-template-columns:1fr!important}.modern-welcome h1{font-size:28px!important}.modern-welcome .actions>*{width:100%}.top-company strong{max-width:52vw}.card{padding:15px!important;border-radius:14px!important}.btn{padding:10px 12px!important}.nd-search,.search-panel{grid-template-columns:1fr!important}
}
