/* Detail Drawer Modal Styles */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85vw;
  max-width: 1400px;
  background: #0f172a;
  border-left: 1px solid var(--border-color);
  z-index: 210;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #131d35;
}

.drawer-heading-group h3 {
  font-size: 1.3rem;
  font-weight: 800;
}

.drawer-badge {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.25rem;
}

.drawer-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-close-drawer {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-close-drawer:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.drawer-scroll-body {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.drawer-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.drawer-summary-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}
.drawer-summary-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.drawer-summary-item strong {
  display: block;
  font-size: 1.25rem;
  font-family: var(--font-mono);
  color: #fff;
  margin-top: 0.2rem;
}

.drawer-ws-pills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.drawer-pill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}
.drawer-pill-card h5 {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}
.drawer-pill-card .val {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  margin: 0.25rem 0;
}

.product-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.product-block-header {
  padding: 0.85rem 1.25rem;
  background: #172033;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.prod-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.subassembly-row {
  background: rgba(99, 102, 241, 0.08);
  font-weight: 700;
  color: #a5b4fc;
}

@media (max-width: 900px) {
  .detail-drawer {
    width: 100vw;
  }
}

/* Generic Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none !important;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.show {
  display: flex !important;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.modal-card.modal-lg {
  max-width: 800px;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e293b;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 1.25rem;
  color: #e2e8f0;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #f1f5f9;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.form-control:disabled {
  background: #0f172a;
  color: #64748b;
  cursor: not-allowed;
}

.btn-action-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

