/* ==========================================================================
   Health Records Dashboard — hrd-style.css
   Compatible: Healthcare Booking (hb-v3) + RX Prescription Manager
   ========================================================================== */

/* ── SAFETY NET ───────────────────────────────────────────────────────────── */

/* 1. Hide the grey default profile block on ALL account pages */
body.woocommerce-account .MyAccount-user-info,
body.woocommerce-account .woocommerce-MyAccount-navigation-wrapper > .MyAccount-user-info,
body.woocommerce-account .MyAccount-dashboard-buttons {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. On the main dashboard page ONLY: hide non-HRD content in content area */
body.hrd-dashboard-active .woocommerce-MyAccount-content > *:not(.hrd-wrap):not(.woocommerce-notices-wrapper) {
    display: none !important;
}
/* 3. Always ensure our wrap is visible */
body.hrd-dashboard-active .woocommerce-MyAccount-content > .hrd-wrap {
    display: block !important;
}


/* ── CSS Variables on :root so sidebar (outside .hrd-wrap) can access them ── */
:root {
    --hrd-teal:        #0F6E56;
    --hrd-teal-mid:    #1D9E75;
    --hrd-teal-light:  #E1F5EE;
    --hrd-teal-soft:   #9FE1CB;
    --hrd-blue:        #185FA5;
    --hrd-blue-light:  #E6F1FB;
    --hrd-pink:        #D4537E;
    --hrd-pink-light:  #FBEAF0;
    --hrd-amber:       #BA7517;
    --hrd-amber-light: #FAEEDA;
    --hrd-red:         #A32D2D;
    --hrd-red-light:   #FCEBEB;
    --hrd-green-light: #EAF3DE;
    --hrd-green-dark:  #27500A;
    --hrd-text:        #1a2332;
    --hrd-muted:       #6b7a8d;
    --hrd-border:      #e4eaf0;
    --hrd-surface:     #f7fafc;
    --hrd-white:       #ffffff;
    --hrd-radius-sm:   8px;
    --hrd-radius-md:   12px;
    --hrd-radius-lg:   16px;
    --hrd-shadow:      0 1px 4px rgba(0,0,0,0.06);
}

.hrd-wrap {
    --hrd-teal:        #0F6E56;
    --hrd-teal-mid:    #1D9E75;
    --hrd-teal-light:  #E1F5EE;
    --hrd-teal-soft:   #9FE1CB;
    --hrd-blue:        #185FA5;
    --hrd-blue-light:  #E6F1FB;
    --hrd-pink:        #D4537E;
    --hrd-pink-light:  #FBEAF0;
    --hrd-amber:       #BA7517;
    --hrd-amber-light: #FAEEDA;
    --hrd-red:         #A32D2D;
    --hrd-red-light:   #FCEBEB;
    --hrd-green-light: #EAF3DE;
    --hrd-green-dark:  #27500A;
    --hrd-text:        #1a2332;
    --hrd-muted:       #6b7a8d;
    --hrd-border:      #e4eaf0;
    --hrd-surface:     #f7fafc;
    --hrd-white:       #ffffff;
    --hrd-radius-sm:   8px;
    --hrd-radius-md:   12px;
    --hrd-radius-lg:   16px;
    --hrd-shadow:      0 1px 4px rgba(0,0,0,0.06);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--hrd-text);
    max-width: 900px;
    margin: 0 auto !important; /* Ensure the dashboard is always centered */
}

/* ── Page Header ──────────────────────────────────────────────────────────── */
.hrd-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
    padding: 0 5px;
}
.hrd-page-header__left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.hrd-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--hrd-teal-mid);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--hrd-teal-soft);
}
.hrd-page-title {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    color: var(--hrd-text);
    margin: 0 0 2px;
    letter-spacing: -0.02em;
    font-family: Georgia, 'Times New Roman', serif;
}
.hrd-page-sub {
    font-size: 14px;
    color: var(--hrd-muted);
    margin: 0;
}
.hrd-date-badge {
    font-size: 12.5px;
    color: var(--hrd-muted);
    background: var(--hrd-white);
    border: 1px solid var(--hrd-border);
    padding: 5px 16px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* ── Sidebar Profile Header ─────────────────────────────────────────────── */
.hrd-sidebar-header {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 24px 15px !important;
    margin-bottom: 10px !important;
    flex-direction: row !important;
}
.hrd-sidebar-avatar {
    flex-shrink: 0 !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: #008767 !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    min-width: 50px !important;
    line-height: 50px !important;
}
.hrd-sidebar-info {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0;
}
.hrd-sidebar-name {
    font-weight: 800;
    font-size: 15px;
    color: var(--hrd-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hrd-sidebar-email {
    font-size: 11.5px;
    color: var(--hrd-muted);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hrd-sidebar-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    color: #008169 !important;
    background: #EBF7F4 !important;
    padding: 0 12px !important;
    border-radius: 20px !important;
    width: fit-content !important;
    height: 22px !important;
    line-height: 22px !important;
    vertical-align: middle !important;
}
.hrd-sidebar-badge br {
    display: none !important;
}
.hrd-dot {
    width: 6px !important;
    height: 6px !important;
    background: #34D399 !important;
    border-radius: 50% !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

/* ── Promo Strip ──────────────────────────────────────────────────────────── */
.hrd-promo-strip {
    background: #0C5E57;
    border-radius: var(--hrd-radius-md);
    padding: 22px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: #fff;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}
.hrd-promo-strip::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    pointer-events: none;
}
.hrd-promo-strip__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 1;
}
.hrd-promo-strip__text strong {
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 700;
    letter-spacing: -0.01em;
}
.hrd-promo-strip__text span {
    opacity: .75;
    font-size: 13px;
    letter-spacing: 0.01em;
}
.hrd-promo-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
    color: #fff !important;
    padding: 10px 24px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: all .2s !important;
    z-index: 5;
    margin-left: auto;
    position: relative;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 42px !important;
    line-height: 42px !important;
    padding: 0 24px !important;
}
.hrd-promo-btn br {
    display: none !important;
}
.hrd-promo-btn:hover {
    background: rgba(255,255,255,0.30) !important;
    transform: translateY(-1px);
    color: #fff !important;
    text-decoration: none !important;
}

/* ── Stats Grid ───────────────────────────────────────────────────────────── */
.hrd-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px;
    margin-bottom: 30px;
}
/* Suppress wpautop injections inside the grid */
.hrd-stats-grid > p,
.hrd-stats-grid > br {
    display: none !important;
}
.hrd-stat-card {
    background: var(--hrd-white) !important;
    border-radius: var(--hrd-radius-md) !important;
    padding: 20px !important;
    border: 1.5px solid var(--hrd-border) !important;
    border-top-width: 4px !important;
    position: relative !important;
    text-decoration: none !important;
    color: var(--hrd-text) !important;
    display: block !important;
    min-height: 100px !important;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    height: auto !important;
    overflow: visible !important;
}
.hrd-stat-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
    border-color: var(--hrd-teal-soft);
}
.hrd-stat-card--orders  { border-top-color: #059669 !important; }
.hrd-stat-card--consult { border-top-color: #3B82F6 !important; }
.hrd-stat-card--reports { border-top-color: #DB2777 !important; }
.hrd-stat-card--rx      { border-top-color: #D97706 !important; }
/* CRITICAL: force ALL children of any stat card to be fully visible */
.hrd-stat-card > * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    max-height: none !important;
    clip: auto !important;
}

.hrd-stat-card__icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}
.hrd-stat-card--orders  .hrd-stat-card__icon { background: #ECFDF5; color: #059669; }
.hrd-stat-card--consult .hrd-stat-card__icon { background: #EFF6FF; color: #3B82F6; }
.hrd-stat-card--reports .hrd-stat-card__icon { background: #FDF2F8; color: #DB2777; }
.hrd-stat-card--rx      .hrd-stat-card__icon { background: #FFFBEB; color: #D97706; }

.hrd-stat-card__label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--hrd-muted) !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 2px !important;
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    opacity: 1 !important;
}
.hrd-stat-card__value {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: var(--hrd-text) !important;
    margin: 0 !important;
    line-height: 1.1 !important;
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    opacity: 1 !important;
}
.hrd-stat-card__sub {
    font-size: 12px !important;
    color: var(--hrd-muted) !important;
    margin-top: 4px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
/* Force ALL stat cards to be visible (prevent XStore nth-child hiding) */
.hrd-stats-grid > a,
.hrd-stats-grid > a:nth-child(even),
.hrd-stats-grid > a:nth-child(odd) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

/* ── Two-Column Row (Desktop Side-by-Side) ─────────────────────────────── */
.hrd-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    margin-bottom: 20px !important;
    align-items: start !important;
}
/* Suppress wpautop injections */
.hrd-row > p,
.hrd-row > br {
    display: none !important;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.hrd-card {
    background: var(--hrd-white);
    border-radius: var(--hrd-radius-md);
    border: 1px solid var(--hrd-border);
    padding: 18px 20px;
    box-shadow: var(--hrd-shadow);
    margin-bottom: 0;
}
.hrd-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hrd-border);
}
.hrd-card__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--hrd-text);
}
.hrd-card__link {
    font-size: 12px;
    color: var(--hrd-teal);
    text-decoration: none;
    font-weight: 600;
}
.hrd-card__link:hover {
    text-decoration: underline;
    color: var(--hrd-teal);
}
.hrd-empty {
    font-size: 13px;
    color: var(--hrd-muted);
    padding: 12px 0;
    margin: 0;
}

/* ── Order Items ──────────────────────────────────────────────────────────── */
.hrd-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--hrd-border);
    text-decoration: none;
    color: var(--hrd-text);
    transition: background .1s;
}
.hrd-order-item:last-child { border-bottom: none; padding-bottom: 0; }
.hrd-order-item:first-child { padding-top: 0; }
.hrd-order-item:hover { color: var(--hrd-teal); text-decoration: none; }

.hrd-order-thumb {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--hrd-teal-light);
    color: var(--hrd-teal);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hrd-order-info {
    flex: 1;
    min-width: 0;
}
.hrd-order-name {
    font-size: 13px;
    font-weight: 500;
    white-space: normal !important; /* Allow wrapping on small screens to prevent pushing status out */
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hrd-order-meta {
    font-size: 11px;
    color: var(--hrd-muted);
    margin-top: 2px;
}
.hrd-order-right {
    flex-shrink: 0;
}
.hrd-order-total {
    font-size: 12px;
    font-weight: 600;
    color: var(--hrd-teal);
    text-align: right;
    margin-top: 3px;
}

/* ── Status Badges ────────────────────────────────────────────────────────── */
.hrd-status {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 0 10px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    letter-spacing: .02em !important;
    height: 22px !important;
    line-height: 22px !important;
    vertical-align: middle !important;
}
.hrd-status br {
    display: none !important;
}
.hrd-status--completed  { background: var(--hrd-green-light); color: var(--hrd-green-dark); }
.hrd-status--processing { background: var(--hrd-blue-light);  color: var(--hrd-blue); }
.hrd-status--on-hold    { background: var(--hrd-amber-light); color: var(--hrd-amber); }
.hrd-status--pending    { background: var(--hrd-amber-light); color: var(--hrd-amber); }
.hrd-status--cancelled  { background: var(--hrd-red-light);   color: var(--hrd-red); }
.hrd-status--refunded   { background: #f1eff8;                color: #534AB7; }

/* ── Timeline ─────────────────────────────────────────────────────────────── */
.hrd-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.hrd-timeline__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--hrd-border);
}
.hrd-timeline__item:first-child { padding-top: 0; }
.hrd-timeline__item:last-child  { border-bottom: none; padding-bottom: 0; }
.hrd-timeline__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}
.hrd-timeline__dot--teal  { background: var(--hrd-teal-mid); }
.hrd-timeline__dot--blue  { background: var(--hrd-blue); }
.hrd-timeline__dot--pink  { background: var(--hrd-pink); }
.hrd-timeline__dot--amber { background: var(--hrd-amber); }
.hrd-timeline__dot--gray  { background: #888780; }
.hrd-timeline__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hrd-timeline__event {
    font-size: 13px;
    font-weight: 500;
    color: var(--hrd-text);
}
.hrd-timeline__time {
    font-size: 11px;
    color: var(--hrd-muted);
}

/* Quick Actions: use higher-specificity selector to beat XStore 4-col override */
body.woocommerce-account .hrd-actions-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    padding: 5px 0 !important;
}
/* Suppress wpautop injections */
.hrd-actions-grid > p,
.hrd-actions-grid > br {
    display: none !important;
}
.hrd-action-btn {
    background: var(--hrd-surface) !important;
    border: 1.5px solid var(--hrd-border) !important;
    border-radius: var(--hrd-radius-md) !important;
    padding: 18px 12px !important;
    display: flex !important;               /* CRITICAL: prevents display:contents override */
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    transition: all .18s;
    text-decoration: none !important;
    color: var(--hrd-text) !important;
    text-align: center !important;
    grid-column: auto !important;           /* Prevent spanning across columns */
    grid-row: auto !important;
    min-height: 110px !important;
}
.hrd-action-btn svg {
    color: var(--hrd-teal);
}
.hrd-action-btn:hover {
    border-color: var(--hrd-teal-soft);
    background: var(--hrd-teal-light);
    color: var(--hrd-teal);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(15, 110, 86, .12);
    text-decoration: none;
}
.hrd-action-btn span,
body.woocommerce-account .hrd-actions-grid .hrd-action-btn span,
body.woocommerce-account .hrd-action-btn span,
.hrd-action-label,
body.woocommerce-account .hrd-action-btn .hrd-action-label {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-align: center !important;
    line-height: 1.4 !important;
    color: #1a2332 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    position: static !important;
    clip: auto !important;
    white-space: normal !important;
    margin-top: 6px !important;
    background: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}
.hrd-action-btn:hover .hrd-action-label,
.hrd-action-btn:hover span {
    color: var(--hrd-teal) !important;
}
.hrd-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.hrd-action-icon--rx        { background: #FDECEC; color: #E11D48; }
.hrd-action-icon--lab       { background: #EEF2FF; color: #4338CA; }
.hrd-action-icon--doc       { background: #EFF6FF; color: #2563EB; }
.hrd-action-icon--shop      { background: #FEF2F2; color: #DC2626; }
.hrd-action-icon--report    { background: #F5F3FF; color: #7C3AED; }
.hrd-action-icon--insurance { background: #ECFDF5; color: #059669; }

/* ── Global Account Layout ─────────────────────────────────────────────── */
/* Hide theme breadcrumb / page-heading bar on all account pages */
body.woocommerce-account .page-heading {
    display: none !important;
}
body.woocommerce-account .woocommerce-MyAccount-content {
    background: #F3F6F9 !important;
    padding: 35px !important;
    border-radius: 16px !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important;
    border: 1px solid var(--hrd-border) !important;
}
/* Ensure our wrap doesn't inherit inner padding */
.woocommerce-MyAccount-content .hrd-wrap {
    padding: 0;
    margin: 0;
}

/* ── Sidebar Navigation Polish ─────────────────────────────────────────── */
.woocommerce-MyAccount-navigation {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    margin-bottom: 30px !important;
}
.woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}
.woocommerce-MyAccount-navigation li {
    border: none !important;
    margin: 0 0 4px 0 !important;
}
.woocommerce-MyAccount-navigation a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 18px !important;
    border-radius: 10px !important;
    color: #4a5568 !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
    border: 1px solid transparent !important;
}
/* Active State */
.woocommerce-MyAccount-navigation li.is-active a {
    background: #fff !important;
    color: var(--hrd-teal) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(15, 110, 86, 0.08) !important;
    border-color: var(--hrd-teal-soft) !important;
}
/* Hover State */
.woocommerce-MyAccount-navigation a:hover:not(.is-active) {
    background: rgba(15, 110, 86, 0.04) !important;
    color: var(--hrd-teal) !important;
}
/* Logout link */
.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: #a0aec0 !important;
}
.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    color: var(--hrd-red) !important;
    background: var(--hrd-red-light) !important;
}
/* Badge */
/* Specific Medical Icons for Nav Links (XStore/WC) */
.woocommerce-MyAccount-navigation-link--my-consultations a:before,
.woocommerce-MyAccount-navigation-link--my-reports a:before,
.woocommerce-MyAccount-navigation-link--rx-prescriptions a:before {
    content: "" !important;
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    background-color: currentColor !important;
    mask-size: contain !important;
    -webkit-mask-size: contain !important;
    mask-repeat: no-repeat !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-position: center !important;
    -webkit-mask-position: center !important;
}

.woocommerce-MyAccount-navigation-link--my-consultations a:before {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 11c1.1 0 2.22-.44 3-1.22.5-.5 1-1 1-1.78a2 2 0 0 0-3-1.78l-1 .78a2 2 0 0 0 0 3.56l1 .78C5.5 11 6.5 11 7.5 10.22"/><path d="M12 2v6"/><path d="M7 2h10"/><path d="M12 8c0 4.42 3.58 8 8 8a8.03 8.03 0 0 0 4-1"/><path d="M4 11v5a4 4 0 0 0 4 4h8a4 4 0 0 0 4-4v-5"/></svg>') !important;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 11c1.1 0 2.22-.44 3-1.22.5-.5 1-1 1-1.78a2 2 0 0 0-3-1.78l-1 .78a2 2 0 0 0 0 3.56l1 .78C5.5 11 6.5 11 7.5 10.22"/><path d="M12 2v6"/><path d="M7 2h10"/><path d="M12 8c0 4.42 3.58 8 8 8a8.03 8.03 0 0 0 4-1"/><path d="M4 11v5a4 4 0 0 0 4 4h8a4 4 0 0 0 4-4v-5"/></svg>') !important;
}

.woocommerce-MyAccount-navigation-link--my-reports a:before {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 02 2h12a2 2 0 0 02-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>') !important;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 02 2h12a2 2 0 0 02-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>') !important;
}

.woocommerce-MyAccount-navigation-link--rx-prescriptions a:before {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 02 2h12a2 2 0 0 02-2V8z"/><path d="M14 2v6h6"/><path d="M12 18v-6"/><path d="M9 15h6"/></svg>') !important;
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 02 2h12a2 2 0 0 02-2V8z"/><path d="M14 2v6h6"/><path d="M12 18v-6"/><path d="M9 15h6"/></svg>') !important;
}

.hrd-nav-badge {
    margin-left: auto;
    background: #10B981;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

/* ── Responsive: Tablet (768px) ── */
@media (max-width: 768px) {
    /* Horizontal Sliding Nav Pills */
    .woocommerce-MyAccount-navigation-wrapper {
        border: none !important;
        margin-bottom: 20px !important;
    }
    .woocommerce-MyAccount-navigation {
        margin-bottom: 15px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    .woocommerce-MyAccount-navigation::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }
    
    .woocommerce-MyAccount-navigation ul {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        padding-bottom: 5px !important; /* Space for hidden scrollbar */
    }
    .woocommerce-MyAccount-navigation li {
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    .woocommerce-MyAccount-navigation a {
        padding: 8px 16px !important;
        font-size: 13px !important;
        background: #f7fafc !important;
        border: 1.5px solid #edf2f7 !important;
        white-space: nowrap !important;
    }
    .woocommerce-MyAccount-navigation li.is-active a {
        background: var(--hrd-teal) !important;
        color: #fff !important;
        border-color: var(--hrd-teal) !important;
    }

    /* Grid Adjustments */
    .hrd-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .hrd-actions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .hrd-row {
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }
    .hrd-card {
        width: 100% !important;
    }

    .hrd-sidebar-header {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
}

/* ── Responsive: Mobile (480px) ── */
@media (max-width: 480px) {
    /* Break out of any theme containers to use 100% screen width */
    .hrd-wrap {
        padding: 0 !important;
        margin-left: -5% !important;
        margin-right: -5% !important;
        width: 110% !important;
        max-width: 110vw !important;
    }
    
    /* Ensure the inner content area has zero padding on the sides */
    .hrd-dashboard-active .woocommerce-MyAccount-content {
        padding: 10px 0 !important;
        margin: 0 !important;
        overflow-x: hidden !important;
    }

    .hrd-page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 0 5% !important;
    }
    .hrd-avatar {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        font-size: 15px !important;
    }
    .hrd-page-title {
        font-size: 20px !important;
    }
    
    .hrd-promo-strip {
        padding: 15px !important;
        margin: 0 10px !important; /* Keep a small inner gap for the promo */
    }
    .hrd-promo-btn {
        width: 100% !important;
        margin-top: 10px !important;
    }

    .hrd-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        padding: 0 2% !important;
    }
    .hrd-actions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        padding: 0 2% !important;
    }

    .hrd-stat-card {
        padding: 8px 4px !important;
        border-radius: 8px !important;
    }
    .hrd-stat-card__label {
        font-size: 9px !important;
        letter-spacing: -0.2px !important;
    }
    .hrd-stat-card__value {
        font-size: 18px !important;
    }
    
    /* Quick actions on very small screens */
    .hrd-action-btn {
        padding: 10px 5px !important;
        min-height: 80px !important;
    }
    .hrd-action-btn span {
        font-size: 11px !important;
    }

    /* Eliminate card horizontal margins to touch the red-line zones */
    .hrd-card {
        padding: 10px !important;
        margin: 0 2% 15px 2% !important;
        border-radius: 4px !important; /* Minimal radius for a modern look */
        width: auto !important;
    }
    
    /* Clean up any injected paragraph gaps within cards */
    .hrd-card > p {
        display: none !important;
    }
    .hrd-card > div + p, 
    .hrd-card > a + p {
        margin: 0 !important;
    }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
    .hrd-promo-strip,
    .hrd-actions-grid,
    .hrd-date-badge { display: none !important; }
}
