/* Stock opname — tabel, filter, progress */
.opname-draft-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.opname-draft-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background: var(--bg-card, #1e2333);
  color: var(--text-primary, #f0f2f8);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.opname-draft-card:hover,
.opname-draft-card.is-active {
  border-color: var(--accent, #f5c518);
  background: var(--accent-dim, rgba(245, 197, 24, 0.08));
}
.opname-draft-card b { font-size: 14px; }
.opname-draft-card .opname-draft-meta {
  font-size: 12px;
  color: var(--text-muted, #8a93b0);
  margin-top: 4px;
  line-height: 1.45;
}
.opname-draft-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.opname-draft-badge--draft { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.opname-draft-badge--submitted { background: rgba(34, 197, 94, 0.15); color: #86efac; }

.opname-meta {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-elevated, #2a3045);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.opname-meta strong { color: var(--text-primary); }

.opname-workspace { margin-top: 14px; }
.opname-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.opname-toolbar input,
.opname-toolbar select {
  flex: 1;
  min-width: 140px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
}
.opname-toolbar #opnameScan { flex: 1.2; min-width: 180px; border-color: rgba(245, 197, 24, 0.35); }
.opname-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent);
  cursor: pointer;
}
.opname-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.opname-filter-chip {
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.opname-filter-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.opname-progress-wrap { margin-bottom: 10px; }
.opname-progress-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.opname-progress-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.opname-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #22c55e, var(--accent, #f5c518));
  transition: width 0.25s ease;
  width: 0%;
}

.opname-save-status {
  font-size: 11px;
  color: var(--text-muted);
  min-height: 16px;
  margin-bottom: 8px;
}
.opname-save-status.is-saving { color: var(--accent); }
.opname-save-status.is-err { color: #f87171; }
.opname-save-status.is-ok { color: #86efac; }

.opname-table-scroll {
  max-height: min(70vh, 640px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.opname-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.opname-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-elevated, #2a3045);
  text-align: left;
  padding: 10px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.opname-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.opname-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.opname-table tbody tr.is-highlight {
  animation: opname-flash 1.2s ease;
}
@keyframes opname-flash {
  0%, 100% { background: transparent; }
  30% { background: rgba(245, 197, 24, 0.2); }
}
.opname-prod-name { font-weight: 600; }
.opname-prod-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}
.opname-qty-inp {
  width: 72px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}
.opname-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.opname-badge--ok { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.opname-badge--minus { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.opname-badge--plus { background: rgba(245, 197, 24, 0.2); color: #fde047; }

.opname-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.opname-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 15000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  isolation: isolate;
}
.opname-modal-backdrop.is-open {
  display: flex !important;
  pointer-events: auto;
}
.opname-modal-backdrop[hidden] {
  display: none !important;
  pointer-events: none !important;
}
.opname-modal-box {
  width: min(420px, 100%);
  max-height: min(90vh, 720px);
  overflow-y: auto;
  padding: 20px;
  border-radius: 12px;
  background: var(--bg-card, #1e2333);
  border: 1px solid var(--border);
  pointer-events: auto;
  position: relative;
  z-index: 15001;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
.opname-modal-actions .ep-btn {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
body.opname-modal-open .page-wrap {
  pointer-events: none;
}
body.opname-modal-open .topbar,
body.opname-modal-open .sidebar {
  pointer-events: none;
}
.opname-modal-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
}
.opname-modal-box p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 12px;
}
.opname-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.opname-summary-item {
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  font-size: 12px;
}
.opname-summary-item b { display: block; font-size: 18px; margin-top: 4px; }
.opname-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

@media (max-width: 560px) {
  .opname-table thead th:nth-child(6),
  .opname-table tbody td:nth-child(6) { display: none; }
  .opname-qty-inp { width: 60px; }
}
