/* catalog-detail.css — issue grid, LEGO cards, shared modal forms, toast.
   Companion to catalog.css; same admin-base palette. */

/* ---- series detail / issue grid ---- */
.cat-detail { padding: 6px 0 10px; }
.cat-detail-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cat-detail-count { font-size: 12px; font-weight: 600; color: #5a6172; }
.cat-detail-empty, .cat-detail-err { font-size: 12px; color: #8a93a6; padding: 8px 0; }
.cat-detail-err { color: #7a1e16; }

.cat-gap { font-size: 12px; color: #7a4d00; background: #fff4e0; border: 1px solid #f4c87a;
  border-radius: 6px; padding: 6px 10px; margin-bottom: 10px; }
.cat-gap.is-complete { color: #1d6f3f; background: #ecf7f0; border-color: #bfe3cd; }

.cat-issue-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-issue {
  position: relative; display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; user-select: none; border: 1px solid; transition: transform .08s, box-shadow .12s;
}
.cat-issue:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(15, 17, 23, .1); }
.cat-issue.is-owned   { background: #2945d6; border-color: #2945d6; color: #fff; }
.cat-issue.is-missing { background: #fff; border-color: #c9cdd9; color: #8a93a6; border-style: dashed; }
.cat-issue.is-busy { opacity: .5; pointer-events: none; }
.cat-issue-label { line-height: 1.2; }
.cat-issue-edit {
  background: transparent; border: none; padding: 0 0 0 2px; font-size: 11px; line-height: 1;
  color: inherit; opacity: .6;
}
.cat-issue-edit:hover { opacity: 1; }

/* ---- LEGO grid ---- */
.cat-lego-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
  padding: 14px;
}
.cat-lego-card {
  background: #fff; border: 1px solid #d9dce6; border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 8px rgba(15, 17, 23, .04);
}
.cat-lego-img {
  margin: -4px -4px 2px; height: 150px; border-radius: 8px; background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cat-lego-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.cat-lego-meta { font-size: 12px; color: #5a6172; }
.cat-lego-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cat-lego-theme { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #5a6172; }
.cat-lego-retired {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: #7a1e16; background: #fde2e0; border: 1px solid #f3b8b2; border-radius: 9px; padding: 1px 7px;
}
.cat-lego-name { font-size: 14px; font-weight: 600; color: #1a1d26; line-height: 1.3; }
.cat-lego-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #5a6172; }
.cat-lego-id { font-family: "SF Mono", Monaco, Menlo, monospace; font-size: 11px; color: #3a4154;
  background: #eef0f7; border-radius: 3px; padding: 1px 5px; }
.cat-lego-qty { font-weight: 700; color: #2945d6; }
.cat-lego-status { font-size: 11px; color: #8a93a6; text-transform: capitalize; }
.cat-lego-price { font-size: 12px; color: #1d6f3f; font-weight: 600; }
.cat-lego-notes { font-size: 12px; color: #8a93a6; line-height: 1.4; }
.cat-lego-foot { margin-top: 2px; }
.cat-lego-foot .cat-lego-edit { padding: 5px 12px; font-size: 12px; }

/* ---- modal ---- */
.cat-modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 17, 23, .42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; z-index: 100; overflow-y: auto;
}
.cat-modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 440px;
  box-shadow: 0 12px 40px rgba(15, 17, 23, .22); overflow: hidden;
}
.cat-modal-sm { max-width: 380px; }
.cat-modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #eef0f4; }
.cat-modal-head h3 { font-size: 16px; font-weight: 600; color: #0f1117; }
.cat-modal-x { background: transparent; border: none; font-size: 18px; line-height: 1; color: #8a93a6; padding: 0 4px; display: inline-flex; align-items: center; }
.cat-modal-x .ph { font-size: 18px; line-height: 1; }
.cat-modal-x:hover { color: #1a1d26; }
.cat-modal-form { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.cat-modal-body { padding: 20px 18px 8px; font-size: 14px; color: #3a4154; line-height: 1.5; }
.cat-field { display: flex; flex-direction: column; gap: 4px; }
.cat-field > span { font-size: 12px; font-weight: 600; color: #5a6172; }
.cat-field input, .cat-field select, .cat-field textarea { width: 100%; }
.cat-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #3a4154; cursor: pointer; }
.cat-check input { width: auto; }
.cat-modal-err { font-size: 12px; color: #7a1e16; background: #fde2e0; border: 1px solid #f3b8b2;
  border-radius: 6px; padding: 7px 10px; }
.cat-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 18px; border-top: 1px solid #eef0f4; }

/* ---- toast ---- */
.cat-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: #1a1d26; color: #fff; font-size: 13px; font-weight: 500;
  padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(15, 17, 23, .28);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; max-width: 90vw;
}
.cat-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.cat-toast.is-error { background: #7a1e16; }
