/*
 * 文件作用：
 * ipetmed 会员中心（/my-account/ 及其子页）浅色主题 + 仪表盘统计卡片样式。
 * 配套 pmgr-account-dashboard.php，只在账户页加载。
 *
 * 背景取和分类页一样的高级灰 #eaecf0，左侧导航和内容区做成白卡片，
 * 文字改深色；原来 wc.css 里的红色激活/悬停/按钮规则保留不动
 * （本文件里导航链接的选择器特意写得比那些规则"弱"，不会盖掉红色激活态）。
 */

/* ── 1. 整页浅色 ───────────────────────────────────────── */

body.pmgr-site-page.woocommerce-account {
  background: #eaecf0 !important;
  color: #1b1f24;
}

body.pmgr-site-page.woocommerce-account .ct-container-full {
  padding-top: 28px !important;
  padding-bottom: 48px !important;
}

/* 左侧导航：白卡片 */
.woocommerce-MyAccount-navigation {
  background: #ffffff;
  border: 1px solid #d9dde3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 24, 32, 0.05);
}

.woocommerce-MyAccount-navigation ul li a {
  color: #1b1f24 !important;
  background: #ffffff !important;
  border-bottom: 1px solid #eceef2 !important;
}

.woocommerce-MyAccount-navigation ul li:last-child a {
  border-bottom: 0 !important;
}

/* 右侧内容区：白卡片，深色文字 */
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content {
  background: #ffffff;
  border: 1px solid #d9dde3;
  border-radius: 10px;
  padding: 24px 28px;
  box-shadow: 0 1px 2px rgba(20, 24, 32, 0.05);
}

body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content p,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content li,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content td,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content th,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content label,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content h2,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content h3,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content h4,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content legend,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content address {
  color: #1b1f24 !important;
}

/* 表格（订单列表、下载列表）：浅灰表头、细分隔线 */
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content table {
  background: #ffffff;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px;
}

body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content table th {
  background: #f5f6f8 !important;
}

body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content table td,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content table th {
  border-color: #e5e7eb !important;
}

/* 表单控件：白底深字 */
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content select,
body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content textarea {
  background: #ffffff !important;
  color: #1b1f24 !important;
  border: 1px solid #d9dde3 !important;
}

/* 未登录时的登录/注册表单区也走浅色 */
body.pmgr-site-page.woocommerce-account .woocommerce > .woocommerce-form-login,
body.pmgr-site-page.woocommerce-account .woocommerce > .u-columns,
body.pmgr-site-page.woocommerce-account .woocommerce > .woocommerce-ResetPassword {
  background: #ffffff;
  border: 1px solid #d9dde3;
  border-radius: 10px;
  padding: 24px 28px;
  color: #1b1f24;
}

/* ── 2. 仪表盘 ─────────────────────────────────────────── */

.pmgr-ad {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 待办提醒条 */
.pmgr-ad-todos {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pmgr-ad-todo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff7f8;
  border: 1px solid #f3c2ca;
  border-left: 4px solid var(--pmgr-red, #C8102E);
  border-radius: 8px;
  font-size: 14px;
}

.pmgr-ad-todo a {
  white-space: nowrap;
  font-weight: 600;
}

/* 统计块：一排四个，手机两个 */
.pmgr-ad-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.pmgr-ad-stat {
  background: #f5f6f8;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 18px;
  min-width: 0;
}

.pmgr-ad-stat__label {
  font-size: 13px;
  color: #6b7280 !important;
  margin-bottom: 6px;
}

.pmgr-ad-stat__value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: #1b1f24 !important;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.pmgr-ad-stat__value .woocommerce-Price-amount,
.pmgr-ad-stat__value .woocommerce-Price-currencySymbol {
  color: var(--pmgr-red, #C8102E) !important;
}

.pmgr-ad-stat__sub {
  font-size: 12px;
  color: #6b7280 !important;
  margin-top: 6px;
}

/* 两栏：最近订单 / 会员身份 */
.pmgr-ad-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.9fr);
  gap: 18px;
}

.pmgr-ad-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 20px;
  background: #ffffff;
  min-width: 0;
}

.pmgr-ad-card h3 {
  font-size: 16px !important;
  font-weight: 600;
  margin: 0 0 14px !important;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.pmgr-ad-more {
  font-size: 13px;
  font-weight: 400;
}

.pmgr-ad-empty {
  color: #6b7280 !important;
  font-size: 14px;
  margin: 0;
}

/* 最近订单表 */
.pmgr-ad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 0 !important;
}

.pmgr-ad-table th,
.pmgr-ad-table td {
  padding: 9px 8px !important;
  border: 0 !important;
  border-bottom: 1px solid #eceef2 !important;
  text-align: left;
  background: transparent !important;
}

.pmgr-ad-table th {
  font-size: 12px;
  color: #6b7280 !important;
  font-weight: 500;
}

.pmgr-ad-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pmgr-ad-status {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef0f3;
  color: #1b1f24 !important;
}

.pmgr-ad-status--pending   { background: #fff4e5; color: #b45309 !important; }
.pmgr-ad-status--on-hold   { background: #fff4e5; color: #b45309 !important; }
.pmgr-ad-status--processing{ background: #e6f2ff; color: #1d4ed8 !important; }
.pmgr-ad-status--completed { background: #e7f6ec; color: #0f7b3d !important; }
.pmgr-ad-status--cancelled,
.pmgr-ad-status--refunded,
.pmgr-ad-status--failed    { background: #f3f4f6; color: #6b7280 !important; }

/* 会员身份卡 */
.pmgr-ad-member__type {
  font-size: 20px;
  font-weight: 700;
  color: var(--pmgr-red, #C8102E) !important;
}

.pmgr-ad-member__status,
.pmgr-ad-member__who {
  font-size: 13px;
  color: #6b7280 !important;
  margin-top: 4px;
}

.pmgr-ad-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.pmgr-ad-links a {
  display: block;
  padding: 9px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  color: #1b1f24 !important;
  background: #f9fafb;
}

.pmgr-ad-links a:hover {
  border-color: var(--pmgr-red, #C8102E);
  color: var(--pmgr-red, #C8102E) !important;
}

/* 已采购产品 */
.pmgr-ad-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pmgr-ad-product {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}

.pmgr-ad-product__img {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pmgr-ad-product__img img {
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

.pmgr-ad-product__body { min-width: 0; }

.pmgr-ad-product__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #1b1f24 !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pmgr-ad-product__meta {
  font-size: 12px;
  color: #6b7280 !important;
  margin-top: 4px;
}

.pmgr-ad-product__link {
  font-size: 12px;
  display: inline-block;
  margin-top: 4px;
}

/* 最近下载 */
.pmgr-ad-dl {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pmgr-ad-dl li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #eceef2;
  font-size: 14px;
}

.pmgr-ad-dl li:last-child { border-bottom: 0; }

.pmgr-ad-dl__meta {
  color: #6b7280 !important;
  font-size: 12px;
  white-space: nowrap;
}

/* ── 3. 响应式 ─────────────────────────────────────────── */

@media (max-width: 900px) {
  .pmgr-ad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pmgr-ad-grid { grid-template-columns: 1fr; }
  .pmgr-ad-products { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .pmgr-ad-products { grid-template-columns: 1fr; }
  body.pmgr-site-page.woocommerce-account .woocommerce-MyAccount-content { padding: 16px; }
  .pmgr-ad-table th:nth-child(2), .pmgr-ad-table td:nth-child(2) { display: none; }
}

/* ── 4. 各功能模块共用：状态标签、行内统计、列表、提示条 ─────── */

.pmgr-ac-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
  background: #eef0f3;
  color: #1b1f24 !important;
}
.pmgr-ac-badge--ok     { background: #e7f6ec; color: #0f7b3d !important; }
.pmgr-ac-badge--warn   { background: #fff4e5; color: #b45309 !important; }
.pmgr-ac-badge--info   { background: #e6f2ff; color: #1d4ed8 !important; }
.pmgr-ac-badge--danger { background: #fde8ec; color: var(--pmgr-red, #C8102E) !important; }
.pmgr-ac-badge--muted  { background: #f3f4f6; color: #6b7280 !important; }

.pmgr-ad-inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 13px;
  color: #6b7280 !important;
  margin-bottom: 12px;
}
.pmgr-ad-inline-stats b { color: #1b1f24 !important; font-size: 15px; }
.pmgr-ad-inline-stats b.is-warn { color: #b45309 !important; }
.pmgr-ad-inline-stats b.is-danger { color: var(--pmgr-red, #C8102E) !important; }

.pmgr-ad-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pmgr-ad-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #eceef2;
  font-size: 14px;
}
.pmgr-ad-list li:last-child { border-bottom: 0; }
.pmgr-ad-list__main { min-width: 0; }
.pmgr-ad-list__main small { display: block; color: #6b7280 !important; font-size: 12px; margin-top: 2px; }
.pmgr-ad-list__side { white-space: nowrap; font-size: 13px; color: #6b7280 !important; }
.pmgr-prc-member { color: var(--pmgr-red, #C8102E) !important; }

.pmgr-ac-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin: 0 0 16px;
  background: #eef0f3;
}
.pmgr-ac-msg--ok     { background: #e7f6ec; color: #0f7b3d !important; }
.pmgr-ac-msg--warn   { background: #fff4e5; color: #b45309 !important; }
.pmgr-ac-msg--info   { background: #e6f2ff; color: #1d4ed8 !important; }
.pmgr-ac-msg--danger { background: #fde8ec; color: var(--pmgr-red, #C8102E) !important; }

.pmgr-ac-title { margin: 0 0 16px !important; font-size: 20px !important; }
.pmgr-ac-page .pmgr-ad-card { margin-bottom: 16px; }
.pmgr-ac-linkbtn {
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  color: var(--pmgr-red, #C8102E) !important;
  cursor: pointer;
  font-size: 13px;
}
.pmgr-dev-note td { padding-top: 0 !important; color: #6b7280 !important; }

/* 发票抬头表单 */
.pmgr-inv-form .form-row { margin: 0 0 12px; }
.pmgr-inv-form label { display: block; font-size: 13px; color: #6b7280 !important; margin-bottom: 4px; }
.pmgr-inv-form input { width: 100%; max-width: 420px; }

/* 公告 */
.pmgr-ntc { padding: 16px 0; border-bottom: 1px solid #eceef2; }
.pmgr-ntc:last-child { border-bottom: 0; }
.pmgr-ntc__title { font-size: 16px !important; margin: 0 !important; }
.pmgr-ntc__date { font-size: 12px; color: #6b7280 !important; margin: 4px 0 10px; }
.pmgr-ntc__body { font-size: 14px; line-height: 1.7; }

/* 月度趋势柱状图 */
.pmgr-ad-trend {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  height: 140px;
  align-items: end;
}
.pmgr-ad-trend__col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.pmgr-ad-trend__bar {
  background: linear-gradient(180deg, #E13349 0%, var(--pmgr-red, #C8102E) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 0;
  transition: height .3s;
}
.pmgr-ad-trend__label { font-size: 11px; color: #6b7280 !important; text-align: center; margin-top: 6px; white-space: nowrap; }
@media (max-width: 560px) {
  .pmgr-ad-trend__label { font-size: 9px; }
}
