/* V3.7 Catalog + image-fit polish. Loaded last so it only fixes catalog presentation. */
:root{--v37-card:#fff;--v37-line:#e3e9f2;--v37-soft:#f7f9fc}

/* Keep large catalogs readable: 2 columns on desktop, 1 on tablet/mobile. */
.plans-wrap,
body[data-theme-pack="blue"] .plans-wrap,
body[data-theme-pack="gold"] .plans-wrap{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:16px!important;
}
.fund-list,
body[data-theme-pack="blue"] .fund-list,
body[data-theme-pack="gold"] .fund-list{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:16px!important;
}

/* Never crop uploaded/default plan and product artwork. */
.plan-logo.plan-photo,
.fund-card .plan-logo.plan-photo,
.small-logo.plan-photo{
  background:var(--v37-soft)!important;
  border:1px solid var(--v37-line)!important;
  overflow:hidden!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:8px!important;
}
.plan-photo-img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  object-position:center center!important;
  max-width:100%!important;
  max-height:100%!important;
}

/* Product cards get a stable, uncropped visual area. */
body[data-theme-pack="blue"] .fund-card,
body[data-theme-pack="gold"] .fund-card{
  min-height:330px!important;
  display:flex!important;
  flex-direction:column!important;
}
body[data-theme-pack="blue"] .fund-card .plan-logo,
body[data-theme-pack="gold"] .fund-card .plan-logo{
  width:100%!important;
  height:138px!important;
  min-height:138px!important;
  border-radius:14px!important;
  margin:0 0 10px!important;
}
body[data-theme-pack="blue"] .fund-card .fund-center,
body[data-theme-pack="gold"] .fund-card .fund-center{
  flex:1!important;
}
body[data-theme-pack="blue"] .fund-card .fund-bottom,
body[data-theme-pack="gold"] .fund-card .fund-bottom{
  margin-top:auto!important;
  grid-column:auto!important;
  width:100%!important;
}

/* VIP images remain fully visible too. */
body[data-theme-pack="blue"] .plan-card .plan-logo,
body[data-theme-pack="gold"] .plan-card .plan-logo{
  flex:0 0 auto;
}

/* Admin thumbnails should show the whole image, not crop it. */
.admin-table-plan-img{
  object-fit:contain!important;
  object-position:center!important;
  padding:4px!important;
  background:#fff!important;
}
.plan-view-preview img,
.admin-image-picker img{
  object-fit:contain!important;
  object-position:center!important;
  background:#f8fafc!important;
}

/* Slightly stronger catalog hierarchy for 10+ items. */
.plan-card,.fund-card{transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.plan-card:hover,.fund-card:hover{border-color:color-mix(in srgb,var(--pack-primary,#2563eb) 24%,#dfe6ef)!important}
.plan-title{letter-spacing:-.01em}
.plan-days,.plan-rate-badge{white-space:nowrap}

/* Better mobile density while preserving artwork. */
@media(max-width:900px){
  .plans-wrap,.fund-list,
  body[data-theme-pack="blue"] .plans-wrap,
  body[data-theme-pack="gold"] .plans-wrap,
  body[data-theme-pack="blue"] .fund-list,
  body[data-theme-pack="gold"] .fund-list{grid-template-columns:1fr!important}
  body[data-theme-pack="blue"] .fund-card .plan-logo,
  body[data-theme-pack="gold"] .fund-card .plan-logo{height:128px!important;min-height:128px!important}
}
@media(max-width:520px){
  .plan-logo.plan-photo,.fund-card .plan-logo.plan-photo{padding:6px!important}
  body[data-theme-pack="blue"] .fund-card,
  body[data-theme-pack="gold"] .fund-card{min-height:300px!important}
  body[data-theme-pack="blue"] .fund-card .plan-logo,
  body[data-theme-pack="gold"] .fund-card .plan-logo{height:118px!important;min-height:118px!important}
}

/* Admin V3.7 utility polish */
.admin-top-search{border:1px solid #d9e3f0;background:#fff;color:#334155;border-radius:10px;padding:7px 10px;font-weight:800;font-size:12px;box-shadow:0 5px 16px rgba(15,23,42,.05)}
.admin-top-search:hover{border-color:#b8cdf7;color:#1d4ed8}
.system-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:18px 0}
.system-card{border:1px solid #e3e9f2;background:#f8fafc;border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:5px}
.system-card small{color:#64748b;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.system-card strong{font-size:24px;color:#0f172a}.system-card span{font-size:12px;color:#64748b}
.system-action{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid #dce6f4;background:#fff;border-radius:16px;padding:18px;margin:16px 0}
.system-action p{margin:5px 0 0;color:#64748b;font-size:13px}
@media(max-width:1000px){.system-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.system-grid{grid-template-columns:1fr}.system-action{align-items:stretch;flex-direction:column}.admin-top-search{padding:6px 8px;font-size:11px}}
.global-search-row{width:100%;display:grid;grid-template-columns:92px 1fr;gap:3px 12px;text-align:left;border:1px solid #e3e9f2;background:#fff;border-radius:12px;padding:12px 14px;margin:8px 0;color:#0f172a}
.global-search-row:hover{border-color:#b9cdf6;background:#f8fbff}.global-search-row>span{grid-row:1/3;color:#2563eb;font-size:11px;font-weight:900;text-transform:uppercase;align-self:center}.global-search-row>b{font-size:14px}.global-search-row>small{color:#64748b}
