/* ── Sidebar collapse ────────────────────────────────────── */

.sidebar-aside {
  transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar-label {
  transition: opacity 0.2s ease, width 0.2s ease;
  white-space: nowrap;
}

/* Collapsed state — applied via .sidebar-collapsed on #app-page */
.sidebar-collapsed .sidebar-aside {
  width: 4.5rem;
}

.sidebar-collapsed .sidebar-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-collapsed .sidebar-brand {
  padding-left: 1rem;
  padding-right: 1rem;
  justify-content: center;
}

.sidebar-collapsed .sidebar-nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-collapsed .sidebar-nav-link i {
  font-size: 1.1rem;
}

.sidebar-collapsed .sidebar-user-card {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.sidebar-collapsed .sidebar-section-label {
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.sidebar-collapsed .sidebar-collapse-icon {
  transform: rotate(180deg);
}

.sidebar-collapsed .main-content {
  margin-left: 4.5rem;
}

/* Tooltip on collapsed nav links */
.sidebar-collapsed .sidebar-nav-link {
  position: relative;
}

.sidebar-collapsed .sidebar-nav-link::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 0.75rem);
  top: 50%;
  transform: translateY(-50%);
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  background: #1e293b;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
}

.sidebar-collapsed .sidebar-nav-link:hover::after {
  opacity: 1;
}

/* On mobile, never show collapsed state */
@media (max-width: 1023px) {
  .sidebar-collapsed .sidebar-aside {
    width: 16rem;
  }

  .sidebar-collapsed .sidebar-label {
    opacity: 1;
    width: auto;
    pointer-events: auto;
  }

  .sidebar-collapsed .sidebar-nav-link {
    justify-content: flex-start;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .sidebar-collapsed .sidebar-user-card {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .sidebar-collapsed .sidebar-section-label {
    height: auto;
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
  }

  .sidebar-collapsed .sidebar-nav-link::after {
    display: none;
  }

  .sidebar-collapsed .main-content {
    margin-left: 0;
  }
}

/* Custom styles */
.nav-link {
  border: 1px solid transparent;
  font-weight: 500;
}

.nav-link.active {
  background-color: #fef2f4;
  border-color: #fbd0da;
  color: #d33f65;
  font-weight: 600;
}

.nav-link.active i {
  color: #d33f65;
}

.nav-link.nav-link-locked {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.82;
}

.nav-link.nav-link-locked:hover {
  background: #f8fafc;
  color: #94a3b8;
}

.nav-link.nav-link-locked i {
  color: #94a3b8;
}

.admin-lock-icon {
  margin-left: auto;
  font-size: 0.75rem;
}

.sidebar-section-label {
  margin-bottom: 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.app-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.topbar-controls {
  display: contents;
}

.topbar-page-actions {
  display: flex;
  gap: 0.5rem;
  grid-column: 1 / -1;
  grid-row: 2;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-language {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #ffffff;
  padding: 0.45rem 0.6rem;
  color: #475569;
}

.topbar-language-select {
  min-width: 7.25rem;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 640px) {
  .app-topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .topbar-page-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar-language {
    grid-column: 3;
    grid-row: 1;
  }
}

.page-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #fff7f9 100%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.page-hero--center {
  align-items: center;
}

.page-hero--center > div:first-child {
  flex: 1 1 20rem;
}

.page-eyebrow {
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d33f65;
}

.page-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.page-section-description {
  margin-top: 0.35rem;
  max-width: 42rem;
  font-size: 0.92rem;
  color: #64748b;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  width: 100%;
  max-width: 460px;
}

.summary-grid--compact {
  display: flex;
  width: auto;
  max-width: none;
  flex: 0 0 auto;
  margin-right: 0.5rem;
}

.summary-grid--compact .summary-tile {
  width: fit-content;
  min-width: 150px;
  padding: 1rem 1.25rem;
}

.summary-tile {
  border: 1px solid #f1f5f9;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.88);
  padding: 0.85rem 0.95rem;
}

.summary-tile-label {
  font-size: 0.72rem;
  color: #64748b;
}

.summary-tile-value {
  margin-top: 0.2rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.section-card {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.section-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  background: #fcfcfd;
}

.section-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.section-card-description {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: #64748b;
}

.toolbar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.checkout-history-toolbar {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.toolbar-search {
  grid-column: span 2;
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pagination-summary {
  font-size: 0.82rem;
  color: #64748b;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.pagination-limit-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #475569;
}

.pagination-limit-select {
  min-width: 4.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;
  background: #ffffff;
  padding: 0.4rem 0.65rem;
  color: #0f172a;
}

.pagination-page-indicator {
  min-width: 5rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;
  background: #ffffff;
  color: #475569;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: #f8a9bb;
  background: #fff7f9;
  color: #d33f65;
}

.pagination-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.empty-state-panel {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #94a3b8;
}

.empty-state-panel i {
  margin-bottom: 0.75rem;
  font-size: 2rem;
}

.table-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: #64748b;
}

.password-field input {
  padding-right: 3rem;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  color: #94a3b8;
  transition: color 0.2s ease;
}

.password-toggle-btn:hover {
  color: #475569;
}

.password-toggle-btn:focus-visible {
  outline: 2px solid #f27a95;
  outline-offset: 2px;
  border-radius: 9999px;
}

.action-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: #ffffff;
  color: #64748b;
  transition: all 0.2s;
}

.action-menu-trigger:hover,
.action-menu-trigger[aria-expanded='true'] {
  color: #0f172a;
  border-color: #f8a9bb;
  background: #fff7f9;
}

.action-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 15;
  min-width: 12rem;
  padding: 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.action-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  border-radius: 0.7rem;
  padding: 0.6rem 0.7rem;
  font-size: 0.82rem;
  color: #334155;
  transition: background 0.2s, color 0.2s;
}

.action-menu-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.action-menu-item--danger {
  color: #dc2626;
}

.action-menu-item--danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.scanner-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.45rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.scanner-video-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 1rem;
  background: radial-gradient(circle at top left, #14213d 0%, #0f172a 50%, #1e293b 100%);
  min-height: 15rem;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.25rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
}

.scanner-placeholder h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

.scanner-placeholder p {
  max-width: 26rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
}

.scanner-placeholder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
}

.scanner-overlay-ring {
  position: absolute;
  inset: 14%;
  border: 2px dashed rgba(255, 255, 255, 0.78);
  border-radius: 1rem;
  pointer-events: none;
}

.scanner-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #334155;
  padding: 0.55rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.scanner-status-pill--success {
  background: #dcfce7;
  color: #166534;
}

.scanner-status-pill--error {
  background: #fee2e2;
  color: #b91c1c;
}

.scanner-tip-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.55rem;
  color: #475569;
  font-size: 0.84rem;
}

.scanner-empty-state {
  min-height: 15rem;
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #fff7f9 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1.5rem;
  color: #64748b;
}

.scanner-empty-state h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
}

.scanner-empty-state p {
  max-width: 28rem;
  font-size: 0.88rem;
}

.scanner-empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  font-size: 1rem;
}

/* Image gallery */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.image-card {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f3f4f6;
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.image-card:hover img {
  transform: scale(1.05);
}

.image-card .delete-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-card:hover .delete-btn {
  opacity: 1;
}

/* Loading spinner */
.spinner {
  border: 3px solid #e5e7eb;
  border-top-color: #e8688a;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast animations */
.toast-enter {
  animation: slideIn 0.3s ease-out;
}

.toast-exit {
  animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Drag and drop upload area */
.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #e8688a;
  background-color: #fef2f4;
}

/* Table styles */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  background: #f9fafb;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.data-table th.text-center,
.data-table td.text-center {
  text-align: center;
}

.data-table tr:hover td {
  background: #f9fafb;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Responsive helpers */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.modal-open {
  overflow: hidden;
}

.modal-panel {
  width: min(100%, 42rem);
  max-height: 90vh;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.modal-panel--wide {
  width: min(100%, 72rem);
}

.modal-panel--image {
  width: auto;
  max-width: 95vw;
  max-height: 95vh;
  margin: 0 auto;
  border-radius: 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

/* ── Image Preview Lightbox ─────────────────────────────── */

.image-preview-root {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  touch-action: none;
}

@media (min-width: 640px) {
  .image-preview-root {
    padding: 0.75rem;
  }
}

.image-preview-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.image-preview-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  transition: background 0.15s;
}

.image-preview-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.image-preview-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  position: relative;
  touch-action: none;
}

.image-preview-viewport:has(.image-preview-fallback) {
  cursor: default;
}

.image-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0 0.25rem;
  flex-shrink: 0;
}

.image-preview-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
}

.image-preview-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.image-preview-toolbar-label {
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 500;
  min-width: 3rem;
  text-align: center;
  user-select: none;
}

.image-preview-img {
  display: block;
  max-width: calc(95vw - 1rem);
  max-height: 75vh;
  object-fit: contain;
  border-radius: 0.75rem;
  user-select: none;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.image-preview-img.is-zoomed {
  cursor: inherit;
}

.image-preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  padding: 3rem;
  text-align: center;
}

.detail-card {
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #ffffff;
  padding: 1rem;
}

.detail-stat-card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.image-grid--detail {
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}

.image-card--detail {
  aspect-ratio: 4 / 3;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.image-empty-state {
  grid-column: 1 / -1;
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: #f8fafc;
  padding: 1.5rem 1rem;
  text-align: center;
  color: #94a3b8;
}

/* Sidebar submenu under Barang */
.nav-sub-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.5rem;
  color: #4b5563;
  background: #ffffff;
  border: 1px solid transparent;
  font-size: 0.72rem;
  line-height: 1rem;
  transition: all 0.2s;
}

.nav-sub-link:hover {
  border-color: #f8a9bb;
  background: #fef7f9;
  color: #952949;
}

.nav-sub-link.active {
  border-color: #f27a95;
  background: #fef2f4;
  color: #b22e52;
  font-weight: 600;
}

@media (max-width: 767px) {
  .data-table th,
  .data-table td {
    padding: 0.625rem 0.75rem;
    white-space: nowrap;
  }

  .table-scroll .data-table {
    min-width: 620px;
  }

  #page-title {
    font-size: 1.125rem;
    line-height: 1.5rem;
  }

  #page-actions {
    width: 100%;
  }

  #page-actions > * {
    width: 100%;
  }

  .page-hero {
    padding: 1rem;
  }

  .summary-grid--compact {
    width: 100%;
    margin-right: 0;
    justify-content: center;
  }

  .toolbar-grid {
    grid-template-columns: 1fr;
  }

  .checkout-history-toolbar {
    grid-template-columns: 1fr;
  }

  .pagination-bar,
  .pagination-controls {
    width: 100%;
    justify-content: flex-start;
  }

  #toast-container {
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
  }

  #toast-container > div {
    width: 100%;
    min-width: 0;
  }

  #modal {
    align-items: flex-end;
  }

  #modal:has(.modal-panel--image) {
    align-items: center;
  }

  .modal-panel {
    width: calc(100% - 1rem);
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .image-grid--detail {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1023px) {
  #items-sidebar-list {
    max-height: 13rem;
  }
}

/* ── Scanner flash feedback ─────────────────────────────── */
.scanner-flash {
  position: absolute;
  inset: 0;
  z-index: 10;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.scanner-flash--success {
  animation: scanFlashSuccess 0.75s ease-out forwards;
}

.scanner-flash--error {
  animation: scanFlashError 0.75s ease-out forwards;
}

@keyframes scanFlashSuccess {
  0%   { background: rgba(34, 197, 94, 0.6); opacity: 1; }
  55%  { background: rgba(34, 197, 94, 0.3); opacity: 1; }
  100% { background: rgba(34, 197, 94, 0);   opacity: 0; }
}

@keyframes scanFlashError {
  0%   { background: rgba(239, 68, 68, 0.6); opacity: 1; }
  55%  { background: rgba(239, 68, 68, 0.3); opacity: 1; }
  100% { background: rgba(239, 68, 68, 0);   opacity: 0; }
}

/* ── Skeleton loader rows ───────────────────────────────── */
.skeleton-cell {
  height: 0.8rem;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 45%, #f1f5f9 90%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Form section grouping headers ─────────────────────── */
.form-section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.form-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.form-field-hint {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #64748b;
}

/* ── Dashboard Overhaul ─────────────────────────────────── */

.dash-greeting-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.75rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3);
}

.dash-greeting-text {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.dash-greeting-subtitle {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  opacity: 0.88;
}

.dash-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dash-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  backdrop-filter: blur(4px);
}

.dash-quick-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dash-quick-btn-primary { background: rgba(255,255,255,0.2); }
.dash-quick-btn-amber { background: rgba(255,255,255,0.15); }
.dash-quick-btn-emerald { background: rgba(255,255,255,0.15); }
.dash-quick-btn-violet { background: rgba(255,255,255,0.15); }
.dash-quick-btn-primary:hover { background: rgba(255,255,255,0.3); }
.dash-quick-btn-amber:hover { background: rgba(255,255,255,0.25); }
.dash-quick-btn-emerald:hover { background: rgba(255,255,255,0.25); }
.dash-quick-btn-violet:hover { background: rgba(255,255,255,0.25); }

/* KPI Cards */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.dash-kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dash-kpi-blue .dash-kpi-icon { background: #eff6ff; color: #3b82f6; }
.dash-kpi-emerald .dash-kpi-icon { background: #ecfdf5; color: #10b981; }
.dash-kpi-violet .dash-kpi-icon { background: #f5f3ff; color: #8b5cf6; }
.dash-kpi-amber .dash-kpi-icon { background: #fffbeb; color: #f59e0b; }
.dash-kpi-red .dash-kpi-icon { background: #fef2f2; color: #ef4444; }

.dash-kpi-body { flex: 1; min-width: 0; }

.dash-kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.dash-kpi-label {
  margin-top: 0.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.dash-kpi-help {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

/* Section Headers */
.dash-section {
  margin-bottom: 1.5rem;
}

.dash-section-header {
  margin-bottom: 1rem;
}

.dash-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-section-title i {
  color: #8b5cf6;
  font-size: 0.95rem;
}

.dash-section-subtitle {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: #64748b;
}

/* Warehouse Cards */
.dash-warehouse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.dash-warehouse-card {
  padding: 1.25rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dash-warehouse-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.dash-warehouse-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dash-warehouse-icon {
  color: #8b5cf6;
  font-size: 0.9rem;
}

.dash-warehouse-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.dash-warehouse-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.dash-warehouse-stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
}

.dash-warehouse-stat-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: #f1f5f9;
  overflow: hidden;
}

.dash-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  transition: width 0.6s ease;
}

/* Dashboard Cards */
.dash-card {
  padding: 1.5rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  margin-bottom: 1.5rem;
}

.dash-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-card-title i {
  color: #8b5cf6;
  font-size: 0.85rem;
}

/* Alert Cards */
.dash-card-alert-danger {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}

.dash-card-alert-warning {
  border-color: #fde68a;
  background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.dash-card-header-alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.dash-alert-count-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 0.4rem;
}

.dash-alert-count-danger { background: #fecaca; color: #b91c1c; }
.dash-alert-count-warning { background: #fde68a; color: #92400e; }

.dash-alert-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.dash-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid transparent;
}

.dash-alert-danger { border-color: #fecaca; }
.dash-alert-warning { border-color: #fde68a; }

.dash-alert-item-info { display: flex; flex-direction: column; min-width: 0; }
.dash-alert-item-name { font-size: 0.82rem; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-alert-item-meta { font-size: 0.72rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-alert-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.dash-alert-badge-danger { background: #fef2f2; color: #dc2626; }
.dash-alert-badge-warning { background: #fffbeb; color: #d97706; }

/* Period Activity */
.dash-period-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.dash-period-stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-period-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  font-size: 0.85rem;
}

.dash-period-stat-green { background: #ecfdf5; color: #10b981; }
.dash-period-stat-amber { background: #fffbeb; color: #f59e0b; }
.dash-period-stat-blue { background: #eff6ff; color: #3b82f6; }

.dash-period-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.dash-period-stat-label {
  font-size: 0.75rem;
  color: #64748b;
}

/* Checkout Destinations */
.dash-dest-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-dest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-radius: 0.65rem;
  background: #f8fafc;
  transition: background 0.15s;
}

.dash-dest-item:hover { background: #f1f5f9; }
.dash-dest-name { font-size: 0.82rem; font-weight: 600; color: #334155; text-transform: capitalize; }
.dash-dest-count { font-size: 0.85rem; font-weight: 700; color: #6366f1; }

/* Timeline */
.dash-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dash-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border-left: 3px solid #e2e8f0;
  transition: background 0.15s;
}

.dash-timeline-item:hover { background: #f1f5f9; }

.dash-timeline-success { border-left-color: #10b981; }
.dash-timeline-warning { border-left-color: #f59e0b; }
.dash-timeline-error { border-left-color: #ef4444; }

.dash-timeline-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.dash-timeline-success .dash-timeline-icon { background: #ecfdf5; color: #10b981; }
.dash-timeline-warning .dash-timeline-icon { background: #fffbeb; color: #f59e0b; }
.dash-timeline-error .dash-timeline-icon { background: #fef2f2; color: #ef4444; }

.dash-timeline-content { min-width: 0; }

.dash-timeline-message {
  font-size: 0.82rem;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-timeline-meta {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

/* ── Catalog Image Upload ───────────────────────────────── */

.catalog-image-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 2px dashed #d1d5db;
  border-radius: 0.85rem;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 120px;
}

.catalog-image-upload-zone:hover,
.catalog-image-upload-zone.dragover {
  border-color: #8b5cf6;
  background: #f5f3ff;
}

.catalog-image-upload-zone i {
  font-size: 1.5rem;
  color: #94a3b8;
}

.catalog-image-upload-zone:hover i {
  color: #8b5cf6;
}

.catalog-image-upload-zone p {
  font-size: 0.8rem;
  color: #64748b;
}

.catalog-image-preview {
  position: relative;
  display: inline-block;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.catalog-image-preview.hidden {
  display: none;
}

.catalog-image-preview img {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
}

.catalog-image-preview-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.catalog-image-preview-actions button {
  flex: 1;
  padding: 0.35rem;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  transition: background 0.15s;
  border: none;
  background: transparent;
  cursor: pointer;
}

.catalog-image-preview-actions button:hover {
  background: rgba(255,255,255,0.15);
}

.catalog-thumb {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.catalog-thumb:hover {
  transform: scale(1.1);
}

.catalog-thumb-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 0.9rem;
  border: 1px solid #e5e7eb;
}
