/* ============================================
   InvenScan — Modern Minimalist Inventory UI
   ============================================ */

:root {
  --bg: #0a0b0e;
  --surface: #111317;
  --surface2: #1a1d23;
  --surface3: #22262e;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --text: #f0f2f5;
  --text-muted: #6b7280;
  --text-subtle: #374151;
  --primary: #4f8eff;
  --primary-dim: rgba(79,142,255,0.15);
  --primary-glow: rgba(79,142,255,0.3);
  --success: #22c55e;
  --success-dim: rgba(34,197,94,0.12);
  --danger: #ef4444;
  --danger-dim: rgba(239,68,68,0.12);
  --warning: #f59e0b;
  --warning-dim: rgba(245,158,11,0.12);
  --accent: #a78bfa;
  --accent-dim: rgba(167,139,250,0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --sidebar-w: 220px;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 28px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'poppins', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: white;
  letter-spacing: 0.5px;
  box-shadow: 0 0 20px var(--primary-glow);
}

.logo-text {
  font-family: 'poppins', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: all var(--transition);
  overflow: hidden;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-dim);
}

.nav-item.active .nav-indicator {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--primary);
  border-radius: 2px 0 0 2px;
  box-shadow: 0 0 10px var(--primary);
}

.nav-icon { font-size: 16px; width: 18px; text-align: center; }
.nav-label { flex: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sf-version { font-size: 11px; color: var(--text-subtle); }

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.sidebar-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
  animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.breadcrumb {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.page-title {
  font-family: 'poppins', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

/* ---- RASPI STATUS ---- */
.raspi-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.raspi-status.online {
  border-color: rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.08);
  color: var(--success);
}

.raspi-status.offline {
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.08);
  color: var(--danger);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.online .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

.offline .status-dot {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  animation: slideIn 0.5s ease both;
  cursor: default;
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card[data-delay="100"] { animation-delay: 0.1s; }
.stat-card[data-delay="200"] { animation-delay: 0.2s; }
.stat-card[data-delay="300"] { animation-delay: 0.3s; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-card.success { border-color: rgba(34,197,94,0.2); }
.stat-card.success:hover { border-color: rgba(34,197,94,0.4); }
.stat-card.danger  { border-color: rgba(239,68,68,0.2); }
.stat-card.danger:hover  { border-color: rgba(239,68,68,0.4); }
.stat-card.accent  { border-color: rgba(167,139,250,0.2); }
.stat-card.accent:hover  { border-color: rgba(167,139,250,0.4); }

.stat-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border-radius: 12px;
  color: var(--primary);
  flex-shrink: 0;
}
.stat-card.success .stat-icon { color: var(--success); }
.stat-card.danger  .stat-icon { color: var(--danger); }
.stat-card.accent  .stat-icon { color: var(--accent); }
.stat-icon svg { width: 22px; height: 22px; }

.stat-number {
  font-family: 'poppins', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.stat-bg-icon {
  position: absolute;
  right: 16px;
  font-size: 40px;
  opacity: 0.06;
  pointer-events: none;
}

/* ---- SECTIONS ---- */
.section { margin-bottom: 24px; }
.section.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.section-title {
  font-family: 'poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

/* ---- QUICK ACTIONS ---- */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.quick-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-dim);
  opacity: 0;
  transition: opacity var(--transition);
}

.quick-btn:hover::before { opacity: 1; }
.quick-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--primary-glow);
}

.quick-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.qb-icon { font-size: 18px; }
.qb-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 100px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.qb-badge.offline {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}

/* ---- BOTTOM GRID ---- */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ---- ITEM LIST ---- */
.item-list { display: flex; flex-direction: column; gap: 6px; }
.item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
}
.item-row:hover { background: var(--surface2); }

.item-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-thumb-placeholder { font-size: 18px; }

.item-info { flex: 1; min-width: 0; }
.item-name { font-size: 13.5px; font-weight: 500; truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.item-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.see-all {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.see-all:hover { background: var(--primary-dim); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.badge-baik { background: var(--success-dim); color: var(--success); }
.badge-rusak { background: var(--danger-dim); color: var(--danger); }
.badge-kurang-baik { background: var(--warning-dim); color: var(--warning); }

/* ---- ROOM STATS ---- */
.room-stats { display: flex; flex-direction: column; gap: 14px; }
.room-stat-row { display: flex; align-items: center; gap: 10px; }
.room-name { font-size: 12.5px; font-weight: 500; width: 110px; flex-shrink: 0; color: var(--text-muted); }
.room-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--surface3);
  border-radius: 100px;
  overflow: hidden;
}
.room-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 100px;
  min-width: 4px;
  transition: width 1s ease;
}
.room-count { font-size: 12px; color: var(--text-muted); width: 80px; text-align: right; }
.room-dmg { color: var(--danger); }

.last-inspection {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.last-inspection strong { color: var(--text); }

/* ---- INVENTORY TABLE ---- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text);
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  transition: border-color var(--transition);
  outline: none;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--text-muted); }

.filter-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--primary); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--transition);
  cursor: pointer;
}
.data-table tbody tr:hover { background: var(--surface2); }

.td-thumb {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface3);
}

.pagination {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}
.page-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.page-btn:hover, .page-btn.active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}

/* ---- FORMS ---- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 800px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-grid .full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
}
.form-control {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ---- IMAGE UPLOAD ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-dim);
}
.upload-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--text-muted); }
.upload-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  display: none;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 0 var(--primary-glow);
}
.btn-primary:hover {
  background: #6aa0ff;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { opacity: 0.85; }
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { opacity: 0.85; }
.btn-ghost {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-hover); background: var(--surface3); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }

/* ---- QR CODE ---- */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px;
  background: white;
  border-radius: var(--radius);
  max-width: 300px;
  margin: 0 auto;
}
.qr-container img { width: 220px; height: 220px; }
.qr-label { color: #333; font-size: 13px; font-weight: 600; text-align: center; }

/* ---- SCAN PAGE ---- */
.scan-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.camera-frame {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
  border: 1px solid var(--border);
}
.camera-frame video, .camera-frame canvas, .camera-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.camera-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.scan-hint {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
  white-space: nowrap;
}

.detection-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.detection-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.detection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detection-item:last-child { border-bottom: none; }
.detection-conf {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--success-dim);
  color: var(--success);
  font-weight: 600;
}

/* ---- INSPECTION DETAIL ---- */
.inspection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.insp-header {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}
.insp-header.detected { background: var(--success-dim); color: var(--success); }
.insp-header.missing  { background: var(--danger-dim); color: var(--danger); }
.insp-item { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.insp-item:last-child { border-bottom: none; }
.insp-count { font-size: 11px; color: var(--text-muted); }

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  animation: toastIn 0.3s ease both;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
}
.toast.success { background: #166534; border: 1px solid rgba(34,197,94,0.3); }
.toast.error   { background: #7f1d1d; border: 1px solid rgba(239,68,68,0.3); }
.toast.info    { background: #1e3a5f; border: 1px solid rgba(79,142,255,0.3); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- MODAL ---- */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 480px;
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-title {
  font-family: 'poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* ---- LOADING ---- */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 900;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.loading-overlay.active { display: flex; }
.loading-text { font-size: 14px; color: var(--text-muted); }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.empty-desc { font-size: 14px; }

/* ---- MISC ---- */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-12 { gap: 12px; }
.gap-8  { gap: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; padding: 20px 16px 16px; padding-top: 64px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
  .scan-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .inspection-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 22px; }
}

/* ---- SCAN ROOM SPECIFIC ---- */
.bounding-box-overlay {
  position: absolute;
  border: 2px solid #00e5ff;
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.2s;
}
.bounding-box-overlay:hover {
  background: rgba(0,229,255,0.1);
  border-color: #ef4444;
}
.bb-label {
  position: absolute;
  top: -22px; left: 0;
  background: rgba(0,0,0,0.75);
  color: #00e5ff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 600;
}
.bb-deleted { border-color: #ef4444 !important; background: rgba(239,68,68,0.15); }

/* Inventory count list */
.inv-count-list { display: flex; flex-direction: column; gap: 6px; max-height: 350px; overflow-y: auto; }
.inv-count-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface2);
}
.inv-count-name { color: var(--text-muted); }
.inv-count-badge {
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.inv-count-badge.partial { background: var(--warning-dim); color: var(--warning); }
.inv-count-badge.full    { background: var(--success-dim); color: var(--success); }
.inv-count-badge.zero    { background: var(--danger-dim);  color: var(--danger); }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }
