
:root{
  --safe-top:env(safe-area-inset-top,0px);
  --safe-right:env(safe-area-inset-right,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-left:env(safe-area-inset-left,0px);
  --pwa-content-max:1920px;
  --pwa-touch-target:44px;
}

html{
  font-size:clamp(15px,.22vw + 14px,18px);
  scroll-behavior:smooth;
}

body{
  min-width:320px;
  overflow-x:hidden;
  padding-bottom:calc(72px + var(--safe-bottom));
}

img,svg,video,canvas,iframe{
  max-width:100%;
  height:auto;
}

button,
input,
select,
textarea,
.btn{
  font-size:16px;
}

button,
.btn,
.form-control,
.form-select,
.nav-link{
  min-height:var(--pwa-touch-target);
}

.container-fluid{
  width:100%;
  max-width:var(--pwa-content-max);
  margin-inline:auto;
}

.site-header{
  padding-top:var(--safe-top);
}

.navbar-brand{
  flex:0 0 auto;
}

.navbar-brand small{
  display:block;
  line-height:1.1;
}

.compact-search,
.compact-search .form-control{
  min-width:0;
}

.table-responsive{
  max-width:100%;
  border-radius:1rem;
  -webkit-overflow-scrolling:touch;
}

.modal-dialog{
  max-width:min(96vw,700px);
}

.pwa-skip-link{
  position:fixed;
  top:-100px;
  left:12px;
  z-index:99999;
  padding:12px 16px;
  color:#075b35;
  font-weight:800;
  background:#fff;
  border-radius:10px;
  box-shadow:0 8px 30px rgba(0,0,0,.2);
}

.pwa-skip-link:focus{
  top:calc(12px + var(--safe-top));
}

.offline-indicator{
  position:fixed;
  top:calc(8px + var(--safe-top));
  left:50%;
  z-index:1080;
  display:none;
  padding:8px 14px;
  color:#fff;
  font-size:.82rem;
  font-weight:800;
  white-space:nowrap;
  background:#7a3e00;
  border-radius:999px;
  box-shadow:0 8px 22px rgba(0,0,0,.18);
  transform:translateX(-50%);
}

body.is-offline .offline-indicator{
  display:block;
}

.mobile-bottom-nav{
  position:fixed;
  right:0;
  bottom:0;
  left:0;
  z-index:1040;
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  padding:6px max(8px,var(--safe-right)) calc(6px + var(--safe-bottom)) max(8px,var(--safe-left));
  background:rgba(255,255,255,.96);
  border-top:1px solid #dce9e1;
  box-shadow:0 -10px 30px rgba(11,89,50,.12);
  backdrop-filter:blur(16px);
}

.mobile-bottom-nav a{
  display:flex;
  min-width:0;
  min-height:54px;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  overflow:hidden;
  color:#5d7065;
  font-size:.69rem;
  font-weight:750;
  text-decoration:none;
  border-radius:12px;
}

.mobile-bottom-nav a i{
  font-size:1.22rem;
}

.mobile-bottom-nav a:hover,
.mobile-bottom-nav a:focus,
.mobile-bottom-nav a.active{
  color:#087b40;
  background:#edf9f2;
}

.pwa-install-banner{
  position:fixed;
  right:14px;
  bottom:calc(82px + var(--safe-bottom));
  left:14px;
  z-index:1070;
  display:none;
  width:auto;
  max-width:520px;
  margin-inline:auto;
  padding:14px;
  background:#fff;
  border:1px solid #d8e8df;
  border-radius:18px;
  box-shadow:0 22px 65px rgba(8,75,41,.22);
}

.pwa-install-banner.show{
  display:block;
}

.pwa-install-icon{
  width:48px;
  height:48px;
  flex:0 0 48px;
  border-radius:14px;
}

.card,
.app-card,
.dashboard-card,
.panel,
.form-card,
.detail-card{
  overflow-wrap:anywhere;
}

h1,
.display-1{
  font-size:clamp(2rem,7vw,5.4rem);
}

h2,
.display-2{
  font-size:clamp(1.65rem,5vw,4rem);
}

.home-shell,
.page-shell,
.dashboard-shell{
  width:100%;
  max-width:var(--pwa-content-max);
  margin-inline:auto;
}

/* Preserve wide-screen utility without creating unreadably long lines. */
@media (min-width:1600px){
  .container,
  .container-lg,
  .container-md,
  .container-sm,
  .container-xl,
  .container-xxl{
    max-width:1500px;
  }

  .row{
    --bs-gutter-x:2rem;
  }
}

@media (min-width:2200px){
  html{
    font-size:19px;
  }

  .container,
  .container-lg,
  .container-md,
  .container-sm,
  .container-xl,
  .container-xxl{
    max-width:1900px;
  }

  .container-fluid{
    padding-inline:clamp(3rem,5vw,8rem)!important;
  }
}

@media (max-width:1199.98px){
  .navbar-collapse{
    max-height:calc(100dvh - 76px);
    overflow-y:auto;
    padding:12px 0;
  }

  .navbar-nav{
    align-items:stretch!important;
  }

  .navbar-nav .btn{
    width:100%;
  }

  .subnav .container-fluid{
    scrollbar-width:none;
  }

  .subnav .container-fluid::-webkit-scrollbar{
    display:none;
  }

  .top-grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
}

@media (max-width:767.98px){
  .container,
  .container-fluid{
    padding-right:16px!important;
    padding-left:16px!important;
  }

  .navbar-brand strong{
    font-size:1.15rem;
  }

  .navbar-brand small{
    font-size:.56rem;
  }

  .brand-leaf{
    font-size:1.65rem;
  }

  .compact-search{
    width:100%;
    margin-inline:0!important;
  }

  .site-footer .col-6{
    width:100%;
  }

  .footer-bottom{
    align-items:center;
    padding-bottom:calc(16px + var(--safe-bottom));
    text-align:center;
  }

  .footer-bottom-links{
    justify-content:center;
    flex-wrap:wrap;
  }

  .dropdown-menu{
    max-width:calc(100vw - 24px);
  }

  .form-control,
  .form-select{
    padding:.72rem .85rem;
  }

  .btn{
    padding:.68rem .95rem;
  }

  .card-body{
    padding:1rem;
  }

  .quick-products{
    grid-template-columns:minmax(0,1fr)!important;
  }

  .quick-product{
    flex-direction:row!important;
  }

  .quick-product img{
    width:82px!important;
    height:68px!important;
  }

  .compact-metrics{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  }

  .conversion-strip{
    align-items:flex-start;
    flex-direction:column;
  }

  .table-responsive[data-mobile-cards="true"] table,
  .table-responsive[data-mobile-cards="true"] thead,
  .table-responsive[data-mobile-cards="true"] tbody,
  .table-responsive[data-mobile-cards="true"] th,
  .table-responsive[data-mobile-cards="true"] td,
  .table-responsive[data-mobile-cards="true"] tr{
    display:block;
  }

  .table-responsive[data-mobile-cards="true"] thead{
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip:rect(0 0 0 0);
  }

  .table-responsive[data-mobile-cards="true"] tr{
    margin-bottom:14px;
    padding:12px;
    background:#fff;
    border:1px solid #ddeae2;
    border-radius:15px;
  }

  .table-responsive[data-mobile-cards="true"] td{
    display:grid;
    grid-template-columns:minmax(105px,38%) minmax(0,1fr);
    gap:10px;
    padding:8px 4px;
    border:0;
  }

  .table-responsive[data-mobile-cards="true"] td::before{
    content:attr(data-label);
    color:#245039;
    font-weight:800;
  }
}

@media (max-width:479.98px){
  .compact-metrics{
    grid-template-columns:minmax(0,1fr)!important;
  }

  .ticker-shell{
    grid-template-columns:92px minmax(0,1fr) 34px!important;
  }

  .ticker-label{
    padding-inline:9px!important;
  }

  .ticker-label small{
    display:none;
  }

  .hero-content{
    right:18px!important;
    left:18px!important;
  }
}

@media (min-width:768px){
  body{
    padding-bottom:0;
  }

  .mobile-bottom-nav{
    display:none;
  }

  .pwa-install-banner{
    right:24px;
    bottom:24px;
    left:auto;
    margin:0;
  }
}

@media (display-mode:standalone){
  .pwa-install-banner{
    display:none!important;
  }
}

@media (prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}
