body {
  background-color: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Thai', Roboto, sans-serif;
}

.navbar-brand {
  font-weight: 600;
}

.card {
  border-radius: 12px;
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
}

.product-list {
  max-height: 250px;
  overflow-y: auto;
}

.product-list .product-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
}

.product-list .product-item:hover {
  background-color: #f0f7f4;
  border-color: #28a745;
}

.product-list .product-item.selected {
  background-color: #d4edda;
  border-color: #28a745;
}

.product-list .product-item.active {
  background-color: #d4edda;
  border-color: #28a745;
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
}

.summary-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.summary-icon i {
  font-size: 1.4rem;
}

.stat-card {
  background: #fff;
}

.badge-lg {
  font-size: 0.85rem;
  padding: 6px 12px;
}

#reader {
  border-radius: 8px;
  overflow: hidden;
  padding: 8px;
  background: #f1f3f5;
}

#reader video {
  border-radius: 8px;
}

#reader__scan_region {
  display: flex;
  justify-content: center;
  min-height: 200px;
}

.product-selected-info {
  border: 2px solid #28a745;
  border-radius: 12px;
  padding: 16px;
  background: #f0f9f4;
  display: flex;
  gap: 16px;
  align-items: center;
}

.product-selected-info.danger {
  border-color: #dc3545;
  background: #fdf2f3;
}

.move-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 190px;
  padding-top: 10px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 150px;
  width: 100%;
}

.bar {
  width: 12px;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.4s ease;
}

.bar-in { background: #28a745; }
.bar-out { background: #dc3545; }

.min-w-0 { min-width: 0; }

/* ============ Dashboard ============ */

.dash-hero {
  background: linear-gradient(135deg, #28a745 0%, #1a8c35 50%, #15692a 100%);
  border-radius: 16px;
  padding: 28px 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.dash-hero::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 180px;
  height: 180px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.dash-hero::before {
  content: '';
  position: absolute;
  right: 60px;
  bottom: -40px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.dash-hero h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.dash-hero .small {
  font-size: 0.85rem;
  opacity: 0.85;
}

.dash-stat-card {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
}

.dash-stat-card .card-body {
  padding: 18px 20px;
}

.dash-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.dash-stat-card .stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
}

.dash-stat-card .stat-label {
  font-size: 0.78rem;
  color: #6c757d;
  margin-top: 2px;
}

.section-header {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header .section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.dash-section-card {
  border: none;
  border-radius: 14px;
}

.alert-row {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f3f5;
  transition: background 0.15s;
}

.alert-row:last-child { border-bottom: none; }
.alert-row:hover { background: #f8f9fa; }

.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.recent-row {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f3f5;
  transition: background 0.15s;
}

.recent-row:last-child { border-bottom: none; }
.recent-row:hover { background: #f8f9fa; }

.recent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-card {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.cat-card:hover {
  border-color: #28a745;
  box-shadow: 0 2px 8px rgba(40,167,69,0.1);
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: #adb5bd;
}

.empty-state i { font-size: 2.2rem; }

.cat-bar-track {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

@media print {
  /* Hide everything except report */
  body * {
    visibility: hidden;
  }
  .navbar, .btn, .card-header button {
    display: none !important;
  }
  #reportTable, #reportTable *,
  #reportCards, #reportCards * {
    visibility: visible;
  }
  #reportTable, #reportCards {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
  dl, .d-none, .btn, nav {
    display: none !important;
  }
  #reportCards {
    display: block !important;
  }
}