.admin-member-insights-section { display: flex !important; flex-direction: column; }
.admin-member-insights-section > header { order: -2; }
.admin-member-insights-section > .admin-empty { order: 10000; }

.admin-member-insights-controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) 1fr;
  align-items: end;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}

.admin-member-insights-controls label { display: grid; gap: 5px; }
.admin-member-insights-controls label > span { color: var(--ddr-muted, #666670); font-size: 11px; font-weight: 750; }
.admin-member-insights-controls select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--ddr-border, #dedee3);
  border-radius: 8px;
  background: var(--ddr-surface, #fff);
  color: var(--ddr-ink, #17171a);
  font-size: 12px;
  font-weight: 750;
}
.admin-member-filter-count { justify-self: end; padding-bottom: 10px; color: var(--ddr-muted, #666670); font-size: 11px; }
.admin-member-insight-card { cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.admin-member-insight-card:hover { transform: translateY(-1px); border-color: #ef334f !important; box-shadow: 0 6px 18px rgba(15, 15, 18, .08); }
.admin-member-insight-card:focus-visible { outline: 2px solid #ef334f; outline-offset: 2px; }

.admin-member-modal-open { overflow: hidden; }
.admin-member-orders-modal[hidden] { display: none; }
.admin-member-orders-modal { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 20px; }
.admin-member-orders-backdrop { position: absolute; inset: 0; background: rgba(8, 8, 10, .62); backdrop-filter: blur(3px); }
.admin-member-orders-modal > section {
  position: relative;
  width: min(860px, 100%);
  max-height: min(820px, calc(100dvh - 40px));
  overflow: auto;
  border: 1px solid var(--ddr-border, #dedee3);
  border-radius: 12px;
  background: var(--ddr-surface, #fff);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.admin-member-orders-close { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--ddr-border, #dedee3); border-radius: 6px; background: var(--ddr-surface-2, #f4f4f6); color: var(--ddr-ink, #17171a); font-size: 24px; line-height: 1; }
.admin-member-orders-content { padding: 24px; }
.admin-member-orders-content > header { padding-right: 46px; }
.admin-member-orders-content > header span { color: #d91f3a; font-size: 10px; font-weight: 850; letter-spacing: .6px; }
.admin-member-orders-content > header h2 { margin-top: 3px; color: var(--ddr-ink, #17171a); font-size: 22px; }
.admin-member-orders-content > header p { margin-top: 3px; color: var(--ddr-muted, #666670); font-size: 12px; overflow-wrap: anywhere; }
.admin-member-order-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.admin-member-order-summary article { padding: 13px 15px; border: 1px solid var(--ddr-border, #dedee3); border-radius: 8px; background: var(--ddr-surface-2, #f4f4f6); }
.admin-member-order-summary span { display: block; color: var(--ddr-muted, #666670); font-size: 10px; font-weight: 700; }
.admin-member-order-summary strong { display: block; margin-top: 3px; color: var(--ddr-ink, #17171a); font-size: 17px; }
.admin-member-orders-list { display: grid; gap: 8px; }
.admin-member-order-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--ddr-border, #dedee3); border-radius: 8px; background: var(--ddr-surface, #fff); }
.admin-member-order-image { display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden; border-radius: 7px; background: var(--ddr-surface-2, #f4f4f6); color: #d91f3a; font-weight: 900; }
.admin-member-order-image img { width: 100%; height: 100%; object-fit: contain; }
.admin-member-order-main { min-width: 0; }
.admin-member-order-main > div { display: flex; align-items: flex-start; gap: 8px; }
.admin-member-order-main strong { min-width: 0; overflow: hidden; color: var(--ddr-ink, #17171a); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.admin-member-order-main small, .admin-member-order-main time { display: block; margin-top: 3px; color: var(--ddr-muted, #666670); font-size: 10px; }
.member-order-status { flex: 0 0 auto; padding: 2px 6px; border-radius: 5px; background: var(--ddr-surface-2, #f4f4f6); color: var(--ddr-muted, #666670); font-size: 9px; font-weight: 800; }
.member-order-status.completed { background: rgba(16, 185, 129, .12); color: #059669; }
.member-order-status.pending { background: rgba(245, 158, 11, .14); color: #b66a00; }
.member-order-status.canceled { background: rgba(239, 68, 68, .12); color: #dc2626; }
.admin-member-order-money { text-align: right; white-space: nowrap; }
.admin-member-order-money strong { display: block; color: var(--ddr-ink, #17171a); font-size: 12px; }
.admin-member-order-money span { display: block; margin-top: 3px; color: #059669; font-size: 10px; font-weight: 750; }
.admin-member-orders-loading, .admin-member-orders-error, .admin-member-orders-empty { padding: 48px 20px; color: var(--ddr-muted, #666670); text-align: center; }
.admin-member-orders-error { color: #dc2626; }

@media (max-width: 640px) {
  .admin-member-insights-section {
    height: auto !important;
    max-height: none !important;
    align-items: stretch !important;
    overflow: visible !important;
  }
  .admin-member-insights-section > article.admin-member-insight-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    flex: 0 0 auto !important;
    min-height: 0 !important;
    height: auto !important;
    gap: 12px !important;
    padding: 16px !important;
  }
  .admin-member-insight-card .queue-main {
    min-width: 0 !important;
    gap: 6px !important;
  }
  .admin-member-insight-card .queue-main h3,
  .admin-member-insight-card .queue-main p,
  .admin-member-insight-card .queue-main small {
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    overflow-wrap: anywhere;
  }
  .admin-member-insight-card .admin-member-metrics {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--ddr-border, #dedee3) !important;
  }
  .admin-member-insight-card .admin-member-metrics > div {
    min-width: 0 !important;
    padding: 6px 10px !important;
    text-align: center;
  }
  .admin-member-insight-card .admin-member-metrics > div:first-child {
    border-left: 0 !important;
  }
  .admin-member-insights-controls { grid-template-columns: 1fr 1fr; }
  .admin-member-filter-count { grid-column: 1 / -1; justify-self: start; padding: 0; }
  .admin-member-orders-modal { align-items: end; padding: 0; }
  .admin-member-orders-modal > section { width: 100%; max-height: 90dvh; border-radius: 12px 12px 0 0; }
  .admin-member-orders-content { padding: 20px 14px; }
  .admin-member-order-summary { gap: 6px; }
  .admin-member-order-summary article { padding: 10px; }
  .admin-member-order-summary strong { font-size: 14px; }
  .admin-member-order-row { grid-template-columns: 48px minmax(0, 1fr); }
  .admin-member-order-image { width: 48px; height: 48px; }
  .admin-member-order-money { grid-column: 2; display: flex; justify-content: space-between; text-align: left; }
}
