.hd-app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; background: var(--hd-bg-body); }
.hd-app-sidebar { background: var(--hd-bg-card); border-inline-end: var(--hd-border); padding: var(--hd-space-3); display: flex; flex-direction: column; gap: var(--hd-space-4); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.hd-sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.hd-sidebar-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--hd-radius-sm); color: var(--hd-text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; transition: background var(--hd-transition), color var(--hd-transition); }
.hd-sidebar-link:hover { background: var(--hd-graphite); color: var(--hd-text-primary); }
.hd-sidebar-link--active { background: var(--hd-graphite); color: var(--hd-gold); }
.hd-sidebar-link--active svg { color: var(--hd-gold); }
.hd-sidebar-link--soon { opacity: .5; cursor: default; }
.hd-sidebar-link--soon:hover { background: none; color: var(--hd-text-secondary); }
.hd-sidebar-link__count { margin-inline-start: auto; background: var(--hd-graphite); color: var(--hd-text-secondary); font-size: 11px; padding: 2px 7px; border-radius: 999px; }
.hd-sidebar-link--active .hd-sidebar-link__count { background: var(--hd-gold); color: var(--hd-black); }
.hd-sidebar-link__soon { margin-inline-start: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--hd-text-muted); }

.hd-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: var(--hd-space-2);
    left: var(--hd-space-2);
    z-index: 150;
    /* width: 42px;
    height: 42px; */
    border-radius: var(--hd-radius-sm);
    background: var(--hd-bg-card);
    color: var(--hd-text-primary) !important;
    border: var(--hd-border);
    color: var(--hd-text-primary);
    cursor: pointer;
}
.hd-sidebar-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
    color: inherit;
    stroke: currentColor;
    pointer-events: none;
}
.hd-sidebar-overlay { display: none; }

.hd-app-main { display: flex; flex-direction: column; min-width: 0; background: var(--hd-bg-body); }
.hd-app-topbar { display: flex; align-items: center; gap: var(--hd-space-3); padding: var(--hd-space-3) var(--hd-space-4); border-bottom: var(--hd-border); background: var(--hd-bg-card); }
.hd-app-topbar__title h1 { font-size: 22px; margin: 0; }
.hd-app-topbar__title p { font-size: 13px; color: var(--hd-text-secondary); margin: 2px 0 0; }
.hd-app-topbar__actions { display: flex; align-items: center; gap: var(--hd-space-2); margin-inline-start: auto; }
.hd-app-topbar__name { font-size: 13px; font-weight: 600; }
.hd-app-content { padding: var(--hd-space-4); background: var(--hd-bg-body); }

/* ═══ مخفی کردن منوی پیش‌فرض ووکامرس ═══ */
.woocommerce-account .woocommerce-MyAccount-navigation { display: none !important; }
.woocommerce-account .woocommerce-MyAccount-content { width: 100% !important; float: none !important; }

/* ═══ تضمین دارک مود برای تمام محتوای ووکامرس + breadcrumb ═══ */
.woocommerce-account .hd-app-content .woocommerce,
.woocommerce-account .hd-app-content table,
.woocommerce-account .hd-app-content p,
.woocommerce-account .hd-app-content h2,
.woocommerce-account .hd-app-content h3,
.woocommerce-account .woocommerce-breadcrumb,
.woocommerce-account .woocommerce-breadcrumb a,
.woocommerce-account .breadcrumb,
.woocommerce-account .breadcrumb-trail,
.woocommerce-account .breadcrumb-trail a,
.woocommerce-account .woocommerce-info,
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-error {
  background-color: var(--hd-bg-body) !important;
  color: var(--hd-text-primary) !important;
}

/* ⭐ حذف پدینگ و پس‌زمینه سفید داخل article */
.hd-app-shell .inside-article {
    padding: 0 !important;
    background: var(--hd-bg-body) !important;
    box-shadow: none !important;
    border: none !important;
}

/* ═══ Stats ═══ */
.hd-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--hd-space-3); margin-bottom: var(--hd-space-4); }
.hd-stat-card { display: flex; align-items: center; gap: var(--hd-space-2); background: var(--hd-bg-card); border: var(--hd-border-card); border-radius: var(--hd-radius-card); padding: var(--hd-space-3); }
.hd-stat-card__icon { width: 42px; height: 42px; border-radius: var(--hd-radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hd-stat-card__icon--purple { background: rgba(168,85,247,.15); color: #a855f7; }
.hd-stat-card__icon--green  { background: rgba(34,197,94,.15); color: var(--hd-success); }
.hd-stat-card__icon--gold   { background: rgba(212,175,55,.15); color: var(--hd-gold); }
.hd-stat-card__icon--blue   { background: rgba(59,130,246,.15); color: var(--hd-info); }
.hd-stat-card__label { display: block; font-size: 12px; color: var(--hd-text-secondary); }
.hd-stat-card strong { display: block; font-size: 20px; margin: 2px 0; }
.hd-stat-card strong small { font-size: 11px; color: var(--hd-text-muted); font-weight: 400; }
.hd-stat-card__sub { font-size: 11px; color: var(--hd-text-muted); }

/* ═══ Dashboard grid ═══ */
.hd-dashboard-grid { display: grid; grid-template-columns: 1fr 320px; gap: var(--hd-space-3); align-items: start; }
.hd-dashboard-col-main { display: flex; flex-direction: column; gap: var(--hd-space-3); min-width: 0; }
.hd-dashboard-col-side { display: flex; flex-direction: column; gap: var(--hd-space-3); }

/* ═══ Panels ═══ */
.hd-panel { background: var(--hd-bg-card); border: var(--hd-border-card); border-radius: var(--hd-radius-card); padding: var(--hd-space-3); }
.hd-panel__header { display: flex; align-items: center; margin-bottom: var(--hd-space-2); }
.hd-panel__header h2 { font-size: 16px; margin: 0; }
.hd-panel__view-all { margin-inline-start: auto; font-size: 12px; color: var(--hd-gold); text-decoration: none; }
.hd-panel__empty { font-size: 13px; color: var(--hd-text-muted); padding: var(--hd-space-2) 0; }

/* ═══ Activity ═══ */
.hd-activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.hd-activity-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.hd-activity-item__icon { width: 34px; height: 34px; border-radius: 50%; background: var(--hd-graphite); color: var(--hd-gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hd-activity-item__body { display: flex; flex-direction: column; min-width: 0; }
.hd-activity-item__body strong { font-size: 13px; }
.hd-activity-item__body span { font-size: 12px; color: var(--hd-text-muted); }
.hd-activity-item__time { margin-inline-start: auto; font-size: 11px; color: var(--hd-text-muted); white-space: nowrap; }

/* ═══ Wallet card ═══ */
.hd-wallet-card__balance { font-size: 28px; display: block; margin: 8px 0; }
.hd-wallet-card__balance span { font-size: 13px; color: var(--hd-text-muted); font-weight: 400; }
.hd-wallet-card__actions { display: flex; gap: var(--hd-space-2); }
.hd-wallet-card__actions .hd-btn { flex: 1; text-align: center; justify-content: center; }

/* ═══ Table ═══ */
.hd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hd-table th { text-align: start; color: var(--hd-text-muted); font-weight: 500; padding: 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.hd-table td { padding: 8px; border-top: var(--hd-border); }
.hd-table__product { display: flex; align-items: center; gap: 8px; }
.hd-table__product img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.hd-status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 4px; }
.hd-status-dot--active { background: var(--hd-success); }
.hd-status-dot--expiring { background: var(--hd-warning); }
.hd-status-dot--revoked, .hd-status-dot--expired { background: var(--hd-error); }

.hd-btn--sm { padding: 8px 12px; font-size: 12px; width: 100%; justify-content: center; }
.hd-btn:disabled { opacity: .5; cursor: not-allowed; }
.hd-btn:disabled:hover { transform: none; }

/* ═══ دکمهٔ تم ═══ */
.hd-theme-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--hd-radius-sm);
    border: 1px solid var(--hd-border-color);
    background: transparent;
    color: var(--hd-text-primary) !important;
    cursor: pointer;
    position: relative;
}
.hd-theme-toggle__icon-sun,
.hd-theme-toggle__icon-moon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.hd-theme-toggle__icon-sun { display: block; }
.hd-theme-toggle__icon-moon { display: none; }
.theme-light .hd-theme-toggle__icon-sun { display: block; }
.theme-light .hd-theme-toggle__icon-moon { display: none; }
.theme-dark .hd-theme-toggle__icon-sun { display: none; }
.theme-dark .hd-theme-toggle__icon-moon { display: block; }

@media (max-width: 1100px) { .hd-dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .hd-app-shell { grid-template-columns: 1fr; }
  .hd-app-sidebar { position: fixed; z-index: 200; left: 0; top: 0; width: 280px; height: 100vh; transform: translateX(-100%); transition: transform var(--hd-transition); }
  .hd-app-sidebar.is-open { transform: translateX(0); }
  .hd-sidebar-toggle { display: inline-flex; }
  .hd-sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 199; opacity: 0; pointer-events: none; transition: opacity var(--hd-transition); }
  .hd-sidebar-overlay.is-open { opacity: 1; pointer-events: auto; }
  .hd-app-topbar { flex-wrap: wrap; padding-inline-start: var(--hd-space-6); }
  .hd-stats-row { grid-template-columns: 1fr 1fr; }
}

/* ═══ مخفی کردن عنوان صفحات (shop, product, page) ═══ */
body.hd-hide-titles .entry-header,
body.hd-hide-titles h1.entry-title,
body.hd-hide-titles .page-header,
body.hd-hide-titles .woocommerce-products-header,
body.hd-hide-titles .woocommerce-products-header__title,
body.hd-hide-titles h1.page-title,
body.hd-hide-titles h1.product_title,
body.hd-hide-titles .product_title.entry-title {
    display: none !important;
}