
/* GI2 Paws Phone + Tablet PWA v1.0 */
:root{
  --mobile-footer-height:64px;
}
html,body{
  -webkit-tap-highlight-color:transparent;
  overscroll-behavior:contain;
}
body.pwa-locked{
  overflow:hidden;
}
.pwa-auth-overlay{
  position:fixed;
  inset:0;
  z-index:99999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:linear-gradient(135deg,#fff7ed 0%,#faf5ff 55%,#fef2f2 100%);
}
.pwa-auth-card{
  width:430px;
  max-width:100%;
  background:rgba(255,255,255,.96);
  border:1px solid #e5e7eb;
  border-radius:24px;
  box-shadow:0 20px 70px rgba(31,41,55,.16);
  padding:26px;
  text-align:center;
}
.pwa-auth-card img{
  width:150px;
  max-width:60%;
  height:auto;
  display:block;
  margin:0 auto 14px;
}
.pwa-auth-card h1{
  margin:0 0 4px;
  font-size:22px;
  line-height:1.2;
}
.pwa-auth-card .sub{
  color:#6b7280;
  font-size:13px;
  margin-bottom:18px;
}
.pwa-auth-card .mode{
  color:#5b21b6;
  font-weight:800;
  font-size:12px;
  margin-bottom:8px;
}
.pwa-auth-card label{
  display:block;
  text-align:left;
  font-size:13px;
  font-weight:700;
  color:#374151;
  margin:12px 0 6px;
}
.pwa-auth-card input{
  width:100%;
  border:1px solid #d1d5db;
  border-radius:12px;
  padding:12px;
  font-size:16px;
  background:#fff;
}
.pwa-auth-card input:focus{
  outline:none;
  border-color:#8b5cf6;
  box-shadow:0 0 0 3px rgba(139,92,246,.14);
}
.pwa-auth-card button{
  width:100%;
  border:0;
  border-radius:13px;
  padding:12px 14px;
  margin-top:14px;
  font-weight:800;
  font-size:15px;
  color:white;
  background:linear-gradient(90deg,#f59e0b,#ec4899,#8b5cf6);
}
.pwa-auth-card .light{
  background:#fff;
  color:#4b5563;
  border:1px solid #d1d5db;
  box-shadow:none;
}
.pwa-auth-card .error{
  display:none;
  margin-top:12px;
  padding:10px;
  border-radius:12px;
  background:#fef2f2;
  border:1px solid #fecaca;
  color:#991b1b;
  font-size:13px;
  text-align:left;
}
.pwa-auth-card .notice{
  background:#fffbeb;
  border:1px solid #fde68a;
  color:#92400e;
  padding:10px;
  border-radius:12px;
  font-size:13px;
  text-align:left;
  margin:10px 0;
}
.pwa-auth-card .copyright{
  margin-top:16px;
  color:#9ca3af;
  font-size:11px;
}
.pwa-hidden{display:none!important}
.pwa-lock-btn{
  background:#6b7280!important;
  color:white!important;
}
.pwa-install-tip{
  position:fixed;
  left:12px;
  right:12px;
  bottom:12px;
  z-index:80000;
  background:#111827;
  color:white;
  padding:12px 14px;
  border-radius:14px;
  box-shadow:0 12px 40px rgba(0,0,0,.24);
  font-size:13px;
  display:none;
}
.pwa-install-tip button{
  float:right;
  background:#fff;
  color:#111827;
  border:0;
  border-radius:8px;
  padding:5px 8px;
  margin-left:10px;
  font-weight:800;
}

@media (max-width: 760px){
  .topbar{
    position:sticky;
    top:0;
    z-index:20;
    padding:12px;
  }
  .brand-wrap{
    width:100%;
  }
  .brand-logo{
    width:70px!important;
  }
  .topbar h1{
    font-size:18px!important;
    line-height:1.15;
  }
  .top-actions{
    grid-template-columns:1fr 1fr!important;
  }
  .tabs{
    position:sticky;
    top:82px;
    z-index:19;
    display:flex;
    gap:5px;
    overflow-x:auto;
    padding:8px;
    scroll-snap-type:x mandatory;
  }
  .tabs button{
    scroll-snap-align:start;
    flex:0 0 auto;
    font-size:12px;
    padding:8px 10px;
    border-radius:999px;
  }
  main{
    padding:10px 8px calc(var(--mobile-footer-height) + 18px);
  }
  .card{
    border-radius:14px;
    padding:12px;
  }
  .dashboard-hero{
    display:block!important;
    text-align:center;
  }
  .dashboard-hero-logo{
    max-width:130px!important;
    margin:0 auto 8px!important;
  }
  .grid.kpi{
    grid-template-columns:1fr 1fr!important;
  }
  .kpi-card .value{
    font-size:19px!important;
  }
  .toolbar{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  .toolbar button,.toolbar input,.toolbar select,.toolbar label{
    min-width:0!important;
    width:100%!important;
  }
  .summary-grid{
    grid-template-columns:1fr 1fr!important;
  }
  .summary-card{
    min-height:62px;
  }
  .summary-label{
    font-size:11px!important;
  }
  .summary-value{
    font-size:15px!important;
  }
  .summary-card-filter-head{
    padding:9px 10px!important;
  }
  .summary-card-toggle-grid{
    grid-template-columns:1fr!important;
  }
  .table-wrap{
    height:68vh!important;
    min-height:420px!important;
    max-height:68vh!important;
    border-radius:12px;
  }
  .data-table{
    font-size:12px!important;
  }
  .data-table th{
    font-size:11px!important;
  }
  .data-table input,.data-table select{
    font-size:12px!important;
    padding:6px!important;
  }
  .table-filter-row .header-filter{
    font-size:12px!important;
  }
  .data-table .sticky-sku{
    min-width:140px!important;
    max-width:160px!important;
  }
  .data-table .sticky-product{
    left:140px!important;
    min-width:190px!important;
    max-width:220px!important;
  }
  .app-footer{
    position:fixed!important;
    left:0;
    right:0;
    bottom:0;
    z-index:30;
    padding:8px 12px!important;
    background:rgba(255,255,255,.96)!important;
    backdrop-filter:blur(12px);
    border-top:1px solid var(--line);
    font-size:11px!important;
  }
}

@media (min-width: 761px) and (max-width: 1180px){
  .topbar{
    padding:14px 18px;
  }
  .brand-logo{
    width:96px!important;
  }
  main{
    padding:14px;
  }
  .grid.kpi{
    grid-template-columns:repeat(4,minmax(120px,1fr))!important;
  }
  .table-wrap{
    height:70vh!important;
    min-height:520px!important;
    max-height:70vh!important;
  }
  .summary-grid{
    grid-template-columns:repeat(3,minmax(140px,1fr))!important;
  }
}

/* PWA safe area for iPhone */
@supports(padding:max(0px)){
  .app-footer{
    padding-bottom:max(8px, env(safe-area-inset-bottom))!important;
  }
  .pwa-install-tip{
    bottom:max(12px, env(safe-area-inset-bottom))!important;
  }
}
