/* public> css> inventory.css*/
:root{
  --bg:#0b0f14;
  --card:#101823;
  --muted:#90a4b8;
  --txt:#eaf2ff;
  --line:rgba(255,255,255,.08);

  /* topbar height for body padding */
  --topbar-h: 98px;
}

@media (max-width:720px){
  :root{ --topbar-h: 142px; }
}

/* ===== Reset ===== */
*{ box-sizing:border-box; }
html{ overflow-y:scroll; }
html, body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  margin:0;
  padding:0;
}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--txt);
  padding-top: calc(var(--topbar-h) + 10px);
}
a{ color:inherit; }

code, a, .mono{
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* ===== TOPBAR ===== */
.topbar{
  position:fixed;
  top:0; left:0; right:0;
  z-index:50;
  pointer-events:none;
}
.topbar::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.topbar-inner{
  pointer-events:auto;
  position:relative;
  width: min(1200px, calc(100% - 32px));
  margin: 12px auto;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.38);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}
.topbar-row1{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.topbar-left{
  display:flex;
  align-items:center;
  min-width:0;
}
.brand{ font-weight:900; text-decoration:none; }
.sep{ opacity:.35; margin:0 8px; }
.page{
  opacity:.85;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Search */
.search{
  width: clamp(220px, 28vw, 280px);
  max-width: 280px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--txt);
  outline:none;
}

/* Buttons */
.btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  text-decoration:none;
  background:rgba(255,255,255,.04);
  white-space:nowrap;
}

/* ===== MAIN ===== */
.wrap{
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}
.root{ max-width:1200px; margin:0 auto; }

/* ===== Sections ===== */
.section{ margin:18px 0 28px; }
.sectionHead{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
  margin-bottom:12px;
}
.sectionTitle{ font-size:18px; font-weight:950; letter-spacing:.2px; }
.sectionSub{ font-size:12px; color:var(--muted); line-height:1.35; }
.mono{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
}

/* ===== Grid / Cards ===== */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(180px,1fr));
  gap:12px;
}
.card{
  display:block;
  text-decoration:none;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  transition:transform .12s ease, border-color .12s ease, filter .12s ease;
}
.card:hover{
  transform:translateY(-2px);
  border-color:rgba(255,255,255,.18);
}

/* Thumb */
.thumb{
  position:relative;
  aspect-ratio:1.1/1;
  background:rgba(255,255,255,.03);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Placeholder (NO IMAGE / BURNED) */
.ph{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  color:rgba(255,255,255,.35);
  font-weight:900;
  letter-spacing:.10em;
  text-align:center;
}

/* Body */
.body{ padding:10px 10px 12px; }
.titleRow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.titleRow .title{
  flex:1;
  min-width:0;
}
.title{
  font-size:13px;
  font-weight:850;
  line-height:1.2;
}

/* Empty */
.empty{
  padding:16px;
  border:1px dashed var(--line);
  border-radius:16px;
  color:var(--muted);
}

/* ===== QR button ===== */
.qrBtn{
  width:22px;
  height:22px;
  padding:0;
  border-radius:7px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  font-size:10px;
  font-weight:900;
  line-height:1;
  display:grid;
  place-items:center;
  cursor:pointer;

  opacity:0;
  transform: translateY(2px);
  transition: opacity .12s ease, transform .12s ease, border-color .12s ease;
}
.card:hover .qrBtn{
  opacity:1;
  transform:none;
}
@media (max-width:720px){
  .qrBtn{ opacity:1; transform:none; }
}

/* ===== STOLEN banner (shared style) ===== */
.badgeMount{
  position:absolute;
  top:12px;
  left:12px;
  z-index:2;
  pointer-events:none;
}
.badge-stolen{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:12px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
  background: rgba(239,68,68,.92);
  color:#fff;
  border: 1px solid rgba(255,0,0,.45);
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Optional: emphasize stolen card */
.card.is-stolen .body{
  background: rgba(0,0,0,.35);
  border-top: 1px solid rgba(239,68,68,.22);
}

/* ===== MODAL QR ===== */
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.62);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:80;
}
.modalCard{
  width:min(520px, 96vw);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
}
.modalHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
}
.modalTitle{ font-weight:950; }
.x{
  border:0;
  background:transparent;
  color:var(--txt);
  font-size:18px;
  cursor:pointer;
}
.modalBody{
  padding:14px;
  display:grid;
  gap:12px;
  justify-items:center;
}
.qrActions{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
}
.btn2{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--txt);
  cursor:pointer;
}
.muted{ color:var(--muted); font-size:12px; }

/* ===== Mobile layout ===== */
@media (max-width:720px){
  .topbar-inner{
    width: calc(100% - 24px);
    margin: 10px auto;
    padding: 12px;
  }
  .wrap{ width: calc(100% - 24px); }

  .topbar-left{ flex: 1 1 auto; }

  .search{
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    max-width: 100%;
  }
}
/* ===== Stolen: testo + QR piccolo dentro la stessa scheda ===== */
.stolenSummaryRow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.stolenSummaryLeft{
  min-width:0;
}

.stolenRegistryRight{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
  max-width:420px;
}

.stolenRegistryText{
  font-size:12px;
  color:var(--muted);
  line-height:1.35;
  text-align:right;
}

.stolenRegistryImg{
  width:44px;
  height:44px;
  object-fit:contain;
  flex:0 0 44px;
}

/* Mobile: va sotto senza stringere */
@media (max-width:720px){
  .stolenSummaryRow{
    flex-direction:column;
    align-items:stretch;
  }
  .stolenRegistryRight{
    justify-content:space-between;
    max-width:none;
  }
  .stolenRegistryText{
    text-align:left;
  }
}