/* =========================================================
   PURCHASE DETAIL MODULE STYLES
   File: assets/css/purchase-detail.css
   Main styles remain scoped in purchase.css; use this file for future reusable purchase-detail-only changes.
   ========================================================= */
.purchase-detail-page { --detail-accent: #6d5dfc; }

/* =========================================================
   PURCHASE DETAIL SERIAL VIEWER MODAL V30
   Scope: purchase detail page only
   ========================================================= */
.purchase-detail-page .purchase-serial-description {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.purchase-detail-page .purchase-serial-preview {
  display: inline;
}

.purchase-detail-page .purchase-serial-more {
  appearance: none;
  border: 0;
  background: #eef2ff;
  color: #4f46e5;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.purchase-detail-page .purchase-serial-more:hover {
  background: #e0e7ff;
  color: #3730a3;
}

.purchase-detail-page .purchase-serial-more:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.purchase-detail-page .purchase-serial-viewer[hidden] {
  display: none;
}

.purchase-detail-page .purchase-serial-viewer {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.purchase-detail-page .purchase-serial-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
}

.purchase-detail-page .purchase-serial-viewer-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(600px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.3);
}

.purchase-detail-page .purchase-serial-viewer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.purchase-detail-page .purchase-serial-viewer-head h2 {
  margin: 5px 0 4px;
  color: #0f172a;
  font-size: 20px;
}

.purchase-detail-page .purchase-serial-viewer-head p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.purchase-detail-page .purchase-serial-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
}

.purchase-detail-page .purchase-serial-viewer-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 16px 22px;
}

.purchase-detail-page .purchase-serial-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.purchase-detail-page .purchase-serial-list-head strong {
  color: #0f172a;
}

.purchase-detail-page .purchase-full-serial-list {
  min-height: 80px;
  max-height: min(440px, calc(100vh - 270px));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 4px;
}

.purchase-detail-page .purchase-full-serial-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.purchase-detail-page .purchase-full-serial-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 13px;
}

.purchase-detail-page .purchase-full-serial-row span {
  color: #94a3b8;
  font-size: 12px;
}

.purchase-detail-page .purchase-full-serial-row strong {
  word-break: break-all;
  font-weight: 600;
}

.purchase-detail-page .purchase-serial-viewer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid #e2e8f0;
}

body.purchase-serial-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .purchase-detail-page .purchase-serial-viewer {
    padding: 12px;
  }

  .purchase-detail-page .purchase-serial-viewer-footer {
    flex-direction: column-reverse;
  }

  .purchase-detail-page .purchase-serial-viewer-footer .btn {
    width: 100%;
  }
}

@media print {
  .purchase-detail-page .purchase-serial-more,
  .purchase-detail-page .purchase-serial-viewer {
    display: none !important;
  }
}
