/* Phase 8 mobile inventory styles -- hand-written, no build step, no CDN.
   app.css (vendored above this file) is a purged Tailwind build that only
   contains the utility classes the Phase 5/7 ticket templates already use;
   rather than hand-maintain a second purge list, the inventory templates
   use this small, purpose-built component stylesheet instead. Mobile-first
   throughout: base rules target a phone width, the min-width query widens
   layout for tablet/desktop. */

.inv-topnav {
  display: flex;
  gap: .5rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: .5rem .75rem;
}
.inv-topnav-link {
  padding: .4rem .75rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}
.inv-topnav-link:hover { background: #f1f5f9; }

.inv-page {
  max-width: 640px;
  margin: 0 auto;
  padding: .75rem .75rem 3rem;
}
.inv-page-wide { max-width: 900px; }

.inv-h1 { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: .5rem 0 1rem; }
.inv-h2 { font-size: 1rem; font-weight: 700; color: #0f172a; margin: 1.25rem 0 .5rem; }
.inv-muted { color: #64748b; font-size: .875rem; }
.inv-note { white-space: pre-wrap; }

.inv-search-form { display: flex; gap: .5rem; margin-bottom: 1rem; }
.inv-search-input {
  flex: 1; min-width: 0; border: 1px solid #cbd5e1; border-radius: .6rem;
  padding: .75rem .9rem; font-size: 1rem;
}
.inv-search-btn {
  border: 0; border-radius: .6rem; background: #1e293b; color: #fff; font-weight: 600;
  padding: 0 1.1rem; font-size: .95rem;
}

.inv-tile-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1.5rem;
}
@media (min-width: 560px) { .inv-tile-grid { grid-template-columns: repeat(4, 1fr); } }
.inv-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; background: #fff; border: 1px solid #e2e8f0; border-radius: .9rem;
  padding: 1.1rem .5rem; text-decoration: none; color: #0f172a; font-weight: 600;
  font-size: .85rem; text-align: center; min-height: 84px;
}
.inv-tile:active { background: #f1f5f9; }
.inv-tile-icon { font-size: 1.5rem; line-height: 1; }
.inv-tile-badge {
  display: inline-block; margin-top: .15rem; background: #fee2e2; color: #b91c1c;
  border-radius: 999px; padding: .05rem .5rem; font-size: .7rem; font-weight: 700;
}

.inv-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: .8rem; padding: .9rem;
  margin-bottom: .6rem;
}
.inv-card-link { display: block; text-decoration: none; color: inherit; }
.inv-card-title { font-weight: 700; color: #0f172a; font-size: .95rem; }
.inv-card-sub { color: #64748b; font-size: .8rem; margin-top: .15rem; }
.inv-card-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

.inv-empty { color: #94a3b8; font-size: .9rem; padding: 1.25rem 0; text-align: center; }

.inv-badge {
  display: inline-block; border-radius: 999px; padding: .1rem .55rem; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em;
}
.inv-badge-installed { background: #dcfce7; color: #166534; }
.inv-badge-spare { background: #e0e7ff; color: #3730a3; }
.inv-badge-in_repair { background: #fef3c7; color: #92400e; }
.inv-badge-missing { background: #fee2e2; color: #991b1b; }
.inv-badge-retired { background: #e2e8f0; color: #475569; }
.inv-badge-working { background: #dcfce7; color: #166534; }
.inv-badge-needs_attention { background: #fef3c7; color: #92400e; }
.inv-badge-broken { background: #fee2e2; color: #991b1b; }
.inv-badge-unknown { background: #e2e8f0; color: #475569; }
.inv-badge-warn { background: #fef3c7; color: #92400e; }
.inv-badge-bulk { background: #f1f5f9; color: #475569; }

.inv-field { margin-bottom: .9rem; }
.inv-label { display: block; font-size: .85rem; font-weight: 600; color: #334155; margin-bottom: .3rem; }
.inv-input, .inv-select, .inv-textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: .55rem; padding: .65rem .75rem;
  font-size: 1rem; background: #fff; color: #0f172a;
}
.inv-textarea { min-height: 5rem; resize: vertical; }
.inv-help { font-size: .78rem; color: #64748b; margin-top: .25rem; }
.inv-error-box {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: .6rem;
  padding: .75rem; margin-bottom: 1rem; font-size: .9rem;
}
.inv-error-box ul { margin: 0; padding-left: 1.1rem; }
.inv-conflict-box {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: .6rem;
  padding: .75rem; margin-bottom: 1rem; font-size: .9rem;
}
.inv-info-box {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: .6rem;
  padding: .75rem; margin-bottom: 1rem; font-size: .9rem;
}

.inv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid #cbd5e1; border-radius: .6rem; background: #fff; color: #0f172a;
  font-weight: 600; font-size: .9rem; padding: .65rem 1rem; cursor: pointer; text-decoration: none;
}
.inv-btn-block { width: 100%; }
.inv-btn-lg { padding: .9rem 1rem; font-size: 1rem; min-height: 52px; }
.inv-btn-primary { background: #1e293b; color: #fff; border-color: #1e293b; }
.inv-btn-danger { background: #fff; color: #b91c1c; border-color: #fecaca; }
.inv-btn-danger-solid { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.inv-btn-ghost { background: transparent; border-color: transparent; color: #334155; }
.inv-btn:disabled { opacity: .5; cursor: not-allowed; }

.inv-action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 1rem 0; }
@media (min-width: 480px) { .inv-action-grid { grid-template-columns: repeat(3, 1fr); } }

.inv-history-item {
  border-left: 2px solid #e2e8f0; padding: .1rem 0 .8rem .8rem; margin-left: .3rem; font-size: .85rem;
}
.inv-history-time { color: #94a3b8; font-size: .75rem; }
.inv-history-event { font-weight: 600; color: #0f172a; }

.inv-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.inv-tab {
  border: 1px solid #cbd5e1; border-radius: 999px; padding: .35rem .8rem; font-size: .8rem;
  font-weight: 600; color: #334155; text-decoration: none; background: #fff;
}
.inv-tab-active { background: #1e293b; color: #fff; border-color: #1e293b; }

.inv-stock-row {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .6rem 0; border-bottom: 1px solid #f1f5f9;
}
.inv-stock-qty { font-weight: 700; font-size: 1.1rem; }
.inv-inline-form { display: inline-flex; gap: .3rem; align-items: center; }
.inv-num-input { width: 4.5rem; }

.inv-scan-video { width: 100%; border-radius: .6rem; background: #000; min-height: 220px; }
.inv-scan-result { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1rem; }

fieldset.inv-fieldset { border: 1px solid #e2e8f0; border-radius: .7rem; padding: .8rem; margin-bottom: 1rem; }
fieldset.inv-fieldset legend { font-weight: 700; font-size: .85rem; color: #334155; padding: 0 .3rem; }
