/* ╔═══════════════════════════════════════════════════════════════════════╗
   ║  e-HQ v2 — RESPONSIVE VISUAL THEME (v1.3.0)                           ║
   ║  Premium financial command-center identity for the ë ecosystem.       ║
   ║  Scoped to .erh-render-context (existing) and .ehq-v2 (new wrapper).  ║
   ║  Desktop + tablet + small-tablet + mobile. Fluid app shell.           ║
   ║  CSS ONLY. No PHP / data / permission / financial logic changes.      ║
   ╚═══════════════════════════════════════════════════════════════════════╝ */

/* ──────────────────────────────────────────────────────────────────────
   1 — DESIGN TOKENS (scoped to the plugin wrapper)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context,
.ehq-v2 {
    /* Core surfaces */
    --ehq-bg:             var(--ehq-ui-canvas, transparent);
    --ehq-surface:        var(--ehq-ui-panel, var(--ehq3-card, #0b0e16));
    --ehq-surface-alt:    var(--ehq-ui-panel-2, var(--ehq3-card-2, #0e1220));
    --ehq-card:           var(--ehq-ui-panel, var(--ehq3-card, #0b0e16));
    --ehq-border:         var(--ehq-ui-line, var(--ehq3-line, rgba(255,255,255,0.12)));
    --ehq-border-strong:  var(--ehq-ui-line-strong, var(--ehq3-line-strong, rgba(255,255,255,0.2)));
    --ehq-text:           var(--ehq-ui-text, var(--ehq3-text, #ffffff));
    --ehq-text-muted:     var(--ehq-ui-text-muted, var(--ehq3-text-muted, #ffffff));
    --ehq-text-soft:      var(--ehq3-text-dim, rgba(255,255,255,0.82));

    /* Brand */
    --ehq-primary:        var(--ehq-ui-primary-bg, var(--ehq3-primary, #f2cf2f));
    --ehq-primary-hover:  var(--ehq3-primary-hover, #ffe04d);
    --ehq-primary-soft:   var(--ehq3-primary-soft, rgba(242,207,47,0.12));
    --ehq-primary-border: var(--ehq3-primary-line, rgba(242,207,47,0.35));
    --ehq-accent:         var(--ehq3-violet, #9d8bff);
    --ehq-accent-soft:    var(--ehq3-violet-soft, rgba(157,139,255,0.12));

    /* Semantic */
    --ehq-success:        #0fa07a;
    --ehq-success-hover:  #0c8966; /* v0.4.17 polish: token for reused success-hover */
    --ehq-success-soft:   #e3f6ee;
    --ehq-warning:        #d97706;
    --ehq-warning-soft:   #fdf1de;
    --ehq-danger:         #d92d20;
    --ehq-danger-soft:    #fdecec;
    --ehq-info:           #0ea5e9;
    --ehq-info-soft:      #e1f4fd;

    /* Finance */
    --ehq-income:         #0fa07a;
    --ehq-expense:        #d92d20;
    --ehq-profit:         #0fa07a;
    --ehq-loss:           #d92d20;
    --ehq-pending:        #d97706;
    --ehq-approved:       #0fa07a;
    --ehq-reconciled:     #0f4cff;

    /* Spacing — 8-point grid */
    --ehq-space-1:        4px;
    --ehq-space-2:        8px;
    --ehq-space-3:        12px;
    --ehq-space-4:        16px;
    --ehq-space-5:        20px;
    --ehq-space-6:        24px;
    --ehq-space-8:        32px;
    --ehq-space-10:       40px;
    --ehq-space-12:       48px;

    /* Radius */
    --ehq-radius-sm:      6px;
    --ehq-radius-md:      10px;
    --ehq-radius-lg:      14px;
    --ehq-radius-xl:      20px;
    --ehq-radius-full:    999px;

    /* Shadows — calm, layered */
    --ehq-shadow-xs:      0 1px 1px rgba(0, 0, 0, 0.4);
    --ehq-shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.4);
    --ehq-shadow-md:      var(--ehq3-shadow, 0 12px 32px rgba(0, 0, 0, 0.45));
    --ehq-shadow-lg:      var(--ehq3-shadow-lg, 0 24px 64px rgba(0, 0, 0, 0.55));
    --ehq-shadow-xl:      0 32px 80px rgba(0, 0, 0, 0.62);
    --ehq-shadow-inner:   inset 0 1px 2px rgba(0, 0, 0, 0.35);
    --ehq-ring-focus:     0 0 0 3px var(--ehq3-primary-soft, rgba(242,207,47,0.18));

    /* Typography family */
    --ehq-font-sans:      var(--ehq3-font, var(--ehq-font, "Open Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif));
    --ehq-font-mono:      var(--ehq3-font-mono, var(--ehq-font, "Open Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif));

    /* v0.4.10 — Typography scale (in addition to h1/h2/h3). Use these for
       caption / helper / overline / code / large body. */
    --ehq-fs-xs:          11px;
    --ehq-fs-sm: 13px;
    --ehq-fs-base: 15px;
    --ehq-fs-md: 16px;
    --ehq-fs-lg: 19px;
    --ehq-fs-xl: 25px;
    --ehq-fs-2xl: 33px;
    --ehq-fw-regular:     400;
    --ehq-fw-medium:      500;
    --ehq-fw-semibold:    600;
    --ehq-fw-bold:        650;
    --ehq-fw-extrabold:   750;

    /* v0.4.10 — Motion tokens. Replace hardcoded transition durations. */
    --ehq-motion-fast:    120ms;
    --ehq-motion-normal:  200ms;
    --ehq-motion-slow:    320ms;
    --ehq-motion-ease:        cubic-bezier(.2, .7, .3, 1);
    --ehq-motion-ease-in:     cubic-bezier(.4, 0, 1, 1);
    --ehq-motion-ease-out:    cubic-bezier(0, 0, .2, 1);
    --ehq-motion-ease-spring: cubic-bezier(.34, 1.56, .64, 1);

    /* v0.4.10 — Z-index scale. Named tiers; never hardcode integers. */
    --ehq-z-base:         0;
    --ehq-z-dropdown:     1000;
    --ehq-z-sticky:       1100;
    --ehq-z-fixed:        1200;
    --ehq-z-overlay:      9000;
    --ehq-z-drawer:       9500;
    --ehq-z-modal:        10000;
    --ehq-z-toast:        10500;
    --ehq-z-tooltip:      11000;

    /* v0.4.10 — Border width tokens */
    --ehq-bw-1:           1px;
    --ehq-bw-2:           2px;
    --ehq-bw-thick:       4px;
}

/* ──────────────────────────────────────────────────────────────────────
   2 — FLUID APP SHELL (near full-width, responsive padding)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context,
.ehq-v2 {
    width: 100%;
    max-width: 1920px;
    margin-inline: auto;
    padding-inline: clamp(16px, 2.5vw, 48px);
    padding-block:  clamp(20px, 3vw, 32px);
    background: transparent;
    color: var(--ehq-text);
    font-family: var(--ehq-font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;            /* page itself never overflows */
}
.erh-render-context *,
.erh-render-context *::before,
.erh-render-context *::after,
.ehq-v2 *,
.ehq-v2 *::before,
.ehq-v2 *::after {
    box-sizing: border-box;
}
/* In wp-admin, the .wrap parent already centers — neutralize */
.wrap > .erh-render-context,
.wrap > .ehq-v2 {
    max-width: 100%;
    margin-left: 0;
    padding-inline: clamp(8px, 1.5vw, 24px);
}

/* ──────────────────────────────────────────────────────────────────────
   3 — TYPOGRAPHY
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context h1,
.ehq-v2 h1 {
    font-size: clamp(22px, 1.8vw + 12px, 32px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    color: var(--ehq-text);
    margin: 0 0 var(--ehq-space-2);
}
.erh-render-context h2,
.ehq-v2 h2 {
    font-size: 18px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: 0;
    color: var(--ehq-text);
    margin: 0 0 var(--ehq-space-3);
}
.erh-render-context h3,
.ehq-v2 h3 {
    font-size: 15px;
    font-weight: 650;
    line-height: 1.35;
    color: var(--ehq-text);
    margin: 0 0 var(--ehq-space-2);
}
.erh-render-context p,
.ehq-v2 p {
    margin: var(--ehq-space-2) 0;
}
.erh-render-context .erh-note,
.erh-render-context .ehq-muted,
.ehq-v2 .ehq-muted {
    color: var(--ehq-text-muted);
    font-size: 13px;
}
.erh-render-context .ehq-eyebrow,
.ehq-v2 .ehq-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ehq-text-soft);
}
.erh-render-context .ehq-num,
.ehq-v2 .ehq-num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* ──────────────────────────────────────────────────────────────────────
   4 — HERO / PAGE HEADER
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-page-hero,
.erh-render-context .ehq-hero,
.ehq-v2 .ehq-hero {
    min-height: 96px;
    display: flex;
    align-items: center;
    gap: var(--ehq-space-4);
    padding: var(--ehq-space-5) var(--ehq-space-6);
    background: linear-gradient(135deg, var(--ehq-surface) 0%, var(--ehq-surface-alt) 100%);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-md);
    margin-bottom: var(--ehq-space-6);
    flex-wrap: wrap;
}
.erh-render-context .erh-brand-mark,
.erh-render-context .ehq-hero-logo {
    width: 72px;
    height: 72px;
    border-radius: var(--ehq-radius-md);
    background: linear-gradient(135deg, var(--ehq-primary) 0%, var(--ehq-accent) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 76, 255, 0.25);
}
.erh-render-context .erh-brand-mark img,
.ehq-v2 .ehq-hero-logo img {
    max-width: 100%; max-height: 100%; object-fit: contain;
}
.erh-render-context .erh-page-hero h1,
.ehq-v2 .ehq-hero h1 {
    margin: 0;
}
.erh-render-context .erh-page-hero p,
.ehq-v2 .ehq-hero p {
    margin: var(--ehq-space-1) 0 0;
    color: var(--ehq-text-muted);
    font-size: 14px;
}
.erh-render-context .erh-version-pill,
.ehq-v2 .ehq-version-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ehq-primary-soft);
    color: var(--ehq-primary);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--ehq-primary-border);
}

/* v0.4.7 — Hero v2 sub-classes (used by theme/module-distribution.php and
   ERH_Admin::header()). Unscoped so they apply BOTH inside .erh-render-context
   (admin) and outside (theme console hero). Names match the user spec. */
.erh-page-hero { flex-wrap: wrap; }
.erh-page-hero-icon {
    flex: 0 0 auto;
    width: 64px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ehq-primary, var(--ehq-primary));
}
.erh-hero-logo {
    width: 100%;
    height: 100%;
    display: block;
}
.erh-page-hero-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.erh-page-hero-label {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--ehq-text-muted, var(--ehq-text-muted));
}
.erh-page-hero-title {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.15;
    letter-spacing: 0;
    color: var(--ehq-ink, #111827);
}
.erh-page-hero-subtitle {
    margin: 4px 0 0;
    color: var(--ehq-text-muted, var(--ehq-text-muted));
    font-size: 0.875rem;
}
.erh-page-hero-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.erh-version-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ehq-primary-soft, var(--ehq-primary-soft));
    color: var(--ehq-primary, var(--ehq-primary));
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ──────────────────────────────────────────────────────────────────────
   5 — NAVIGATION (inline desktop, scroll-x below 1024)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-front-nav,
.erh-render-context .ehq-module-toolbar,
.erh-render-context .ehq-nav,
.ehq-v2 .ehq-nav {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--ehq-space-2);
    background: var(--ehq-surface);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-sm);
    margin-bottom: var(--ehq-space-8);
    flex-wrap: wrap;
}
.erh-render-context .erh-front-nav-link,
.erh-render-context .ehq-nav-link,
.ehq-v2 .ehq-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--ehq-radius-sm);
    color: var(--ehq-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    min-height: 40px;
    transition: background .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}
/* v0.4.7 — Nav icons aligned + non-shrinking next to centered text */
.erh-render-context .erh-front-nav-link .dashicons,
.erh-render-context .erh-front-nav-link svg,
.erh-render-context .ehq-nav-link .dashicons,
.erh-render-context .ehq-nav-link svg,
.ehq-v2 .ehq-nav-link .dashicons,
.ehq-v2 .ehq-nav-link svg {
    flex-shrink: 0;
    vertical-align: middle;
}
.erh-render-context .erh-front-nav-link:hover,
.ehq-v2 .ehq-nav-link:hover {
    background: var(--ehq-surface-alt);
    color: var(--ehq-primary);
}
.erh-render-context .erh-front-nav-link.is-active,
.ehq-v2 .ehq-nav-link.is-active {
    background: var(--ehq-primary-soft);
    color: var(--ehq-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 76, 255, 0.1);
}

/* ──────────────────────────────────────────────────────────────────────
   6 — CARD SYSTEM (base + variants)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .card,
.erh-render-context .erh-panel,
.erh-render-context .erh-front-panel,
.erh-render-context .erh-chart-panel,
.erh-render-context details.erh-panel,
.ehq-v2 .ehq-card {
    background: var(--ehq-card);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-sm);
    padding: var(--ehq-space-5);
    margin-block: var(--ehq-space-4);
    width: 100%;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.erh-render-context details.erh-panel > summary {
    cursor: pointer;
    font-weight: 600;
    padding: var(--ehq-space-1) 0;
}
.erh-render-context .erh-panel:hover,
.erh-render-context .card:hover,
.ehq-v2 .ehq-card.is-interactive:hover {
    border-color: var(--ehq-border-strong);
    box-shadow: var(--ehq-shadow-md);
}
.erh-render-context .erh-panel-heading,
.erh-render-context .erh-front-panel-heading,
.erh-render-context .erh-section-header,
.ehq-v2 .ehq-card-heading {
    display: flex;
    align-items: center;
    gap: var(--ehq-space-2);
    font-size: 16px;
    font-weight: 650;
    color: var(--ehq-text);
    margin: 0 0 var(--ehq-space-3);
}

/* ──────────────────────────────────────────────────────────────────────
   7 — KPI STRIP (responsive grid 5→3→2→1)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-kpi-strip,
.erh-render-context .erh-kpi-grid,
.erh-render-context .erh-kpi-row,
.ehq-v2 .ehq-kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--ehq-space-4);
    align-items: stretch;
    margin-block: var(--ehq-space-4);
}
.erh-render-context .erh-kpi-card,
.erh-render-context .erh-stat-card,
.ehq-v2 .ehq-kpi-card {
    min-height: 140px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--ehq-space-2);
    padding: var(--ehq-space-5);
    background: var(--ehq-card);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-sm);
    transition: border-color .15s, box-shadow .15s, transform .15s;
    overflow: hidden;
}
.erh-render-context .erh-kpi-card:hover,
.ehq-v2 .ehq-kpi-card:hover {
    border-color: var(--ehq-primary-border);
    box-shadow: var(--ehq-shadow-md);
    transform: translateY(-1px);
}
.erh-render-context .erh-kpi-card .kpi-head,
.ehq-v2 .ehq-kpi-card .ehq-kpi-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--ehq-space-2);
}
.erh-render-context .erh-kpi-label,
.ehq-v2 .ehq-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ehq-text-soft);
}
.erh-render-context .erh-kpi-value,
.ehq-v2 .ehq-kpi-value {
    font-size: clamp(22px, 1.6vw + 8px, 30px);
    font-weight: 750;
    color: var(--ehq-text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.erh-render-context .erh-kpi-card .kpi-sub,
.ehq-v2 .ehq-kpi-card .ehq-kpi-sub {
    font-size: 12px;
    color: var(--ehq-text-muted);
    overflow-wrap: anywhere;
}
.erh-render-context .erh-kpi-card .kpi-delta.is-up,
.ehq-v2 .ehq-kpi-card .ehq-kpi-delta.is-up    { color: var(--ehq-income); }
.erh-render-context .erh-kpi-card .kpi-delta.is-down,
.ehq-v2 .ehq-kpi-card .ehq-kpi-delta.is-down  { color: var(--ehq-loss); }

/* ──────────────────────────────────────────────────────────────────────
   8 — MINI CARDS (responsive 5→5/3→3→2)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-mini-cards,
.erh-render-context .erh-catalog-grid,
.ehq-v2 .ehq-mini-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--ehq-space-4);
    align-items: stretch;
    margin-block: var(--ehq-space-4);
}
.erh-render-context .erh-mini-card,
.ehq-v2 .ehq-mini-card {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--ehq-space-1);
    padding: var(--ehq-space-4);
    background: var(--ehq-card);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-md);
    box-shadow: var(--ehq-shadow-sm);
    text-align: center;
    transition: border-color .15s, box-shadow .15s;
}
.erh-render-context .erh-mini-card:hover,
.ehq-v2 .ehq-mini-card:hover {
    border-color: var(--ehq-primary-border);
}
.erh-render-context .erh-mini-card span,
.erh-render-context .erh-mini-card .label,
.ehq-v2 .ehq-mini-card .label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ehq-text-soft);
    margin: 0;
}
.erh-render-context .erh-mini-card strong,
.erh-render-context .erh-mini-card .value,
.ehq-v2 .ehq-mini-card .value {
    font-size: 22px;
    font-weight: 700;
    color: var(--ehq-text);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* ──────────────────────────────────────────────────────────────────────
   9 — WIDGET GRID (2 cols desktop, 1 col below 1024)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-widget-grid,
.erh-render-context .erh-dashboard-main,
.erh-render-context .erh-dashboard-panels,
.ehq-v2 .ehq-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ehq-space-4);
    align-items: stretch;
    margin-block: var(--ehq-space-8);
}
.erh-render-context .erh-widget-grid > *,
.erh-render-context .erh-dashboard-main > *,
.erh-render-context .erh-dashboard-panels > *,
.ehq-v2 .ehq-widget-grid > * {
    min-width: 0;
    height: 100%;
}

/* ──────────────────────────────────────────────────────────────────────
   10 — DETAIL & FORM GRIDS
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-detail-grid,
.ehq-v2 .ehq-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--ehq-space-6);
    align-items: start;
}
.erh-render-context .erh-form-grid,
.ehq-v2 .ehq-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ehq-space-4);
    align-items: start;
}
.erh-render-context .ehq-field-wide,
.ehq-v2 .ehq-field-wide {
    grid-column: 1 / -1;
}
.erh-render-context .ehq-control-fluid,
.ehq-v2 .ehq-control-fluid {
    width: 100%;
}
.erh-render-context .erh-form-card,
.ehq-v2 .ehq-form-card {
    max-width: 720px;
    margin-inline: auto;
    padding: var(--ehq-space-6);
    background: var(--ehq-card);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-md);
}
.erh-render-context .erh-form-card.is-full-width,
.ehq-v2 .ehq-form-card.is-full-width { max-width: 100%; }
.erh-render-context .erh-form-actions,
.ehq-v2 .ehq-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--ehq-space-3);
    margin-top: var(--ehq-space-6);
    flex-wrap: wrap;
}

/* ──────────────────────────────────────────────────────────────────────
   11 — BUTTONS
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .btn,
.erh-render-context .button,
.erh-render-context input.button,
.erh-render-context button.button,
.erh-render-context .erh-front-button,
.erh-render-context .erh-action-link,
.erh-render-context input[type="submit"],
.erh-render-context button[type="submit"],
.ehq-v2 .ehq-btn,
.ehq-v2 button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ehq-space-2);
    padding: 10px 16px;
    border-radius: var(--ehq-radius-sm);
    border: 1px solid var(--ehq-border-strong);
    background: var(--ehq-surface);
    color: var(--ehq-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
    font-family: inherit;
}
.erh-render-context .btn:hover,
.erh-render-context .button:hover,
.erh-render-context .erh-front-button:hover,
.erh-render-context .erh-action-link:hover,
.erh-render-context input[type="submit"]:hover,
.erh-render-context button[type="submit"]:hover,
.ehq-v2 .ehq-btn:hover {
    background: var(--ehq-surface-alt);
    border-color: var(--ehq-primary-border);
    color: var(--ehq-primary);
}
.erh-render-context .btn:active,
.erh-render-context .button:active,
.ehq-v2 .ehq-btn:active { transform: translateY(1px); }
.erh-render-context .btn:focus-visible,
.erh-render-context .button:focus-visible,
.erh-render-context input:focus-visible,
.erh-render-context select:focus-visible,
.erh-render-context textarea:focus-visible {
    outline: none;
    box-shadow: var(--ehq-ring-focus);
    border-color: var(--ehq-primary);
}

/* Variants */
.erh-render-context .btn-primary,
.erh-render-context .button-primary,
.erh-render-context .erh-front-button.is-primary,
.erh-render-context .erh-action-link.is-primary,
.ehq-v2 .ehq-btn-primary {
    background: var(--ehq-primary);
    border-color: var(--ehq-primary);
    color: var(--ehq3-on-primary, #05070d);
    box-shadow: none;
}
.erh-render-context .btn-primary:hover,
.erh-render-context .button-primary:hover,
.ehq-v2 .ehq-btn-primary:hover {
    background: var(--ehq-primary-hover);
    border-color: var(--ehq-primary-hover);
    color: var(--ehq3-on-primary, #05070d);
    box-shadow: none;
}

.erh-render-context .btn-secondary,
.erh-render-context .button-secondary,
.erh-render-context .erh-front-button.is-secondary,
.ehq-v2 .ehq-btn-secondary {
    background: var(--ehq-surface);
    border-color: var(--ehq-border-strong);
    color: var(--ehq-text);
}
.erh-render-context .btn-secondary:hover,
.erh-render-context .button-secondary:hover,
.ehq-v2 .ehq-btn-secondary:hover {
    background: var(--ehq-surface-alt);
    border-color: var(--ehq-primary-border);
    color: var(--ehq-primary);
}

.erh-render-context .btn-ghost,
.ehq-v2 .ehq-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ehq-text-muted);
}
.erh-render-context .btn-ghost:hover,
.ehq-v2 .ehq-btn-ghost:hover {
    background: var(--ehq-surface-alt);
    color: var(--ehq-primary);
}

.erh-render-context .btn-danger,
.erh-render-context .button.delete,
.erh-render-context input.delete,
.erh-render-context .erh-action-link.is-danger,
.ehq-v2 .ehq-btn-danger {
    background: var(--ehq-surface);
    border-color: var(--ehq-danger);
    color: var(--ehq-danger);
}
.erh-render-context .btn-danger:hover,
.erh-render-context .button.delete:hover,
.ehq-v2 .ehq-btn-danger:hover {
    background: var(--ehq-danger);
    border-color: var(--ehq-danger);
    color: #fff;
}

.erh-render-context .btn-success,
.ehq-v2 .ehq-btn-success {
    background: var(--ehq-success);
    border-color: var(--ehq-success);
    color: #fff;
}
.erh-render-context .btn-success:hover,
.ehq-v2 .ehq-btn-success:hover {
    background: var(--ehq-success-hover);
    border-color: var(--ehq-success-hover);
}

.erh-render-context .btn-sm,
.ehq-v2 .ehq-btn-sm {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
}
.erh-render-context .btn-link,
.ehq-v2 .ehq-btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--ehq-primary);
    padding: 4px 8px;
    min-height: auto;
}
.erh-render-context .btn-link:hover,
.ehq-v2 .ehq-btn-link:hover { text-decoration: underline; background: transparent; }

.erh-render-context .btn-icon,
.ehq-v2 .ehq-btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--ehq-radius-sm);
}

.erh-render-context .btn[disabled],
.erh-render-context .btn:disabled,
.erh-render-context .btn.disabled,
.erh-render-context input:disabled,
.ehq-v2 .ehq-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}

.erh-render-context p.submit {
    margin: var(--ehq-space-2) 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ehq-space-2);
}
/* Buttons in toolbars never stretch */
.erh-render-context .erh-toolbar > .btn,
.erh-render-context .erh-toolbar > button,
.erh-render-context .erh-toolbar > a,
.erh-render-context .erh-filter-toolbar > .btn,
.erh-render-context .erh-filter-toolbar > button,
.erh-render-context .erh-filter-toolbar > a,
.erh-render-context .erh-bulk-toolbar > .btn,
.erh-render-context .erh-bulk-toolbar > button,
.erh-render-context p.submit > .btn,
.erh-render-context p.submit > button {
    flex: 0 0 auto;
    width: auto;
    align-self: center;
}

/* ──────────────────────────────────────────────────────────────────────
   12 — FORM ELEMENTS
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context input[type="text"],
.erh-render-context input[type="number"],
.erh-render-context input[type="date"],
.erh-render-context input[type="email"],
.erh-render-context input[type="password"],
.erh-render-context input[type="search"],
.erh-render-context input[type="url"],
.erh-render-context input[type="tel"],
.erh-render-context input:not([type]),
.erh-render-context select,
.erh-render-context textarea,
.erh-render-context .form-control,
.ehq-v2 .ehq-input,
.ehq-v2 .ehq-select,
.ehq-v2 .ehq-textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ehq-border-strong);
    border-radius: var(--ehq-radius-sm);
    background: var(--ehq-surface);
    color: var(--ehq-text);
    font-size: 14px;
    font-family: inherit;
    min-height: 44px;
    max-width: 100%;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
.erh-render-context input[type="checkbox"],
.erh-render-context input[type="radio"],
.ehq-v2 input[type="checkbox"],
.ehq-v2 input[type="radio"] {
    width: 18px;
    height: 18px;
    min-height: auto;
    margin-right: 6px;
    accent-color: var(--ehq-primary);
}
.erh-render-context label,
.ehq-v2 .ehq-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ehq-text-muted);
    margin-bottom: 6px;
}
.erh-render-context .erh-field,
.ehq-v2 .ehq-field {
    margin-block: var(--ehq-space-4);
}
.erh-render-context .erh-field-helper,
.ehq-v2 .ehq-field-helper {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ehq-text-muted);
}
.erh-render-context .erh-field-error,
.ehq-v2 .ehq-field-error {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ehq-danger);
    display: flex;
    align-items: center;
    gap: 6px;
}
.erh-render-context input:disabled,
.erh-render-context select:disabled,
.erh-render-context textarea:disabled,
.ehq-v2 .ehq-input:disabled,
.ehq-v2 .ehq-select:disabled,
.ehq-v2 .ehq-textarea:disabled {
    background: var(--ehq-surface-alt);
    color: var(--ehq-text-soft);
    opacity: .75;
    cursor: not-allowed;
}
.erh-render-context .has-error input,
.erh-render-context .has-error select,
.erh-render-context .has-error textarea,
.ehq-v2 .ehq-field.has-error .ehq-input {
    border-color: var(--ehq-danger);
}

/* ──────────────────────────────────────────────────────────────────────
   13 — TOOLBARS / FILTER ROWS
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-toolbar,
.erh-render-context .erh-filter-toolbar,
.ehq-v2 .ehq-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ehq-space-3);
    align-items: end;
    justify-content: flex-start;
    min-height: 56px;
    margin: var(--ehq-space-3) 0;
    padding: var(--ehq-space-3) var(--ehq-space-4);
    background: var(--ehq-surface-alt);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-md);
}
.erh-render-context .erh-toolbar label,
.erh-render-context .erh-filter-toolbar label,
.ehq-v2 .ehq-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--ehq-text-soft);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}
.erh-render-context .erh-bulk-toolbar,
.ehq-v2 .ehq-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ehq-space-3);
    margin: var(--ehq-space-2) 0;
}

/* ──────────────────────────────────────────────────────────────────────
   14 — TABLES (always inside .erh-table-wrap, never break page width)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-table-scroll,
.erh-render-context .erh-front-table-scroll,
.erh-render-context .erh-table-wrap,
.ehq-v2 .ehq-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--ehq-space-3) 0;
    border-radius: var(--ehq-radius-md);
    border: 1px solid var(--ehq-border);
    background: var(--ehq-surface);
    max-width: 100%;
}
.erh-render-context .erh-table-wrap table,
.erh-render-context table.table,
.erh-render-context .table,
.erh-render-context table.widefat,
.ehq-v2 .ehq-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    background: var(--ehq-surface);
    font-size: 13px;
    overflow: hidden;
    border-radius: var(--ehq-radius-md);
}
.erh-render-context .table th,
.erh-render-context table.widefat th,
.ehq-v2 .ehq-table th {
    background: var(--ehq-surface-alt);
    color: var(--ehq-text-muted);
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ehq-border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-height: 44px;
    position: sticky;
    top: 0;
    z-index: 2;
}
.erh-render-context .table td,
.erh-render-context table.widefat td,
.ehq-v2 .ehq-table td {
    padding: 14px;
    border-bottom: 1px solid var(--ehq-border);
    vertical-align: middle;
    min-height: 44px;
    color: var(--ehq-text);
}
.erh-render-context .table tbody tr:last-child td,
.ehq-v2 .ehq-table tbody tr:last-child td { border-bottom: 0; }
.erh-render-context .table.table-striped tbody tr:nth-of-type(odd) td,
.ehq-v2 .ehq-table.is-striped tbody tr:nth-of-type(odd) td {
    background: var(--ehq-surface-alt);
}
.erh-render-context .table tbody tr:hover td,
.ehq-v2 .ehq-table tbody tr:hover td {
    background: var(--ehq-primary-soft);
}
.erh-render-context .table .num,
.ehq-v2 .ehq-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.erh-render-context .erh-pagination,
.erh-render-context .tablenav,
.ehq-v2 .ehq-pagination {
    display: flex;
    gap: var(--ehq-space-2);
    justify-content: center;
    align-items: center;
    min-height: 48px;
    margin: var(--ehq-space-4) 0;
    flex-wrap: wrap;
}

/* ──────────────────────────────────────────────────────────────────────
   15 — BADGES (status / financial)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-badge,
.ehq-v2 .ehq-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--ehq-surface-alt);
    color: var(--ehq-text-muted);
    border: 1px solid var(--ehq-border);
    line-height: 1.4;
}
.erh-render-context .erh-badge.is-success,
.ehq-v2 .ehq-badge.is-success { background: var(--ehq-success-soft); color: var(--ehq-success); border-color: var(--ehq-success-soft); }
.erh-render-context .erh-badge.is-warning,
.ehq-v2 .ehq-badge.is-warning { background: var(--ehq-warning-soft); color: var(--ehq-warning); border-color: var(--ehq-warning-soft); }
.erh-render-context .erh-badge.is-danger,
.ehq-v2 .ehq-badge.is-danger  { background: var(--ehq-danger-soft);  color: var(--ehq-danger);  border-color: var(--ehq-danger-soft); }
.erh-render-context .erh-badge.is-info,
.ehq-v2 .ehq-badge.is-info    { background: var(--ehq-info-soft);    color: var(--ehq-info);    border-color: var(--ehq-info-soft); }
.erh-render-context .erh-badge.is-primary,
.ehq-v2 .ehq-badge.is-primary { background: var(--ehq-primary-soft); color: var(--ehq-primary); border-color: var(--ehq-primary-border); }

.erh-render-context .ehq-amount.is-income, .ehq-v2 .ehq-amount.is-income { color: var(--ehq-income); font-weight: 600; }
.erh-render-context .ehq-amount.is-expense, .ehq-v2 .ehq-amount.is-expense { color: var(--ehq-expense); font-weight: 600; }
.erh-render-context .ehq-amount.is-profit, .ehq-v2 .ehq-amount.is-profit { color: var(--ehq-profit); }
.erh-render-context .ehq-amount.is-loss, .ehq-v2 .ehq-amount.is-loss { color: var(--ehq-loss); }

/* ──────────────────────────────────────────────────────────────────────
   16 — DASHICONS NORMALIZATION
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .dashicons,
.erh-render-context [class*=" dashicons-"],
.erh-render-context [class^="dashicons-"],
.ehq-v2 .dashicons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
    flex: 0 0 auto;
}
.erh-render-context .btn .dashicons,
.erh-render-context .erh-front-button .dashicons,
.erh-render-context .erh-action-link .dashicons,
.erh-render-context .erh-front-nav-link .dashicons,
.ehq-v2 .ehq-btn .dashicons,
.ehq-v2 .ehq-nav-link .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}
.erh-render-context .erh-panel-heading .dashicons,
.erh-render-context .erh-section-header .dashicons,
.erh-render-context .erh-front-panel-heading .dashicons,
.ehq-v2 .ehq-card-heading .dashicons {
    width: 22px;
    height: 22px;
    font-size: 22px;
    color: var(--ehq-primary);
}
.erh-render-context .erh-state .dashicons,
.erh-render-context .erh-empty-state .dashicons,
.ehq-v2 .ehq-state .dashicons {
    width: 48px !important;
    height: 48px !important;
    font-size: 48px !important;
    color: var(--ehq-text-soft);
    display: block;
    margin: 0 auto var(--ehq-space-3);
}

/* ──────────────────────────────────────────────────────────────────────
   17 — NOTICES (calm)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-notice,
.erh-render-context .notice,
.erh-render-context .updated,
.erh-render-context .error,
.ehq-v2 .ehq-notice {
    padding: var(--ehq-space-3) var(--ehq-space-4);
    border-radius: var(--ehq-radius-md);
    margin: var(--ehq-space-3) 0;
    font-size: 13px;
    border-left: 4px solid var(--ehq-primary);
    background: var(--ehq-primary-soft);
    color: var(--ehq-text);
    box-shadow: none;
}
.erh-render-context .error,
.erh-render-context .notice-error,
.ehq-v2 .ehq-notice.is-error {
    border-left-color: var(--ehq-danger);
    background: var(--ehq-danger-soft);
}
.erh-render-context .updated,
.erh-render-context .notice-success,
.ehq-v2 .ehq-notice.is-success {
    border-left-color: var(--ehq-success);
    background: var(--ehq-success-soft);
}

/* ──────────────────────────────────────────────────────────────────────
   18 — MODAL (single canonical pattern)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-modal,
.erh-modal,
.ehq-v2 .ehq-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(14, 26, 54, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: var(--ehq-space-4);
    overflow-y: auto;
}
.erh-modal[hidden],
.ehq-modal[hidden] { display: none !important; }
.erh-modal.is-visible,
.erh-modal[aria-hidden="false"]:not([hidden]),
.ehq-modal.is-visible,
.ehq-modal[aria-hidden="false"]:not([hidden]) {
    display: flex;
}
.erh-render-context .erh-modal-dialog,
.erh-render-context .erh-modal-card,
.erh-modal-dialog,
.erh-modal-card,
.ehq-v2 .ehq-modal-card {
    position: relative;
    background: var(--ehq-card);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-lg);
    padding: var(--ehq-space-8);
    max-width: 560px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    overflow: auto;
    border: 1px solid var(--ehq-border);
}
.erh-modal-head,
.ehq-v2 .ehq-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    margin-bottom: var(--ehq-space-4);
    padding-bottom: var(--ehq-space-3);
    border-bottom: 1px solid var(--ehq-border);
}
.erh-modal-actions,
.ehq-v2 .ehq-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--ehq-space-3);
    margin-top: var(--ehq-space-6);
    flex-wrap: wrap;
    padding-top: var(--ehq-space-3);
    border-top: 1px solid var(--ehq-border);
}
.erh-modal-close,
.ehq-v2 .ehq-modal-close {
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    color: var(--ehq-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    min-height: auto;
}
.erh-modal-close:hover { color: var(--ehq-text); }

/* ──────────────────────────────────────────────────────────────────────
   19 — DRAWER (responsive width)
   ────────────────────────────────────────────────────────────────────── */
.erh-drawer,
.erh-contract-import-drawer,
.ehq-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(480px, 100vw);
    background: var(--ehq-card);
    box-shadow: var(--ehq-shadow-lg);
    z-index: 99999;
    display: none;
    flex-direction: column;
    padding: 0;
    border-left: 1px solid var(--ehq-border);
}
.erh-drawer[hidden],
.ehq-drawer[hidden] { display: none !important; }
.erh-drawer.is-visible,
.erh-drawer[aria-hidden="false"]:not([hidden]),
.ehq-drawer.is-visible,
.ehq-drawer[aria-hidden="false"]:not([hidden]) {
    display: flex;
}
.erh-drawer-head,
.ehq-drawer-head {
    min-height: 56px;
    padding: var(--ehq-space-4) var(--ehq-space-6);
    border-bottom: 1px solid var(--ehq-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    background: var(--ehq-surface);
}
.erh-drawer-body,
.ehq-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--ehq-space-6);
}
.erh-drawer-foot,
.ehq-drawer-foot {
    min-height: 64px;
    padding: var(--ehq-space-3) var(--ehq-space-6);
    border-top: 1px solid var(--ehq-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--ehq-space-3);
    flex: 0 0 auto;
    background: var(--ehq-surface-alt);
}

/* ──────────────────────────────────────────────────────────────────────
   20 — STATE PAGES (empty / loading / denied / error)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-state,
.erh-render-context .erh-empty-state,
.erh-state,
.ehq-v2 .ehq-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--ehq-text-muted);
    padding: var(--ehq-space-8) var(--ehq-space-4);
    background: var(--ehq-card);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-sm);
    margin: var(--ehq-space-4) auto;
    max-width: 560px;
    width: 100%;
    min-height: 320px;
}
.erh-render-context .erh-state.is-error,
.erh-render-context .erh-state.is-denied,
.ehq-v2 .ehq-state.is-error,
.ehq-v2 .ehq-state.is-denied { max-width: 480px; }
.erh-render-context .erh-state.is-error,
.ehq-v2 .ehq-state.is-error { min-height: 360px; }
.erh-state h2,
.ehq-v2 .ehq-state h2 { margin: 0 0 var(--ehq-space-2); color: var(--ehq-text); }
.erh-state p,
.ehq-v2 .ehq-state p { margin: 0 0 var(--ehq-space-6); max-width: 40ch; }
.erh-state .actions,
.erh-state .erh-state-actions,
.ehq-v2 .ehq-state .ehq-state-actions {
    display: flex;
    gap: var(--ehq-space-3);
    justify-content: center;
    flex-wrap: wrap;
}
.erh-state .dashicons.is-danger,
.ehq-v2 .ehq-state .dashicons.is-danger { color: var(--ehq-danger); }
.erh-state .dashicons.is-success,
.ehq-v2 .ehq-state .dashicons.is-success { color: var(--ehq-success); }

/* Spinner */
.erh-spinner,
.ehq-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--ehq-border);
    border-top-color: var(--ehq-primary);
    border-radius: 50%;
    animation: ehq-spin 1s linear infinite;
    margin: 0 auto var(--ehq-space-3);
}
@keyframes ehq-spin { to { transform: rotate(360deg); } }
.erh-render-context .btn[data-loading="true"]::after,
.ehq-v2 .ehq-btn[data-loading="true"]::after {
    content: "";
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ehq-spin 0.8s linear infinite;
    margin-left: var(--ehq-space-2);
    display: inline-block;
}

/* Skeleton shimmer */
.erh-skeleton,
.ehq-skeleton {
    background: linear-gradient(90deg, var(--ehq-surface-alt) 0%, var(--ehq-border) 50%, var(--ehq-surface-alt) 100%);
    background-size: 200% 100%;
    animation: ehq-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--ehq-radius-sm);
    min-height: 14px;
    margin: 6px 0;
}
@keyframes ehq-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ──────────────────────────────────────────────────────────────────────
   21 — AUTH SHELL (Login, Lost, Reset, Success, Error, Session-expired)
   ────────────────────────────────────────────────────────────────────── */
.auth-shell,
.ehq-auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: var(--ehq-space-4);
    background: var(--ehq-bg);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(15, 76, 255, 0.10) 0%, transparent 35%),
        radial-gradient(circle at 100% 100%, rgba(109, 77, 255, 0.10) 0%, transparent 35%);
    font-family: var(--ehq-font-sans);
    color: var(--ehq-text);
}
.auth-card,
.ehq-auth-card {
    width: min(440px, calc(100vw - 32px));
    padding: var(--ehq-space-8);
    background: var(--ehq-card);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-lg);
    display: flex;
    flex-direction: column;
    gap: var(--ehq-space-4);
}
.auth-logo,
.ehq-auth-logo {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    color: var(--ehq-primary);
}
.auth-logo img,
.ehq-auth-logo img { max-height: 64px; width: auto; }
.auth-card h1,
.ehq-auth-card h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--ehq-text);
    text-align: center;
}
.auth-helper,
.ehq-auth-helper {
    margin: 0;
    color: var(--ehq-text-muted);
    font-size: 13px;
    text-align: center;
}
.auth-msg,
.ehq-auth-msg {
    min-height: 40px;
    border-radius: var(--ehq-radius-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    transition: background .15s;
}
.auth-msg.is-error,
.ehq-auth-msg.is-error {
    min-height: 40px;
    padding: 10px 14px;
    background: var(--ehq-danger-soft);
    border-left: 4px solid var(--ehq-danger);
    color: var(--ehq-text);
}
.auth-msg.is-success,
.ehq-auth-msg.is-success {
    min-height: 40px;
    padding: 10px 14px;
    background: var(--ehq-success-soft);
    border-left: 4px solid var(--ehq-success);
    color: var(--ehq-text);
}
.auth-field,
.ehq-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-field label,
.ehq-auth-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ehq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}
.auth-field input,
.auth-field select,
.ehq-auth-field input {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--ehq-border-strong);
    border-radius: var(--ehq-radius-sm);
    font-size: 14px;
    width: 100%;
    background: var(--ehq-surface);
    color: var(--ehq-text);
    font-family: inherit;
}
.auth-field input:focus,
.ehq-auth-field input:focus {
    outline: none;
    border-color: var(--ehq-primary);
    box-shadow: var(--ehq-ring-focus);
}
.auth-card .btn-primary,
.auth-card .auth-submit,
.ehq-auth-card .ehq-auth-submit {
    width: 100%;
    height: 48px;
    min-height: 48px;
    background: var(--ehq-primary);
    border: 1px solid var(--ehq-primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--ehq-radius-sm);
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .05s;
    font-family: inherit;
}
.auth-card .btn-primary:hover,
.auth-card .auth-submit:hover,
.ehq-auth-card .ehq-auth-submit:hover {
    background: var(--ehq-primary-hover);
    border-color: var(--ehq-primary-hover);
    box-shadow: 0 4px 14px rgba(15, 76, 255, 0.28);
}
.auth-card .auth-submit:active { transform: translateY(1px); }
.auth-card .auth-submit[disabled],
.ehq-auth-card .ehq-auth-submit[disabled] { opacity: .55; cursor: not-allowed; }
.auth-links,
.ehq-auth-links {
    display: flex;
    justify-content: space-between;
    gap: var(--ehq-space-3);
    font-size: 12px;
    color: var(--ehq-text-muted);
    flex-wrap: wrap;
}
.auth-links a,
.ehq-auth-links a {
    color: var(--ehq-primary);
    text-decoration: none;
    font-weight: 500;
}
.auth-links a:hover,
.ehq-auth-links a:hover { text-decoration: underline; }

/* Password strength bar */
.auth-strength,
.ehq-auth-strength {
    height: 6px;
    border-radius: 3px;
    background: var(--ehq-border);
    overflow: hidden;
}
.auth-strength > span,
.ehq-auth-strength > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--ehq-danger);
    transition: width .25s, background .25s;
}
.auth-strength.is-medium > span,
.ehq-auth-strength.is-medium > span { width: 50%; background: var(--ehq-warning); }
.auth-strength.is-strong > span,
.ehq-auth-strength.is-strong > span { width: 100%; background: var(--ehq-success); }

/* ──────────────────────────────────────────────────────────────────────
   22 — THEME CONSOLE HOST (dark shell wrapper from theme)
   ────────────────────────────────────────────────────────────────────── */
.ehq-front-console-host .erh-render-context,
.erh-front-shell .erh-render-context {
    color: var(--ehq-text);
    background: transparent;
}

/* ──────────────────────────────────────────────────────────────────────
   23 — RESPONSIVE BREAKPOINTS
   Large desktop ≥1440 — default rules above (5 KPI, 2 widgets, etc.)
   ────────────────────────────────────────────────────────────────────── */

/* Desktop / laptop 1024–1439 (same as default — explicit for clarity) */
@media (max-width: 1439px) {
    .erh-render-context,
    .ehq-v2 {
        padding-inline: clamp(16px, 2vw, 32px);
    }
}

/* Tablet 768–1023 */
@media (max-width: 1023px) {
    .erh-render-context,
    .ehq-v2 {
        padding-inline: clamp(16px, 2vw, 24px);
    }
    .erh-render-context .erh-kpi-strip,
    .erh-render-context .erh-kpi-grid,
    .erh-render-context .erh-kpi-row,
    .ehq-v2 .ehq-kpi-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .erh-render-context .erh-mini-cards,
    .erh-render-context .erh-catalog-grid,
    .ehq-v2 .ehq-mini-cards {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .erh-render-context .erh-widget-grid,
    .erh-render-context .erh-dashboard-main,
    .erh-render-context .erh-dashboard-panels,
    .ehq-v2 .ehq-widget-grid {
        grid-template-columns: 1fr;
    }
    .erh-render-context .erh-detail-grid,
    .ehq-v2 .ehq-detail-grid {
        grid-template-columns: 1fr;
    }
    .erh-render-context .erh-form-grid,
    .ehq-v2 .ehq-form-grid {
        grid-template-columns: 1fr;
    }
    /* Hero allowed to grow */
    .erh-render-context .erh-page-hero,
    .ehq-v2 .ehq-hero {
        min-height: auto;
        max-height: 140px;
    }
    /* Nav becomes scroll-x */
    .erh-render-context .erh-front-nav,
    .erh-render-context .ehq-module-toolbar,
    .erh-render-context .ehq-nav,
    .ehq-v2 .ehq-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .erh-render-context .erh-front-nav-link,
    .ehq-v2 .ehq-nav-link {
        flex: 0 0 auto;
    }
}

/* Small tablet 480–767 */
@media (max-width: 767px) {
    .erh-render-context,
    .ehq-v2 {
        padding-inline: 20px;
        padding-block: 24px;
    }
    .erh-render-context .erh-kpi-strip,
    .erh-render-context .erh-kpi-grid,
    .erh-render-context .erh-kpi-row,
    .ehq-v2 .ehq-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .erh-render-context .erh-mini-cards,
    .erh-render-context .erh-catalog-grid,
    .ehq-v2 .ehq-mini-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .erh-render-context .erh-kpi-card,
    .ehq-v2 .ehq-kpi-card {
        min-height: 120px;
        padding: var(--ehq-space-4);
    }
    .erh-render-context .erh-mini-card,
    .ehq-v2 .ehq-mini-card {
        min-height: 76px;
        padding: var(--ehq-space-3);
    }
    .erh-render-context .erh-kpi-value,
    .ehq-v2 .ehq-kpi-value { font-size: 22px; }
    .erh-render-context .erh-mini-card .value,
    .ehq-v2 .ehq-mini-card .value { font-size: 20px; }

    .erh-render-context .erh-page-hero,
    .ehq-v2 .ehq-hero {
        flex-wrap: wrap;
        padding: var(--ehq-space-4);
        gap: var(--ehq-space-3);
    }
    .erh-render-context .erh-form-card,
    .ehq-v2 .ehq-form-card {
        padding: var(--ehq-space-4);
    }
    .auth-card,
    .ehq-auth-card {
        padding: var(--ehq-space-6);
    }
    .auth-logo,
    .ehq-auth-logo {
        min-height: 48px;
    }
    .erh-state,
    .ehq-v2 .ehq-state {
        padding: var(--ehq-space-6) var(--ehq-space-4);
        min-height: 280px;
    }
    .erh-state .dashicons,
    .ehq-v2 .ehq-state .dashicons {
        width: 40px !important;
        height: 40px !important;
        font-size: 40px !important;
    }
}

/* Mobile <480 */
@media (max-width: 479px) {
    .erh-render-context,
    .ehq-v2 {
        padding-inline: 16px;
        padding-block: 20px;
    }
    .erh-render-context .erh-kpi-strip,
    .erh-render-context .erh-kpi-grid,
    .erh-render-context .erh-kpi-row,
    .ehq-v2 .ehq-kpi-strip {
        grid-template-columns: 1fr;
    }
    .erh-render-context .erh-mini-cards,
    .erh-render-context .erh-catalog-grid,
    .ehq-v2 .ehq-mini-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .erh-render-context .erh-page-hero,
    .ehq-v2 .ehq-hero {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .erh-render-context .erh-brand-mark,
    .ehq-v2 .ehq-hero-logo {
        width: 56px;
        height: 56px;
    }
    .erh-render-context h1,
    .ehq-v2 h1 { font-size: 22px; }
    .erh-render-context .erh-toolbar,
    .erh-render-context .erh-filter-toolbar,
    .ehq-v2 .ehq-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .erh-render-context .erh-toolbar > .btn,
    .erh-render-context .erh-filter-toolbar > .btn,
    .ehq-v2 .ehq-toolbar > .ehq-btn {
        width: 100%;
    }
    .erh-render-context .erh-form-actions,
    .ehq-v2 .ehq-form-actions {
        flex-direction: column;
    }
    .erh-render-context .erh-form-actions .btn,
    .ehq-v2 .ehq-form-actions .ehq-btn {
        width: 100%;
    }
    /* Drawer takes full screen */
    .erh-drawer,
    .erh-contract-import-drawer,
    .ehq-drawer {
        width: 100vw;
    }
    /* Modal full bleed */
    .erh-modal-card,
    .ehq-v2 .ehq-modal-card {
        padding: var(--ehq-space-5);
    }
    .auth-card,
    .ehq-auth-card {
        padding: var(--ehq-space-5);
    }
}

/* ──────────────────────────────────────────────────────────────────────
   24 — HARD OVERRIDES (v0.3.2 — beat legacy `!important` in plugin admin.css)
   admin.css (line 2068+) contains:
     .erh-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 196px), 1fr)) !important }
     .erh-kpi-card { padding: 12px !important; min-height: 88px !important }
   These rules were sized for old narrow .wrap containers. Inside the v2 fluid
   shell (1700+ wide) they produce 8 cards per row + asymmetric padding. We
   re-assert the v2 grid + uniform card padding with `!important` AND higher
   specificity so the theme always wins.
   ────────────────────────────────────────────────────────────────────── */
/* !important (A13): required — overrides legacy `!important` in plugin
   admin.css:2068+. CSS specificity cannot beat another rule's `!important`;
   only `!important` + higher specificity wins. Keep until plugin admin.css
   drops its `!important` on .erh-kpi-grid / .erh-kpi-card. */
.erh-render-context .erh-kpi-strip,
.erh-render-context .erh-kpi-grid,
.erh-render-context .erh-kpi-row,
.ehq-v2 .ehq-kpi-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: var(--ehq-space-4) !important;
}
.erh-render-context .erh-mini-cards,
.erh-render-context .erh-catalog-grid,
.ehq-v2 .ehq-mini-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: var(--ehq-space-4) !important;
}
.erh-render-context .erh-widget-grid,
.erh-render-context .erh-dashboard-main,
.erh-render-context .erh-dashboard-panels,
.ehq-v2 .ehq-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--ehq-space-4) !important;
}

/* Uniform KPI / mini-card padding & min-height — override legacy !important */
.erh-render-context .erh-kpi-card,
.erh-render-context .erh-stat-card,
.ehq-v2 .ehq-kpi-card {
    padding: var(--ehq-space-5) !important;
    min-height: 140px !important;
    gap: var(--ehq-space-2);
}
.erh-render-context .erh-mini-card,
.ehq-v2 .ehq-mini-card {
    padding: var(--ehq-space-4) !important;
    min-height: 80px !important;
}

/* Responsive collapse for KPI / mini (re-asserted with !important) */
@media (max-width: 1023px) {
    .erh-render-context .erh-kpi-strip,
    .erh-render-context .erh-kpi-grid,
    .erh-render-context .erh-kpi-row,
    .ehq-v2 .ehq-kpi-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .erh-render-context .erh-widget-grid,
    .erh-render-context .erh-dashboard-main,
    .erh-render-context .erh-dashboard-panels,
    .ehq-v2 .ehq-widget-grid {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 767px) {
    .erh-render-context .erh-kpi-strip,
    .erh-render-context .erh-kpi-grid,
    .erh-render-context .erh-kpi-row,
    .ehq-v2 .ehq-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .erh-render-context .erh-mini-cards,
    .erh-render-context .erh-catalog-grid,
    .ehq-v2 .ehq-mini-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 479px) {
    .erh-render-context .erh-kpi-strip,
    .erh-render-context .erh-kpi-grid,
    .erh-render-context .erh-kpi-row,
    .ehq-v2 .ehq-kpi-strip {
        grid-template-columns: 1fr !important;
    }
    .erh-render-context .erh-mini-cards,
    .erh-render-context .erh-catalog-grid,
    .ehq-v2 .ehq-mini-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   25 — DOUBLE-CONTAINER FIX (v0.3.3) — Earnings Timeline
   The plugin's render_dashboard_body emits:
       <div class="erh-earnings-timeline">    ← outer wrapper, has its own card style (old polish CSS)
         <div class="erh-panel erh-chart-panel">  ← inner card, has v2 card style
           ...
         </div>
       </div>
   Both layers had border + background + padding → "container in a container".
   Neutralize the outer wrapper so only the inner panel reads as a card. The
   other three widget wrappers (.erh-top-payees, .erh-top-tracks,
   .erh-top-stores) do NOT have a nested .erh-panel — they ARE the card —
   so they keep their styling.
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-earnings-timeline {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    height: 100%;
}
.erh-render-context .erh-earnings-timeline > .erh-panel,
.erh-render-context .erh-earnings-timeline > .erh-chart-panel {
    height: 100%;
    margin: 0 !important;
}

/* ──────────────────────────────────────────────────────────────────────
   26 — DRAWER ENGINE (v0.4.0) — shared overlay + drawer + toast
   Used by erh-drawer.js. Single source of truth for all drawer UX.
   ────────────────────────────────────────────────────────────────────── */
.erh-drawer-shell {
    position: fixed; inset: 0;
    z-index: 99998;
    display: none;
}
.erh-drawer-shell.is-visible { display: block; }
.erh-drawer-shell[hidden] { display: none !important; }

.erh-drawer-shell .erh-drawer-overlay {
    position: absolute; inset: 0;
    background: rgba(14, 26, 54, 0.42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: erh-drawer-fade-in .18s ease both;
}
.erh-drawer-shell .erh-drawer {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(480px, 100vw);
    background: var(--ehq-card, #fff);
    box-shadow: -16px 0 48px rgba(14, 26, 54, 0.18);
    display: flex;
    flex-direction: column;
    animation: erh-drawer-slide-in .24s cubic-bezier(.2,.7,.3,1) both;
    border-left: 1px solid var(--ehq-border, var(--ehq-border));
}
.erh-drawer-shell .erh-drawer-form {
    display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
    margin: 0;
}
.erh-drawer-shell .erh-drawer-head {
    min-height: 56px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--ehq-border, var(--ehq-border));
    display: flex; align-items: center; justify-content: space-between;
    flex: 0 0 auto;
    background: var(--ehq-surface, #fff);
}
.erh-drawer-shell .erh-drawer-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
}
.erh-drawer-shell .erh-drawer-head p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--ehq-text-muted, var(--ehq-text-muted));
}
.erh-drawer-shell .erh-drawer-close {
    width: 36px; height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 8px;
    flex: 0 0 auto;
}
.erh-drawer-shell .erh-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}
.erh-drawer-shell .erh-drawer-foot {
    min-height: 64px;
    padding: 12px 24px;
    border-top: 1px solid var(--ehq-border, var(--ehq-border));
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
    background: var(--ehq-surface-alt, var(--ehq-surface-alt));
    flex-wrap: wrap;
}
.erh-drawer-shell .erh-drawer-foot-right {
    display: flex; gap: 8px; margin-left: auto;
}
.erh-drawer-shell .erh-drawer-msg {
    margin: 0 24px 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    border-left: 4px solid var(--ehq-danger, var(--ehq-danger));
    background: var(--ehq-danger-soft, var(--ehq-danger-soft));
    color: var(--ehq-text, var(--ehq-text));
}
.erh-drawer-shell .erh-drawer-msg.is-success {
    border-left-color: var(--ehq-success, var(--ehq-success));
    background: var(--ehq-success-soft, var(--ehq-success-soft));
}
.erh-drawer-shell [data-erh-drawer-save][data-loading="true"] {
    opacity: .7;
    pointer-events: none;
    position: relative;
}
.erh-drawer-shell [data-erh-drawer-save][data-loading="true"]::after {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ehq-spin .8s linear infinite;
    vertical-align: middle;
}

/* Body scroll lock when drawer is open */
body.erh-drawer-is-open,
body.erh-modal-is-open {
    overflow: hidden;
}

@media (max-width: 1023px) {
    .erh-drawer-shell .erh-drawer { width: min(480px, 90vw); }
}
@media (max-width: 767px) {
    .erh-drawer-shell .erh-drawer { width: 100vw; }
    .erh-drawer-shell .erh-drawer-foot { flex-direction: column-reverse; align-items: stretch; }
    .erh-drawer-shell .erh-drawer-foot-right { width: 100%; justify-content: space-between; margin-left: 0; }
}

@keyframes erh-drawer-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
@keyframes erh-drawer-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ──────────────────────────────────────────────────────────────────────
   27 — TOAST (notification)
   ────────────────────────────────────────────────────────────────────── */
.erh-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100001;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--ehq-text, var(--ehq-text));
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(14, 26, 54, 0.28);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s;
    max-width: 380px;
}
.erh-toast.is-visible { opacity: 1; transform: translateY(0); }
.erh-toast.is-success { background: var(--ehq-success, var(--ehq-success)); }
.erh-toast.is-error   { background: var(--ehq-danger, var(--ehq-danger)); }
.erh-toast.is-warning { background: var(--ehq-warning, var(--ehq-warning)); }

/* ──────────────────────────────────────────────────────────────────────
   28 — DRAWER FORM PRIMITIVES (used inside drawer body)
   ────────────────────────────────────────────────────────────────────── */
.erh-drawer-shell .erh-drawer-body .ehq-field {
    margin-block: 16px;
}
.erh-drawer-shell .erh-drawer-body .ehq-field:first-child { margin-top: 0; }
.erh-drawer-shell .erh-drawer-body .ehq-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ehq-space-4, 16px);
    align-items: start;
}
.erh-drawer-shell .erh-drawer-body .ehq-field-wide {
    grid-column: 1 / -1;
}
.erh-drawer-shell .erh-drawer-body .ehq-field-helper {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ehq-text-muted, #64748b);
}
.erh-drawer-shell .erh-drawer-body .ehq-control-fluid {
    width: 100%;
}
.erh-drawer-shell .erh-create-alias-btn {
    margin-top: var(--ehq-space-2, 8px);
}
.erh-drawer-shell .erh-loading-note {
    padding: var(--ehq-space-6, 24px);
}
.erh-drawer-shell .erh-break-all {
    word-break: break-all;
}
.erh-drawer-shell .ehq-code-block {
    text-align: left;
    background: var(--ehq-surface-alt, #f1f5fb);
    padding: var(--ehq-space-3, 12px);
    border-radius: var(--ehq-radius-sm, 6px);
    overflow-x: auto;
    max-height: 300px;
    font-size: 12px;
}
.erh-drawer-shell .ehq-drawer-divider {
    border-top: 1px solid var(--ehq-border, #e2e8f0);
    margin: var(--ehq-space-4, 16px) 0;
}
.erh-drawer-shell .ehq-drawer-section-title {
    margin: var(--ehq-space-4, 16px) 0 var(--ehq-space-2, 8px);
    font-size: 13px;
    text-transform: uppercase;
    color: var(--ehq-text-muted, #5b6478);
}
.erh-drawer-shell .erh-inline-actions {
    margin-top: var(--ehq-space-3, 12px);
}
.erh-drawer-shell .erh-flex-input {
    flex: 1 1 220px;
}
.erh-drawer-shell .erh-amount-input {
    width: 90px;
    min-width: 90px;
}
.erh-drawer-shell .erh-table-wrap.is-compact-scroll {
    max-height: 240px;
    overflow-y: auto;
}
.erh-drawer-shell .ehq-table.is-compact {
    font-size: 12px;
}
.erh-drawer-shell .erh-clickable-summary {
    cursor: pointer;
}
.erh-drawer-shell .erh-danger-list {
    margin: var(--ehq-space-2, 8px) 0 0 var(--ehq-space-5, 20px);
    padding: 0;
}
.erh-drawer-shell .erh-drawer-body label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ehq-text-muted, var(--ehq-text-muted));
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.erh-drawer-shell .erh-drawer-body input,
.erh-drawer-shell .erh-drawer-body select,
.erh-drawer-shell .erh-drawer-body textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--ehq-border-strong, var(--ehq-border-strong));
    border-radius: 6px;
    background: #fff;
    color: var(--ehq-text, var(--ehq-text));
    font-size: 14px;
    font-family: inherit;
}
.erh-drawer-shell .erh-drawer-body input:focus,
.erh-drawer-shell .erh-drawer-body select:focus,
.erh-drawer-shell .erh-drawer-body textarea:focus {
    outline: none; /* replaced by tokenised focus ring below */
    border-color: var(--ehq-primary);
    box-shadow: var(--ehq-ring-focus); /* v0.4.17 polish: was hardcoded rgba */
}
.erh-drawer-shell .erh-drawer-body .ehq-field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 767px) {
    .erh-drawer-shell .erh-drawer-body .ehq-form-grid,
    .erh-drawer-shell .erh-drawer-body .ehq-field-row { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────────────────────────
   29 — ACTION BAR (page-level, above tables)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-actionbar,
.ehq-v2 .ehq-actionbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-block: 16px;
    padding: 12px;
    background: var(--ehq-surface-alt, var(--ehq-surface-alt));
    border: 1px solid var(--ehq-border, var(--ehq-border));
    border-radius: 10px;
}
.erh-render-context .erh-actionbar .erh-actionbar-search,
.ehq-v2 .ehq-actionbar .ehq-actionbar-search {
    flex: 1 1 280px;
    min-width: 240px;
    margin: 0;
}
.erh-render-context .erh-actionbar .erh-actionbar-filters,
.ehq-v2 .ehq-actionbar .ehq-actionbar-filters {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    margin: 0;
}
.erh-render-context .erh-actionbar .erh-actionbar-actions,
.ehq-v2 .ehq-actionbar .ehq-actionbar-actions {
    display: flex; gap: 8px; margin-left: auto;
}

/* ──────────────────────────────────────────────────────────────────────
   30 — DANGER ZONE (settings)
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-danger-zone {
    margin-top: 32px;
    padding: 20px;
    border: 1px solid var(--ehq-danger, var(--ehq-danger));
    border-radius: 12px;
    background: var(--ehq-danger-soft, var(--ehq-danger-soft));
}
.erh-render-context .erh-danger-zone h2 {
    margin: 0 0 8px;
    color: var(--ehq-danger, var(--ehq-danger));
    font-size: 15px;
}
.erh-render-context .erh-danger-zone p {
    color: var(--ehq-text, var(--ehq-text));
    margin: 0 0 16px;
    font-size: 13px;
}

/* ─────────────────────────────────────────────────────────────────────
   Section 31 — Chunked batch progress bar (v0.4.1)
   Used inside drawers by ERH plugin's chunked AJAX flows
   (mapping-automate, mapping-apply-rules, allocations-run,
    allocations-run-all). Plugin v1.6.4+ injects a minimal inline
   stylesheet as a fallback when this section isn't loaded.
   ───────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-chunk-progress,
.ehq-v2 .erh-chunk-progress,
body.ehq3 .erh-chunk-progress {
    align-items: center;
    display: grid;
    gap: var(--ehq-space-3, 12px);
    grid-template-columns: 58px minmax(0, 1fr);
    padding: var(--ehq-space-4, 16px) 0;
}
.erh-render-context .erh-job-loader,
.ehq-v2 .erh-job-loader,
body.ehq3 .erh-job-loader {
    animation: erh-job-loader-spin 1.35s linear infinite;
    aspect-ratio: 1;
    background: conic-gradient(from 90deg, var(--ehq-primary, #f2cf2f), #36c98a, #5b9dff, var(--ehq-primary, #f2cf2f));
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 12px 28px rgba(0,0,0,.26);
    display: grid;
    place-items: center;
    width: 48px;
}
.erh-render-context .erh-job-loader::after,
.ehq-v2 .erh-job-loader::after,
body.ehq3 .erh-job-loader::after {
    background: var(--ehq-card, #0b0e16);
    border-radius: 50%;
    content: "";
    height: 32px;
    width: 32px;
}
.erh-render-context .erh-job-loader span,
.ehq-v2 .erh-job-loader span,
body.ehq3 .erh-job-loader span {
    display: none;
}
.erh-render-context .erh-chunk-copy,
.ehq-v2 .erh-chunk-copy,
body.ehq3 .erh-chunk-copy {
    min-width: 0;
}
.erh-render-context .ehq-progress-bar-wrap,
.ehq-v2 .ehq-progress-bar-wrap,
body.ehq3 .ehq-progress-bar-wrap {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,.08);
    border-radius: var(--ehq-radius-sm);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
    overflow: hidden;
    margin: var(--ehq-space-2) 0;
}
.erh-render-context .ehq-progress-bar,
.ehq-v2 .ehq-progress-bar,
body.ehq3 .ehq-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--ehq-primary, #f2cf2f), #36c98a, #5b9dff);
    border-radius: var(--ehq-radius-sm);
    transition: width 0.2s ease;
    width: 0%;
}
.erh-render-context .erh-chunk-label,
.erh-render-context .erh-chunk-count,
.ehq-v2 .erh-chunk-label,
.ehq-v2 .erh-chunk-count,
body.ehq3 .erh-chunk-label,
body.ehq3 .erh-chunk-count {
    font-size: 13px;
    margin: 0;
}
.erh-render-context .erh-chunk-label,
.ehq-v2 .erh-chunk-label,
body.ehq3 .erh-chunk-label {
    color: var(--ehq-text, #fff);
    font-weight: 800;
}
.erh-render-context .erh-chunk-count,
.ehq-v2 .erh-chunk-count,
body.ehq3 .erh-chunk-count {
    color: var(--ehq-text-muted, rgba(255,255,255,.72));
}
@keyframes erh-job-loader-spin {
    to { transform: rotate(360deg); }
}
.erh-frontend-spinner {
    align-items: center;
    background: rgba(5, 7, 13, .74);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0,0,0,.42);
    display: none;
    height: 56px;
    justify-content: center;
    position: fixed;
    right: 22px;
    top: 22px;
    width: 56px;
    z-index: 100001;
}
.erh-frontend-spinner.is-visible {
    display: flex;
}
.erh-frontend-spinner-ring {
    height: 34px;
    overflow: visible;
    transform: rotate(-90deg);
    width: 34px;
}
.erh-frontend-spinner-track,
.erh-frontend-spinner-fill {
    fill: none;
    stroke-width: 5;
}
.erh-frontend-spinner-track {
    stroke: rgba(255,255,255,.14);
}
.erh-frontend-spinner-fill {
    animation: erh-spinner-dash 1.15s ease-in-out infinite;
    stroke: var(--ehq-primary, #f2cf2f);
    stroke-dasharray: 76 76;
    stroke-linecap: round;
}
@keyframes erh-spinner-dash {
    0% { stroke-dashoffset: 72; }
    50% { stroke-dashoffset: 22; }
    100% { stroke-dashoffset: 72; }
}
@media (max-width: 560px) {
    .erh-render-context .erh-chunk-progress,
    .ehq-v2 .erh-chunk-progress,
    body.ehq3 .erh-chunk-progress {
        grid-template-columns: 1fr;
    }
    .erh-frontend-spinner {
        right: 14px;
        top: 14px;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   Section 32 — Catalog track drawer (v0.4.2)
   Companion to ë • distribution v1.7.4 catalog-track-detail drawer.
   Styles the read-only fields, raw artist-line block, alias badge.
   ───────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-artist-line-raw,
.ehq-v2 .erh-artist-line-raw {
    font-size: 13px;
    color: var(--ehq-text-muted, var(--ehq-text-muted));
    background: var(--ehq-surface-alt, var(--ehq-surface-alt));
    border: 1px solid var(--ehq-border, var(--ehq-border));
    border-radius: var(--ehq-radius-sm, 6px);
    padding: var(--ehq-space-2, 8px) var(--ehq-space-3, 12px);
    word-break: break-word;
    margin-bottom: var(--ehq-space-2, 8px);
    font-family: var(--ehq-font-mono, monospace);
}
.erh-render-context .erh-artist-line-alias,
.ehq-v2 .erh-artist-line-alias {
    margin: var(--ehq-space-2, 8px) 0;
}
.erh-render-context .ehq-readonly,
.ehq-v2 .ehq-readonly {
    font-size: 14px;
    color: var(--ehq-text, var(--ehq-text));
    padding: 6px 0;
    border-bottom: 1px dashed var(--ehq-border, var(--ehq-border));
}
.erh-render-context .erh-contributors-summary,
.ehq-v2 .erh-contributors-summary {
    font-size: 14px;
    line-height: 1.8;
}
.erh-render-context .erh-contributors-summary .ehq-eyebrow,
.ehq-v2 .erh-contributors-summary .ehq-eyebrow {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ehq-text-soft, var(--ehq-text-soft));
    margin-right: var(--ehq-space-2, 8px);
    min-width: 48px;
}
.erh-render-context .erh-contrib-name,
.ehq-v2 .erh-contrib-name {
    color: var(--ehq-text, var(--ehq-text));
    font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────────────
   Section 33 — Auto-rule badge (v0.4.3)
   Companion to ë • distribution v1.8.0 label auto-split feature.
   Badge sits next to the payee name in the Contracts drawer for rows
   whose royalty_rule was inserted with source='auto' (label default).
   Disappears as soon as the user touches the % input (manual flip).
   ───────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-auto-badge,
.ehq-v2 .erh-auto-badge {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 2px 6px;
    border-radius: var(--ehq-radius-sm, 6px);
    background: var(--ehq-info-soft, #e0f2fe);
    color: var(--ehq-info, var(--ehq-info));
    vertical-align: middle;
    margin-left: var(--ehq-space-1, 4px);
    font-weight: 600;
    line-height: 1;
}

/* ─────────────────────────────────────────────────────────────────────
   Section 34 — Label badges + system-alias lock (v0.4.4)
   Companion to ë • distribution v1.9.0 label system overhaul.
   Adds the muted variant for the .erh-badge family + a tiny "locked"
   row treatment for system aliases in the Settings → Labels drawer.
   ───────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-badge.is-muted,
.ehq-v2 .erh-badge.is-muted,
.erh-render-context .ehq-badge.is-muted,
.ehq-v2 .ehq-badge.is-muted {
    background: var(--ehq-surface-alt, var(--ehq-surface-alt));
    color: var(--ehq-text-muted, var(--ehq-text-muted));
    border: 1px solid var(--ehq-border, var(--ehq-border));
}
.erh-render-context .erh-alias-locked,
.ehq-v2 .erh-alias-locked {
    font-size: 12px;
    color: var(--ehq-text-soft, var(--ehq-text-soft));
    display: inline-flex;
    align-items: center;
    gap: var(--ehq-space-1, 4px);
}
.erh-render-context .erh-alias-locked .dashicons,
.ehq-v2 .erh-alias-locked .dashicons {
    font-size: 14px; width: 14px; height: 14px;
}

/* ─────────────────────────────────────────────────────────────────────
   Section 35 — Section heading divider (v0.4.5)
   Used by ë • distribution v1.10.0 to separate Contracts & Splits from
   Payee Profiles on the Contracts page. Generic enough to be reused on
   any multi-section table page.
   ───────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-section-heading,
.erh-render-context .ehq-section-heading,
.ehq-v2 .erh-section-heading,
.ehq-v2 .ehq-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--ehq-space-3, 12px);
    border-bottom: 2px solid var(--ehq-border, var(--ehq-border));
    margin-bottom: var(--ehq-space-4, 16px);
}
.erh-render-context .erh-section-heading h2,
.erh-render-context .ehq-section-heading h2,
.ehq-v2 .erh-section-heading h2,
.ehq-v2 .ehq-section-heading h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ehq-text, var(--ehq-text));
    margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────
   Section 36 — Inline create-payee link (v0.4.6)
   Used by ë • distribution v1.10.2 inside the contracts splits drawer
   ([+ Add payee] button row) and inside any other drawer that needs a
   secondary "create new linked entity" affordance below a primary action.
   ───────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-create-payee-inline,
.ehq-v2 .erh-create-payee-inline {
    font-size: 13px;
    color: var(--ehq-primary, var(--ehq-primary));
    text-decoration: none;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
}
.erh-render-context .erh-create-payee-inline:hover,
.ehq-v2 .erh-create-payee-inline:hover {
    text-decoration: underline;
    background: var(--ehq-primary-soft, var(--ehq-primary-soft));
}

/* ─────────────────────────────────────────────────────────────────────
   Section 37 — Bulk action bar (v0.4.7)
   Used by ë • distribution v1.10.22 on the Contracts & Splits table for
   bulk-applying one split rule to N selected tracks.
   ───────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-bulk-bar,
.ehq-v2 .erh-bulk-bar {
    display: flex;
    align-items: center;
    gap: var(--ehq-space-3);
    padding: var(--ehq-space-3) var(--ehq-space-4);
    background: var(--ehq-primary-soft, rgba(59, 130, 246, 0.08));
    border: 1px solid var(--ehq-primary);
    border-radius: var(--ehq-radius-md);
    margin-bottom: var(--ehq-space-3);
    flex-wrap: wrap;
}
.erh-render-context .erh-bulk-bar #erh-bulk-count,
.erh-render-context .erh-bulk-bar .erh-bulk-count,
.erh-render-context .erh-bulk-bar [id$="-bulk-count"],
.ehq-v2 .erh-bulk-bar #erh-bulk-count,
.ehq-v2 .erh-bulk-bar .erh-bulk-count,
.ehq-v2 .erh-bulk-bar [id$="-bulk-count"] {
    font-size: 13px;
    font-weight: 500;
    color: var(--ehq-primary);
    flex: 1;
}

/* Bulk track list rendered inside the drawer body. Scrollable when long. */
.erh-render-context .erh-bulk-track-list,
.ehq-v2 .erh-bulk-track-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-sm, 6px);
    font-size: 13px;
}
.erh-render-context .erh-bulk-track-list li,
.ehq-v2 .erh-bulk-track-list li {
    padding: var(--ehq-space-2) var(--ehq-space-3);
    border-bottom: 1px solid var(--ehq-border);
}
.erh-render-context .erh-bulk-track-list li:last-child,
.ehq-v2 .erh-bulk-track-list li:last-child {
    border-bottom: none;
}

/* Checkbox column shared across bulk-action tables (Contracts, Mapping, …). */
.erh-render-context .table th.col-check,
.erh-render-context .table td.col-check,
.erh-render-context .erh-contracts-table th.col-check,
.erh-render-context .erh-contracts-table td.col-check,
.erh-render-context .erh-mapping-batches-table th.col-check,
.erh-render-context .erh-mapping-batches-table td.col-check,
.ehq-v2 .table th.col-check,
.ehq-v2 .table td.col-check,
.ehq-v2 .erh-contracts-table th.col-check,
.ehq-v2 .erh-contracts-table td.col-check,
.ehq-v2 .erh-mapping-batches-table th.col-check,
.ehq-v2 .erh-mapping-batches-table td.col-check {
    width: 36px;
    text-align: center;
}

/* Warning variant for ehq-notice (used by the mixed-artist banner). */
.erh-render-context .ehq-notice.is-warning,
.ehq-v2 .ehq-notice.is-warning {
    border-left-color: var(--ehq-warning, var(--ehq-warning));
    background: var(--ehq-warning-soft, #fff7e6);
}

/* ════════════════════════════════════════════════════════════════════
   §32 — TEMPLATES-V2 v1.3.0 COMPLIANCE SECTION
   ════════════════════════════════════════════════════════════════════
   Spec-compliant CSS class declarations. Every class here mirrors the
   authoritative spec at templates-v2/css/template.css (v1.3.0, 2026-05-18).
   Live plugin classes (.erh-* / .ehq-*) coexist for backward compat — they
   produce the same visual but are not authoritative.

   New components MUST use the names below (the spec names). Legacy prefixed
   classes are kept enqueued during the multi-session migration.

   Scoped to .erh-render-context and .ehq-v2 to avoid leaking into wp-admin
   globals. Rules untouched from spec are noted; rules adapted are commented.
   ──────────────────────────────────────────────────────────────────── */

/* — HERO — */
.erh-render-context .hero, .ehq-v2 .hero {
    min-height: 96px;
    display: flex; align-items: center;
    gap: var(--ehq-space-4);
    padding: var(--ehq-space-5) var(--ehq-space-6);
    background: linear-gradient(135deg, var(--ehq-surface) 0%, var(--ehq-surface-alt) 100%);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-md);
    margin-bottom: var(--ehq-space-6);
    flex-wrap: wrap;
}
.erh-render-context .hero-logo, .ehq-v2 .hero-logo {
    width: 72px; height: 72px;
    border-radius: var(--ehq-radius-md);
    background: linear-gradient(135deg, var(--ehq-primary) 0%, var(--ehq-accent) 100%);
    color: #fff; font-weight: 700; font-size: 24px; letter-spacing: 0;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
    box-shadow: 0 8px 20px rgba(15, 76, 255, 0.25);
}
.erh-render-context .hero-text, .ehq-v2 .hero-text { flex: 1 1 280px; min-width: 0; }
.erh-render-context .hero-text .eyebrow, .ehq-v2 .hero-text .eyebrow { margin-bottom: 4px; }
.erh-render-context .hero-text h1, .ehq-v2 .hero-text h1 { margin: 0 0 4px; }
.erh-render-context .hero-text p, .ehq-v2 .hero-text p { margin: 0; color: var(--ehq-text-muted); }
.erh-render-context .hero-actions, .ehq-v2 .hero-actions { display: flex; gap: var(--ehq-space-2); align-items: center; flex-wrap: wrap; flex: 0 0 auto; }
.erh-render-context .eyebrow, .ehq-v2 .eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ehq-text-soft); }
.erh-render-context .annot, .ehq-v2 .annot { color: var(--ehq-text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; margin: var(--ehq-space-4) 0 var(--ehq-space-2); }

/* — NAV TABS — */
.erh-render-context .nav-tabs, .ehq-v2 .nav-tabs {
    min-height: 56px;
    display: flex; align-items: center; gap: 4px;
    padding: var(--ehq-space-2);
    background: var(--ehq-surface);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-sm);
    margin-bottom: var(--ehq-space-8);
    flex-wrap: wrap;
}
.erh-render-context .nav-tab, .ehq-v2 .nav-tab {
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--ehq-radius-sm);
    color: var(--ehq-text); text-decoration: none;
    font-size: 13px; font-weight: 500; min-height: 40px;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.erh-render-context .nav-tab:hover, .ehq-v2 .nav-tab:hover { background: var(--ehq-surface-alt); color: var(--ehq-primary); }
.erh-render-context .nav-tab.is-active, .ehq-v2 .nav-tab.is-active {
    background: var(--ehq-primary-soft); color: var(--ehq-primary); font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 76, 255, 0.1);
}

/* — KPI STRIP / MINI CARDS — */
.erh-render-context .kpi-strip, .ehq-v2 .kpi-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--ehq-space-4); align-items: stretch; margin-block: var(--ehq-space-4); }
.erh-render-context .kpi-card, .ehq-v2 .kpi-card { min-height: 140px; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: var(--ehq-space-2); padding: var(--ehq-space-5); background: var(--ehq-card); border: 1px solid var(--ehq-border); border-radius: var(--ehq-radius-lg); box-shadow: var(--ehq-shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; overflow: hidden; text-decoration: none; color: inherit; }
.erh-render-context .kpi-card:hover, .ehq-v2 .kpi-card:hover { border-color: var(--ehq-primary-border); box-shadow: var(--ehq-shadow-md); transform: translateY(-1px); }
.erh-render-context .kpi-head, .ehq-v2 .kpi-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--ehq-space-2); }
.erh-render-context .kpi-label, .ehq-v2 .kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ehq-text-soft); }
.erh-render-context .kpi-icon, .ehq-v2 .kpi-icon { width: 22px; height: 22px; color: var(--ehq-primary); flex: 0 0 auto; }
.erh-render-context .kpi-value, .ehq-v2 .kpi-value { font-size: clamp(22px, 1.6vw + 8px, 30px); font-weight: 750; color: var(--ehq-text); line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.erh-render-context .kpi-sub, .ehq-v2 .kpi-sub { font-size: 12px; color: var(--ehq-text-muted); overflow-wrap: anywhere; }
.erh-render-context .mini-cards, .ehq-v2 .mini-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--ehq-space-4); align-items: stretch; margin-block: var(--ehq-space-4); }
.erh-render-context .mini-card, .ehq-v2 .mini-card { min-height: 80px; padding: var(--ehq-space-4); background: var(--ehq-card); border: 1px solid var(--ehq-border); border-radius: var(--ehq-radius-md); box-shadow: var(--ehq-shadow-sm); text-align: center; display: flex; flex-direction: column; justify-content: center; gap: var(--ehq-space-1); transition: border-color .15s; }
.erh-render-context .mini-card:hover, .ehq-v2 .mini-card:hover { border-color: var(--ehq-primary-border); }
.erh-render-context .mini-card .label, .ehq-v2 .mini-card .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ehq-text-soft); }
.erh-render-context .mini-card .value, .ehq-v2 .mini-card .value { font-size: 22px; font-weight: 700; color: var(--ehq-text); font-variant-numeric: tabular-nums; }

/* — WIDGETS — */
.erh-render-context .widget-grid, .ehq-v2 .widget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ehq-space-4); align-items: stretch; margin-block: var(--ehq-space-8); }
.erh-render-context .widget, .ehq-v2 .widget { padding: var(--ehq-space-5); background: var(--ehq-card); border: 1px solid var(--ehq-border); border-radius: var(--ehq-radius-lg); box-shadow: var(--ehq-shadow-sm); }
.erh-render-context .widget-head, .ehq-v2 .widget-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--ehq-space-4); }
.erh-render-context .widget-row, .ehq-v2 .widget-row { display: flex; justify-content: space-between; align-items: center; padding: var(--ehq-space-3) 0; border-bottom: 1px solid var(--ehq-border); font-size: 13px; }
.erh-render-context .widget-row:last-child, .ehq-v2 .widget-row:last-child { border-bottom: 0; }

/* — TOOLBAR — */
.erh-render-context .toolbar, .ehq-v2 .toolbar { display: flex; flex-wrap: wrap; gap: var(--ehq-space-3); align-items: end; min-height: 56px; padding: var(--ehq-space-3) var(--ehq-space-4); background: var(--ehq-surface-alt); border: 1px solid var(--ehq-border); border-radius: var(--ehq-radius-md); margin-block: var(--ehq-space-4); }

/* — TABLE — */
.erh-render-context .table-wrap, .ehq-v2 .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--ehq-radius-md); border: 1px solid var(--ehq-border); background: var(--ehq-surface); max-width: 100%; margin: var(--ehq-space-3) 0; }
.erh-render-context .pagination, .ehq-v2 .pagination { display: flex; gap: var(--ehq-space-2); justify-content: center; align-items: center; min-height: 48px; margin: var(--ehq-space-4) 0; flex-wrap: wrap; }

/* — BADGES / AMOUNTS — */
.erh-render-context .badge, .ehq-v2 .badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; background: var(--ehq-surface-alt); color: var(--ehq-text-muted); border: 1px solid var(--ehq-border); }
.erh-render-context .badge.is-success, .ehq-v2 .badge.is-success { background: var(--ehq-success-soft); color: var(--ehq-success); border-color: var(--ehq-success-soft); }
.erh-render-context .badge.is-warning, .ehq-v2 .badge.is-warning { background: var(--ehq-warning-soft); color: var(--ehq-warning); border-color: var(--ehq-warning-soft); }
.erh-render-context .badge.is-danger, .ehq-v2 .badge.is-danger { background: var(--ehq-danger-soft); color: var(--ehq-danger); border-color: var(--ehq-danger-soft); }
.erh-render-context .badge.is-info, .ehq-v2 .badge.is-info { background: var(--ehq-info-soft); color: var(--ehq-info); border-color: var(--ehq-info-soft); }
.erh-render-context .badge.is-primary, .ehq-v2 .badge.is-primary { background: var(--ehq-primary-soft); color: var(--ehq-primary); border-color: var(--ehq-primary-border); }
.erh-render-context .amount.is-income, .erh-render-context .amount-income, .ehq-v2 .amount.is-income, .ehq-v2 .amount-income { color: var(--ehq-income); font-weight: 600; font-variant-numeric: tabular-nums; }
.erh-render-context .amount.is-expense, .erh-render-context .amount-expense, .ehq-v2 .amount.is-expense, .ehq-v2 .amount-expense { color: var(--ehq-expense); font-weight: 600; font-variant-numeric: tabular-nums; }
.erh-render-context .amount.is-profit, .ehq-v2 .amount.is-profit { color: var(--ehq-profit); }
.erh-render-context .amount.is-loss, .ehq-v2 .amount.is-loss { color: var(--ehq-loss); }

/* — DETAIL / FORM GRIDS — */
.erh-render-context .detail-grid, .ehq-v2 .detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--ehq-space-6); align-items: start; }
.erh-render-context .form-grid, .ehq-v2 .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ehq-space-4); align-items: start; }
.erh-render-context .form-card, .ehq-v2 .form-card { max-width: 720px; margin-inline: auto; padding: var(--ehq-space-6); background: var(--ehq-card); border: 1px solid var(--ehq-border); border-radius: var(--ehq-radius-lg); box-shadow: var(--ehq-shadow-md); }
.erh-render-context .form-card.is-full, .ehq-v2 .form-card.is-full { max-width: 100%; }
.erh-render-context .form-actions, .ehq-v2 .form-actions { display: flex; justify-content: flex-end; gap: var(--ehq-space-3); margin-top: var(--ehq-space-6); flex-wrap: wrap; }
.erh-render-context .field, .ehq-v2 .field { margin-block: var(--ehq-space-4); }
.erh-render-context .field .helper, .ehq-v2 .field .helper { margin-top: 4px; font-size: 12px; color: var(--ehq-text-muted); }
.erh-render-context .field .error, .ehq-v2 .field .error { margin-top: 4px; font-size: 12px; color: var(--ehq-danger); }
.erh-render-context .card-heading, .ehq-v2 .card-heading { display: flex; align-items: center; gap: var(--ehq-space-2); font-size: 16px; font-weight: 650; color: var(--ehq-text); margin: 0 0 var(--ehq-space-3); }
.erh-render-context .card-heading .icon, .ehq-v2 .card-heading .icon { width: 22px; height: 22px; color: var(--ehq-primary); }

/* — SETTINGS — */
.erh-render-context .settings-section, .ehq-v2 .settings-section { padding: var(--ehq-space-6); background: var(--ehq-card); border: 1px solid var(--ehq-border); border-radius: var(--ehq-radius-lg); box-shadow: var(--ehq-shadow-sm); margin-block: var(--ehq-space-4); }
.erh-render-context .settings-actions, .ehq-v2 .settings-actions { display: flex; justify-content: flex-end; gap: var(--ehq-space-3); padding: var(--ehq-space-4) var(--ehq-space-5); background: var(--ehq-card); border: 1px solid var(--ehq-border); border-radius: var(--ehq-radius-lg); margin-top: var(--ehq-space-8); box-shadow: var(--ehq-shadow-sm); }

/* — MODAL / DRAWER (spec names) — */
.erh-render-context .modal-backdrop, .ehq-v2 .modal-backdrop { position: fixed; inset: 0; background: rgba(14, 26, 54, 0.5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 100000; display: flex; align-items: center; justify-content: center; padding: var(--ehq-space-4); }
.erh-render-context .modal-card, .ehq-v2 .modal-card { position: relative; background: var(--ehq-card); border-radius: var(--ehq-radius-lg); box-shadow: var(--ehq-shadow-lg); padding: var(--ehq-space-8); max-width: 560px; width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--ehq-border); }
.erh-render-context .modal-head, .ehq-v2 .modal-head { display: flex; justify-content: space-between; align-items: center; min-height: 56px; margin-bottom: var(--ehq-space-4); padding-bottom: var(--ehq-space-3); border-bottom: 1px solid var(--ehq-border); }
.erh-render-context .modal-close, .ehq-v2 .modal-close { background: transparent; border: 0; font-size: 22px; cursor: pointer; color: var(--ehq-text-muted); padding: 4px 8px; }
.erh-render-context .modal-actions, .ehq-v2 .modal-actions { display: flex; justify-content: flex-end; gap: var(--ehq-space-3); margin-top: var(--ehq-space-6); padding-top: var(--ehq-space-3); border-top: 1px solid var(--ehq-border); flex-wrap: wrap; }
.erh-render-context .drawer-shell, .ehq-v2 .drawer-shell { position: fixed; inset: 0; background: rgba(14, 26, 54, 0.42); backdrop-filter: blur(2px); z-index: 99999; }
.erh-render-context .drawer, .ehq-v2 .drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--ehq-card); box-shadow: var(--ehq-shadow-lg); display: flex; flex-direction: column; border-left: 1px solid var(--ehq-border); }
.erh-render-context .drawer-head, .ehq-v2 .drawer-head { min-height: 56px; padding: var(--ehq-space-4) var(--ehq-space-6); border-bottom: 1px solid var(--ehq-border); display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; background: var(--ehq-surface); }
.erh-render-context .drawer-body, .ehq-v2 .drawer-body { flex: 1 1 auto; overflow-y: auto; padding: var(--ehq-space-6); }
.erh-render-context .drawer-foot, .ehq-v2 .drawer-foot { min-height: 64px; padding: var(--ehq-space-3) var(--ehq-space-6); border-top: 1px solid var(--ehq-border); display: flex; align-items: center; justify-content: flex-end; gap: var(--ehq-space-3); flex: 0 0 auto; background: var(--ehq-surface-alt); }

/* — STATE PAGES — */
.erh-render-context .state, .ehq-v2 .state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--ehq-text-muted); padding: var(--ehq-space-8) var(--ehq-space-4); background: var(--ehq-card); border: 1px solid var(--ehq-border); border-radius: var(--ehq-radius-lg); box-shadow: var(--ehq-shadow-sm); margin: var(--ehq-space-4) auto; max-width: 560px; width: 100%; min-height: 320px; }
.erh-render-context .state.is-denied, .ehq-v2 .state.is-denied { max-width: 480px; }
.erh-render-context .state.is-error, .ehq-v2 .state.is-error { max-width: 480px; min-height: 360px; }
.erh-render-context .state h2, .ehq-v2 .state h2 { margin: 0 0 var(--ehq-space-2); color: var(--ehq-text); }
.erh-render-context .state p, .ehq-v2 .state p { margin: 0 0 var(--ehq-space-6); max-width: 40ch; }
.erh-render-context .state-icon, .ehq-v2 .state-icon { width: 48px; height: 48px; font-size: 48px; line-height: 1; margin-bottom: var(--ehq-space-3); color: var(--ehq-text-soft); display: flex; align-items: center; justify-content: center; }
.erh-render-context .state-icon.is-danger, .ehq-v2 .state-icon.is-danger { color: var(--ehq-danger); }
.erh-render-context .state-icon.is-success, .ehq-v2 .state-icon.is-success { color: var(--ehq-success); }
.erh-render-context .state-actions, .ehq-v2 .state-actions { display: flex; gap: var(--ehq-space-3); justify-content: center; flex-wrap: wrap; }
.erh-render-context .spinner, .ehq-v2 .spinner { width: 32px; height: 32px; border: 3px solid var(--ehq-border); border-top-color: var(--ehq-primary); border-radius: 50%; animation: ehq-spin 1s linear infinite; margin: 0 auto var(--ehq-space-3); }
@keyframes ehq-spin { to { transform: rotate(360deg); } }
.erh-render-context .skeleton, .ehq-v2 .skeleton { background: linear-gradient(90deg, var(--ehq-surface-alt) 0%, var(--ehq-border) 50%, var(--ehq-surface-alt) 100%); background-size: 200% 100%; animation: ehq-shimmer 1.4s ease-in-out infinite; border-radius: var(--ehq-radius-sm); min-height: 14px; margin: 6px 0; }
@keyframes ehq-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* v0.4.12 — BUG-054 fix: 2 spec classes missing from theme (.chart-bar,
   .chart-placeholder). Used in templates-v2/01-dashboard.html for the
   timeline chart placeholder. Adding so future chart components inherit
   the spec styling. */
.erh-render-context .chart-placeholder,
.ehq-v2 .chart-placeholder {
    height: 240px;
    background: linear-gradient(180deg, rgba(15, 76, 255, .04) 0%, rgba(15, 76, 255, 0) 100%);
    border-radius: var(--ehq-radius-md);
    display: flex; align-items: end; gap: 4px;
    padding: var(--ehq-space-3);
}
.erh-render-context .chart-bar,
.ehq-v2 .chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--ehq-primary), #6ea8ff);
    border-radius: 4px 4px 0 0;
}

/* — END §32 — */

/* ════════════════════════════════════════════════════════════════════
   §33 — AUTH / LOGIN CHROME (spec v1.3.0 + WP login overrides)
   ════════════════════════════════════════════════════════════════════
   Two scopes:
   1. .auth-shell + .auth-card markup for any in-app auth screen
      (matches templates-v2/12-17).
   2. body.login overrides for WP's built-in login form. Migrated from
      ehq_login_styles() inline <style> (was injected on login_enqueue_scripts).
      The logo background-image remains in PHP because it needs EHQ_LOGO_URL.
   ──────────────────────────────────────────────────────────────────── */

/* — 1. AUTH SHELL (spec markup) — */
.auth-shell {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: var(--ehq-space-4);
    background: var(--ehq-bg);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(15, 76, 255, 0.10) 0%, transparent 35%),
        radial-gradient(circle at 100% 100%, rgba(109, 77, 255, 0.10) 0%, transparent 35%);
}
.auth-card {
    width: min(440px, calc(100vw - 32px));
    padding: var(--ehq-space-8);
    background: var(--ehq-card);
    border: 1px solid var(--ehq-border);
    border-radius: var(--ehq-radius-lg);
    box-shadow: var(--ehq-shadow-lg);
    display: flex; flex-direction: column; gap: var(--ehq-space-4);
}
.auth-logo {
    min-height: 64px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
    color: var(--ehq-primary);
    letter-spacing: 0;
}
.auth-card h1 {
    margin: 0; font-size: 24px; font-weight: 700;
    color: var(--ehq-text);
    text-align: center;
}
.auth-helper { margin: 0; color: var(--ehq-text-muted); font-size: 13px; text-align: center; }
.auth-msg {
    min-height: 40px;
    border-radius: var(--ehq-radius-sm);
    font-size: 13px;
    display: flex; align-items: center;
    box-sizing: border-box;
}
.auth-msg.is-error   { min-height: 40px; padding: 10px 14px; background: var(--ehq-danger-soft);  border-left: 4px solid var(--ehq-danger);  color: var(--ehq-text); }
.auth-msg.is-success { min-height: 40px; padding: 10px 14px; background: var(--ehq-success-soft); border-left: 4px solid var(--ehq-success); color: var(--ehq-text); }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 12px; font-weight: 600; color: var(--ehq-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
.auth-field input {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--ehq-border-strong);
    border-radius: var(--ehq-radius-sm);
    font-size: 14px; width: 100%;
    background: var(--ehq-surface); color: var(--ehq-text);
    font-family: inherit;
}
.auth-submit {
    width: 100%; height: 48px; min-height: 48px;
    background: var(--ehq-primary);
    border: 1px solid var(--ehq-primary);
    color: #fff;
    font-weight: 600; font-size: 14px;
    border-radius: var(--ehq-radius-sm);
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .05s;
    font-family: inherit;
}
.auth-submit:hover { background: var(--ehq-primary-hover); border-color: var(--ehq-primary-hover); box-shadow: 0 4px 14px rgba(15, 76, 255, 0.28); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit[disabled] { opacity: .55; cursor: not-allowed; }
.auth-links { display: flex; justify-content: space-between; gap: var(--ehq-space-3); font-size: 12px; color: var(--ehq-text-muted); flex-wrap: wrap; }
.auth-links a { color: var(--ehq-primary); text-decoration: none; font-weight: 500; }
.auth-links a:hover { text-decoration: underline; }
.auth-strength {
    height: 6px;
    border-radius: 3px;
    background: var(--ehq-border);
    overflow: hidden;
}
.auth-strength > span { display: block; height: 100%; width: 0; background: var(--ehq-danger); transition: width .25s, background .25s; }
.auth-strength.is-medium > span { width: 50%; background: var(--ehq-warning); }
.auth-strength.is-strong > span { width: 100%; background: var(--ehq-success); }

/* — 2. WP body.login overrides (migrated from ehq_login_styles inline) — */
body.login { background: var(--ehq-surface); }
body.login #login { padding-top: var(--ehq-space-4); }
body.login #login h1 a {
    /* background-image left in PHP (needs EHQ_LOGO_URL runtime value).
       Style attribute set by ehq_login_logo_image() in functions.php. */
    background-size: 80%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--ehq-surface);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1px solid var(--ehq-border);
    display: block;
    margin: 0 auto var(--ehq-space-6);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}
body.login #login .button-primary {
    background: var(--ehq-primary);
    border-color: var(--ehq-primary);
    box-shadow: none;
}
body.login #login .button-primary:hover {
    background: var(--ehq-primary-hover);
    border-color: var(--ehq-primary-hover);
}

/* — END §33 — */

/* ════════════════════════════════════════════════════════════════════
   §34 — DASHBOARD POLISH (migrated from ë • distribution v1.10.25
                            assets/css/dashboard-polish.css, 1442 LOC)
   ════════════════════════════════════════════════════════════════════
   This block was previously enqueued as 'erh-dashboard-polish' from the
   plugin (admin/class-erh-admin.php:107 + includes/class-erh-frontend.php:97).
   Migrated to the theme so the plugin no longer ships dashboard styling.

   Scope: .erh-dashboard, .erh-wrap, .erh-dashboard-main, .erh-earnings-timeline,
   .erh-top-payees, .erh-top-tracks, .erh-top-stores, .erh-kpi-*. All selectors
   are plugin-scoped — zero overlap with theme classes.

   Tokens used internally: --primary-blue, --bg-light, --border-color,
   --text-dark, --bs-* (legacy). Kept as-is for backward compat.
   Will be folded into --ehq-* tokens in a later session.
   ──────────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD POLISH — scoped to .erh-dashboard / .erh-wrap only.
   No bare body/h1-h6 selectors. No orange tokens.
   ═══════════════════════════════════════════════════════════════ */

:root {
    --primary-blue:   #0f6bff;
    --bg-light:       #f6f8ff;
    --border-color:   #d0deff;
    --text-dark:      #1a1a1a;
    --text-light:     #666666;
    --spacing-xs:     4px;
    --spacing-sm:     8px;
    --spacing-md:     12px;
    --spacing-lg:     16px;
    --spacing-xl:     20px;
    --spacing-2xl:    24px;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT — 2 COLUMN
   ═══════════════════════════════════════════════════════════════ */

.erh-dashboard-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    width: 100%;
}

/* Earnings Timeline — Left Column */
.erh-earnings-timeline {
    grid-column: 1;
    grid-row: 1;
    max-height: 250px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    background: #ffffff;
    overflow: hidden;
}

.erh-earnings-timeline h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.erh-earnings-timeline canvas {
    max-height: 180px !important;
}

/* Top Payees — Right Column, height réduite */
.erh-top-payees {
    grid-column: 2;
    grid-row: 1;
    max-height: 280px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
}

.erh-top-payees-row {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-md);
    align-items: center;
}

.erh-top-payees-row:nth-child(n+26) {
    display: none;
}

.erh-top-payees-row:hover {
    background-color: var(--bg-light);
}

.erh-top-payees-name {
    font-weight: 500;
    font-size: 13px;
}

.erh-top-payees-amount {
    text-align: right;
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 13px;
}

/* Top Tracks — Left Column, Bottom, height réduite */
.erh-top-tracks {
    grid-column: 1;
    grid-row: 2;
    max-height: 220px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
}

.erh-top-tracks table {
    width: 100%;
    border-collapse: collapse;
}

.erh-top-tracks th {
    background-color: var(--bg-light);
    font-weight: 600;
    font-size: 12px;
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
}

.erh-top-tracks td {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.erh-top-tracks tr:nth-child(n+11) {
    display: none;
}

.erh-top-tracks tbody tr:hover {
    background-color: var(--bg-light);
}

/* Top Stores — Right Column, Bottom, height réduite */
.erh-top-stores {
    grid-column: 2;
    grid-row: 2;
    max-height: 180px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
}

.erh-top-stores-row {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-md);
    align-items: center;
}

.erh-top-stores-row:nth-child(n+11) {
    display: none;
}

.erh-top-stores-row:hover {
    background-color: var(--bg-light);
}

.erh-top-stores-name {
    font-weight: 500;
    font-size: 13px;
}

.erh-top-stores-amount {
    text-align: right;
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   KPI CARDS
   ═══════════════════════════════════════════════════════════════ */

.erh-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.erh-kpi-card {
    background: linear-gradient(135deg, #f6f8ff 0%, #ffffff 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    transition: all 0.2s ease;
}

.erh-kpi-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 107, 255, 0.1);
}

.erh-kpi-card-icon {
    font-size: 24px;
    margin-bottom: var(--spacing-sm);
    height: 32px;
    display: flex;
    align-items: center;
}

.erh-kpi-card-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
}

.erh-kpi-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: var(--spacing-sm);
}

.erh-kpi-card-detail {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   CURRENCY SPACING
   ═══════════════════════════════════════════════════════════════ */

.erh-money-display {
    display: inline-block;
}

.erh-money-amount::after {
    content: ' ';
    display: inline-block;
    width: var(--spacing-sm);
}

/* ═══════════════════════════════════════════════════════════════
   SECTION HEADERS — blue, not orange
   ═══════════════════════════════════════════════════════════════ */

.erh-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.erh-section-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.erh-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════════
   CATALOG GRID
   ═══════════════════════════════════════════════════════════════ */

.erh-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-2xl);
}

.erh-mini-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-md);
    text-align: center;
    transition: all 0.2s ease;
}

.erh-mini-card:hover {
    border-color: var(--primary-blue);
    background: var(--bg-light);
}

.erh-mini-card span {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.erh-mini-card strong {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-blue);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (< 1200px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .erh-dashboard-main {
        grid-template-columns: 1fr;
    }

    .erh-earnings-timeline,
    .erh-top-payees,
    .erh-top-tracks,
    .erh-top-stores {
        grid-column: 1 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (< 768px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .erh-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .erh-kpi-card-value {
        font-size: 18px;
    }

    .erh-dashboard-main {
        gap: var(--spacing-lg);
    }

    .erh-top-tracks th,
    .erh-top-tracks td {
        padding: var(--spacing-sm);
    }

    .erh-top-tracks table {
        font-size: 11px;
    }
}

/* ╔═══════════════════════════════════════════════════════════════════════╗
   ║  v1.2.0 — DESKTOP-ONLY UNIFIED LAYOUT SYSTEM                          ║
   ║  Approved size plan (2026-05-18). Desktop only. No responsive.        ║
   ║  All measurements locked to the approved spec.                        ║
   ╚═══════════════════════════════════════════════════════════════════════╝ */

:root {
    /* Design tokens — desktop locked */
    --bs-primary:        #0f6bff;
    --bs-primary-hover:  #0a55cc;
    --bs-secondary:      #ffffff;
    --bs-danger:         #d92d20;
    --bs-warning:        #f59e0b;
    --bs-success:        #10b981;
    --bs-info:           #0ea5e9;
    --bs-body:           #0f172a;
    --bs-muted:          #64748b;
    --bs-border:         #e5ecf7;
    --bs-input-border:   #cbd5e1;
    --bs-card-bg:        #ffffff;
    --bs-card-shadow:    0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.06);
    --bs-radius-md:      8px;
    --bs-radius-lg:      12px;
    /* Page sizing — desktop locked */
    --erh-page-max:      1280px;
    --erh-page-pad-x:    32px;
    --erh-page-pad-y:    32px;
    --erh-section-gap:   32px;
    --erh-card-gap:      16px;
    --erh-hero-h:        96px;
    --erh-nav-h:         56px;
}

/* ───────────────────────────────────────────────────────────────
   PAGE CONTAINER — locked to 1280 max, 32 padding
   ─────────────────────────────────────────────────────────────── */
.erh-render-context {
    box-sizing: border-box;
    max-width: var(--erh-page-max);
    margin-inline: auto;
    padding: var(--erh-page-pad-y) var(--erh-page-pad-x);
    color: var(--bs-body);
    font-size: 14px;
    line-height: 1.5;
}
.erh-render-context *,
.erh-render-context *::before,
.erh-render-context *::after {
    box-sizing: border-box;
}
.wrap > .erh-render-context { max-width: 100%; }

/* Generic page alias for new templates */
.erh-page {
    box-sizing: border-box;
    max-width: var(--erh-page-max);
    margin-inline: auto;
    padding: var(--erh-page-pad-y) var(--erh-page-pad-x);
}

/* ───────────────────────────────────────────────────────────────
   HERO — 96 px fixed (desktop)
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-page-hero,
.erh-render-context .erh-hero {
    min-height: var(--erh-hero-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    box-shadow: var(--bs-card-shadow);
    margin-bottom: 24px;
}

/* ───────────────────────────────────────────────────────────────
   NAV TABS — 56 px (desktop inline)
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-front-nav,
.erh-render-context .ehq-module-toolbar,
.erh-render-context .erh-nav-tabs {
    min-height: var(--erh-nav-h);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    margin-bottom: var(--erh-section-gap);
}

/* ───────────────────────────────────────────────────────────────
   CARDS — Bootstrap .card + legacy .erh-panel / .erh-front-panel
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .card,
.erh-render-context .erh-panel,
.erh-render-context .erh-front-panel,
.erh-render-context .erh-chart-panel,
.erh-render-context section.erh-front-panel,
.erh-render-context details.erh-panel {
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    box-shadow: var(--bs-card-shadow);
    padding: 20px;
    margin-block: 16px;
    width: 100%;
    height: auto;
}
.erh-render-context details.erh-panel > summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 8px;
}
.erh-render-context .card > h2,
.erh-render-context .card > h3,
.erh-render-context .erh-panel > h2,
.erh-render-context .erh-panel > h3,
.erh-render-context .erh-front-panel > h2,
.erh-render-context .erh-front-panel > h3,
.erh-render-context .erh-panel-heading,
.erh-render-context .erh-front-panel-heading,
.erh-render-context .erh-section-header {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--bs-body);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ───────────────────────────────────────────────────────────────
   KPI STRIP — 5 cards/row, 230 × 140, gap 16
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-kpi-strip,
.erh-render-context .erh-kpi-grid,
.erh-render-context .erh-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--erh-card-gap);
    align-items: stretch;
    margin-block: var(--erh-card-gap);
}
.erh-render-context .erh-kpi-card,
.erh-render-context .erh-stat-card {
    min-height: 140px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 20px;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    box-shadow: var(--bs-card-shadow);
}

/* ───────────────────────────────────────────────────────────────
   MINI-CARDS — 5/row, 230 × 80, gap 16
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-mini-cards,
.erh-render-context .erh-catalog-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--erh-card-gap);
    align-items: stretch;
    margin-block: var(--erh-card-gap);
}
.erh-render-context .erh-mini-card {
    min-height: 80px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    box-shadow: var(--bs-card-shadow);
}

/* ───────────────────────────────────────────────────────────────
   WIDGET GRID — 2 columns minmax(0, 1fr), gap 16
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-widget-grid,
.erh-render-context .erh-dashboard-main,
.erh-render-context .erh-dashboard-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--erh-card-gap);
    align-items: stretch;
    margin-block: var(--erh-section-gap);
}
.erh-render-context .erh-widget-grid > *,
.erh-render-context .erh-dashboard-main > *,
.erh-render-context .erh-dashboard-panels > * {
    min-width: 0;
    height: 100%;
}

/* ───────────────────────────────────────────────────────────────
   FORM GRID — 2 columns where useful
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--erh-card-gap);
    align-items: start;
}
.erh-render-context .erh-form-card {
    max-width: 720px;
    margin-inline: auto;
    padding: 24px;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    box-shadow: var(--bs-card-shadow);
}
.erh-render-context .erh-form-card.is-full-width { max-width: 100%; }
.erh-render-context .erh-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ───────────────────────────────────────────────────────────────
   DETAIL GRID — 2fr / 1fr (main + side), gap 24
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

/* ───────────────────────────────────────────────────────────────
   SETTINGS — section card pad 24, sticky save row
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-settings-section {
    padding: 24px;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    box-shadow: var(--bs-card-shadow);
    margin-block: var(--erh-card-gap);
}
.erh-render-context .erh-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    margin-top: var(--erh-section-gap);
}

/* ───────────────────────────────────────────────────────────────
   BUTTONS — Bootstrap .btn + legacy wp-admin .button
   Min height 44 (WCAG 2.5.5)
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .btn,
.erh-render-context .button,
.erh-render-context input.button,
.erh-render-context button.button,
.erh-render-context .erh-front-button,
.erh-render-context .erh-action-link,
.erh-render-context input[type="submit"],
.erh-render-context button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--bs-radius-md);
    border: 1px solid var(--bs-input-border);
    background: #ffffff;
    color: var(--bs-body);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
    min-height: 44px;
    white-space: nowrap;
}
.erh-render-context .btn:hover,
.erh-render-context .button:hover,
.erh-render-context .erh-front-button:hover,
.erh-render-context .erh-action-link:hover,
.erh-render-context input[type="submit"]:hover,
.erh-render-context button[type="submit"]:hover {
    background: #f1f5fb;
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}
.erh-render-context .btn-primary,
.erh-render-context .btn.btn-primary,
.erh-render-context .button-primary,
.erh-render-context .erh-front-button.is-primary,
.erh-render-context .erh-action-link.is-primary {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #ffffff;
}
.erh-render-context .btn-primary:hover,
.erh-render-context .button-primary:hover,
.erh-render-context .erh-front-button.is-primary:hover {
    background: var(--bs-primary-hover);
    border-color: var(--bs-primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 107, 255, 0.18);
}
.erh-render-context .btn-secondary,
.erh-render-context .button-secondary,
.erh-render-context .erh-front-button.is-secondary {
    background: #ffffff;
    border-color: var(--bs-input-border);
    color: var(--bs-body);
}
.erh-render-context .btn-secondary:hover,
.erh-render-context .button-secondary:hover {
    background: #f1f5fb;
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}
.erh-render-context .btn-danger,
.erh-render-context .button.delete,
.erh-render-context input.delete,
.erh-render-context .erh-action-link.is-danger {
    background: #ffffff;
    border-color: var(--bs-danger);
    color: var(--bs-danger);
}
.erh-render-context .btn-danger:hover,
.erh-render-context .button.delete:hover {
    background: var(--bs-danger);
    color: #ffffff;
}
.erh-render-context .btn-sm {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
}
.erh-render-context .btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--bs-primary);
    padding: 4px 6px;
    min-height: auto;
}
.erh-render-context .btn-link:hover {
    background: transparent;
    text-decoration: underline;
}
.erh-render-context .btn[disabled],
.erh-render-context .btn:disabled,
.erh-render-context .btn.disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
.erh-render-context p.submit {
    margin: 8px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.erh-render-context .erh-toolbar > .btn,
.erh-render-context .erh-toolbar > button,
.erh-render-context .erh-toolbar > a,
.erh-render-context .erh-filter-toolbar > .btn,
.erh-render-context .erh-filter-toolbar > button,
.erh-render-context .erh-filter-toolbar > a,
.erh-render-context .erh-bulk-toolbar > .btn,
.erh-render-context .erh-bulk-toolbar > button,
.erh-render-context p.submit > .btn,
.erh-render-context p.submit > button {
    flex: 0 0 auto;
    width: auto;
    align-self: center;
}

/* ───────────────────────────────────────────────────────────────
   TABLES — Bootstrap .table .table-striped + wp .widefat fallback
   Header sticky, row 44, scroll wrapper enforced
   ─────────────────────────────────────────────────────────────── */
.erh-render-context table.table,
.erh-render-context .table,
.erh-render-context table.widefat {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}
.erh-render-context .table th,
.erh-render-context table.widefat th {
    background: #f1f5fb;
    color: var(--bs-body);
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--bs-border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    min-height: 44px;
    position: sticky;
    top: 0;
    z-index: 2;
}
.erh-render-context .table td,
.erh-render-context table.widefat td {
    padding: 12px;
    border-bottom: 1px solid var(--bs-border);
    vertical-align: middle;
    min-height: 44px;
}
.erh-render-context .table.table-striped tbody tr:nth-of-type(odd) td {
    background: #f8fafc;
}
.erh-render-context .table tbody tr:hover td {
    background: #eef4ff;
}
.erh-render-context .erh-table-scroll,
.erh-render-context .erh-front-table-scroll,
.erh-render-context .erh-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 12px 0;
    border-radius: 8px;
    max-width: 100%;
}
.erh-render-context .erh-table-scroll table,
.erh-render-context .erh-front-table-scroll table,
.erh-render-context .erh-table-wrap table {
    width: 100%;
    min-width: 0;
}
.erh-render-context .erh-pagination,
.erh-render-context .tablenav {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 16px 0;
    flex-wrap: wrap;
    min-height: 48px;
}

/* ───────────────────────────────────────────────────────────────
   FILTER TOOLBAR — 56–72 h, non-stretching buttons
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-toolbar,
.erh-render-context .erh-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    justify-content: flex-start;
    min-height: 56px;
    margin: 12px 0;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--bs-border);
    border-radius: 8px;
}
.erh-render-context .erh-toolbar label,
.erh-render-context .erh-filter-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--bs-muted);
    font-weight: 500;
}
.erh-render-context .erh-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

/* ───────────────────────────────────────────────────────────────
   INPUTS — min-h 44 (WCAG)
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .form-control,
.erh-render-context input[type="text"],
.erh-render-context input[type="number"],
.erh-render-context input[type="date"],
.erh-render-context input[type="email"],
.erh-render-context input[type="password"],
.erh-render-context input[type="search"],
.erh-render-context input[type="url"],
.erh-render-context input:not([type]),
.erh-render-context select,
.erh-render-context textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bs-input-border);
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    color: var(--bs-body);
    min-height: 44px;
    box-shadow: none;
    max-width: 100%;
}
.erh-render-context input[type="checkbox"],
.erh-render-context input[type="radio"] {
    width: auto;
    min-height: auto;
    margin-right: 6px;
}
.erh-render-context .form-control:focus,
.erh-render-context input:focus,
.erh-render-context select:focus,
.erh-render-context textarea:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(15, 107, 255, 0.15);
}

/* ───────────────────────────────────────────────────────────────
   DASHICONS — normalized sizes (single source of truth)
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .dashicons,
.erh-render-context [class*=" dashicons-"],
.erh-render-context [class^="dashicons-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
    flex: 0 0 auto;
}
.erh-render-context .btn .dashicons,
.erh-render-context .erh-front-button .dashicons,
.erh-render-context .erh-action-link .dashicons,
.erh-render-context .erh-front-nav-link .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}
.erh-render-context .erh-panel-heading .dashicons,
.erh-render-context .erh-section-header .dashicons,
.erh-render-context .erh-front-panel-heading .dashicons,
.erh-render-context .card > h2 .dashicons,
.erh-render-context .card > h3 .dashicons {
    width: 22px;
    height: 22px;
    font-size: 22px;
    color: var(--bs-primary);
}
.erh-render-context .erh-state .dashicons,
.erh-render-context .erh-empty-state .dashicons {
    width: 48px !important;
    height: 48px !important;
    font-size: 48px !important;
    color: var(--bs-muted);
    display: block;
    margin: 0 auto 12px;
}

/* ───────────────────────────────────────────────────────────────
   NOTICES
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-notice,
.erh-render-context .notice,
.erh-render-context .updated,
.erh-render-context .error {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 13px;
    border-left: 4px solid var(--bs-primary);
    background: #eff6ff;
    color: var(--bs-body);
    box-shadow: none;
}
.erh-render-context .error,
.erh-render-context .notice-error {
    border-left-color: var(--bs-danger);
    background: #fef2f2;
}

/* ───────────────────────────────────────────────────────────────
   TYPOGRAPHY
   ─────────────────────────────────────────────────────────────── */
.erh-render-context h1,
.erh-render-context h2,
.erh-render-context h3 {
    color: var(--bs-body);
    margin: 0 0 8px;
}
.erh-render-context h1 { font-size: 24px; font-weight: 700; line-height: 1.25; }
.erh-render-context h2 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.erh-render-context h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.erh-render-context p  { margin: 8px 0; }
.erh-render-context .erh-note {
    color: var(--bs-muted);
    font-size: 13px;
    margin: 8px 0;
}

/* ───────────────────────────────────────────────────────────────
   MODAL — single canonical pattern (hidden attr + .is-visible)
   Centered card, max-width 560, pad 32
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-modal,
.erh-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.erh-modal[hidden] { display: none !important; }
.erh-modal.is-visible,
.erh-modal[aria-hidden="false"]:not([hidden]) {
    display: flex;
}
.erh-render-context .erh-modal-dialog,
.erh-render-context .erh-modal-card,
.erh-modal-dialog,
.erh-modal-card {
    position: relative;
    background: var(--bs-card-bg);
    border-radius: var(--bs-radius-lg);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow: auto;
}
.erh-modal-head,
.erh-modal .erh-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    margin-bottom: 16px;
}
.erh-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.erh-modal-close,
.erh-modal .erh-modal-close {
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    color: var(--bs-muted);
    cursor: pointer;
    padding: 4px 8px;
    min-height: auto;
}

/* ───────────────────────────────────────────────────────────────
   DRAWER — fixed right, width 480, header 56, footer 64
   ─────────────────────────────────────────────────────────────── */
.erh-drawer,
.erh-contract-import-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 100vw;
    background: var(--bs-card-bg);
    box-shadow: -16px 0 48px rgba(15, 23, 42, 0.18);
    z-index: 99999;
    display: none;
    flex-direction: column;
    padding: 0;
}
.erh-drawer[hidden] { display: none !important; }
.erh-drawer.is-visible,
.erh-drawer[aria-hidden="false"]:not([hidden]) {
    display: flex;
}
.erh-drawer-head {
    min-height: 56px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--bs-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}
.erh-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px;
}
.erh-drawer-foot {
    min-height: 64px;
    padding: 12px 24px;
    border-top: 1px solid var(--bs-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
    background: #f8fafc;
}

/* ───────────────────────────────────────────────────────────────
   STATE PAGES — empty / loading / denied / error
   Single .erh-state system, card centered
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .erh-state,
.erh-render-context .erh-empty-state,
.erh-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--bs-muted);
    padding: 32px;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    box-shadow: var(--bs-card-shadow);
    margin: 16px auto;
    max-width: 560px;
    min-height: 320px;
}
.erh-state.is-error,
.erh-state.is-denied { max-width: 480px; }
.erh-state.is-error { min-height: 360px; }
.erh-state h2 { margin: 0 0 8px; color: var(--bs-body); }
.erh-state p  { margin: 0 0 24px; max-width: 40ch; }
.erh-state .actions,
.erh-state .erh-state-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.erh-state .dashicons.is-danger { color: var(--bs-danger); }

/* Loading spinner */
.erh-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bs-border);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: erh-spin 1s linear infinite;
    margin: 0 auto 12px;
}
@keyframes erh-spin { to { transform: rotate(360deg); } }

/* Skeleton shimmer */
.erh-skeleton {
    background: linear-gradient(90deg, #f1f5fb 0%, #e5ecf7 50%, #f1f5fb 100%);
    background-size: 200% 100%;
    animation: erh-shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
    min-height: 14px;
    margin: 6px 0;
}
@keyframes erh-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ───────────────────────────────────────────────────────────────
   AUTH SHELL — centered card, full viewport
   ─────────────────────────────────────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
    background: #f6f8ff;
    font-size: 14px;
    color: var(--bs-body);
}
.auth-card {
    width: 440px;
    max-width: calc(100vw - 32px);
    padding: 32px;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius-lg);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-logo {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-logo img { max-height: 64px; width: auto; }
.auth-card h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--bs-body);
}
.auth-card .auth-helper {
    margin: 0;
    color: var(--bs-muted);
    font-size: 13px;
}
.auth-msg {
    min-height: 40px;
    padding: 0;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
.auth-msg.is-error {
    min-height: 40px;
    padding: 10px 14px;
    background: #fef2f2;
    border-left: 4px solid var(--bs-danger);
    color: var(--bs-body);
}
.auth-msg.is-success {
    min-height: 40px;
    padding: 10px 14px;
    background: #ecfdf5;
    border-left: 4px solid var(--bs-success);
    color: var(--bs-body);
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--bs-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.auth-field input,
.auth-field select {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--bs-input-border);
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
}
.auth-field input:focus,
.auth-field select:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(15, 107, 255, 0.15);
}
.auth-card .btn-primary,
.auth-card button[type="submit"].btn-primary,
.auth-card .auth-submit {
    width: 100%;
    height: 48px;
    min-height: 48px;
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #ffffff;
    font-weight: 600;
    border-radius: var(--bs-radius-md);
    border: 1px solid var(--bs-primary);
    cursor: pointer;
}
.auth-card .btn-primary:hover,
.auth-card .auth-submit:hover {
    background: var(--bs-primary-hover);
    border-color: var(--bs-primary-hover);
}
.auth-card .btn-primary[disabled],
.auth-card .auth-submit[disabled] { opacity: .55; cursor: not-allowed; }
.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--bs-muted);
    flex-wrap: wrap;
}
.auth-links a {
    color: var(--bs-primary);
    text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }

/* Password strength bar (reset password) */
.auth-strength {
    height: 6px;
    border-radius: 3px;
    background: var(--bs-border);
    overflow: hidden;
}
.auth-strength > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--bs-danger);
    transition: width .25s ease, background .25s ease;
}
.auth-strength.is-medium > span { width: 50%; background: var(--bs-warning); }
.auth-strength.is-strong > span { width: 100%; background: var(--bs-success); }

/* ───────────────────────────────────────────────────────────────
   THEME CONSOLE HOST — keep dark shell readable
   ─────────────────────────────────────────────────────────────── */
.ehq-front-console-host .erh-render-context,
.erh-front-shell .erh-render-context {
    color: var(--bs-body);
    background: transparent;
}

/* End v1.2.0 desktop-only system */

/* ╔═══════════════════════════════════════════════════════════════════════╗
   ║  v1.4.0 — CONTRACTS & SPLITS page                                     ║
   ║  Section bar, action bar, badges, drawer tabs, splits/expenses tables ║
   ║  Scoped to .erh-render-context. No global pollution.                  ║
   ╚═══════════════════════════════════════════════════════════════════════╝ */

/* Section bar inside Contracts page */
.erh-render-context .erh-contracts-section { padding: 20px; }
.erh-render-context .erh-contracts-section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.erh-render-context .erh-contracts-section-title { margin: 0 0 4px; font-size: 18px; font-weight: 650; }
.erh-render-context .erh-contracts-section-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Action bar (search + status filter) */
.erh-render-context .erh-contracts-actionbar {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--ehq-surface-alt, var(--ehq-surface-alt));
    border: 1px solid var(--ehq-border, var(--ehq-border));
    border-radius: 10px;
}
.erh-render-context .erh-contracts-search { flex: 1 1 280px; min-width: 240px; margin: 0; }
.erh-render-context .erh-contracts-search input,
.erh-render-context .erh-contracts-statusfilter select { margin: 0; }
.erh-render-context .erh-contracts-statusfilter { flex: 0 0 220px; margin: 0; }

/* Contracts table */
.erh-render-context .erh-contracts-table .erh-contracts-actions-col { text-align: right; width: 1%; white-space: nowrap; }
.erh-render-context .erh-contracts-row { cursor: pointer; transition: background .12s; }
.erh-render-context .erh-contracts-row:hover td,
.erh-render-context .erh-contracts-row:focus-visible td { background: var(--ehq-primary-soft, var(--ehq-primary-soft)); }
.erh-render-context .erh-contracts-row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ehq-primary, var(--ehq-primary)); }
.erh-render-context .erh-contracts-row code { font-size: 12px; color: var(--ehq-text-muted, var(--ehq-text-muted)); }

/* Badges (v1.4.0 status palette — additive to existing badge classes) */
.erh-render-context .erh-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--ehq-surface-alt, var(--ehq-surface-alt));
    color: var(--ehq-text-muted, var(--ehq-text-muted));
    border: 1px solid var(--ehq-border, var(--ehq-border));
    line-height: 1;
}
.erh-render-context .erh-badge.is-success { background: var(--ehq-success-soft, var(--ehq-success-soft)); color: var(--ehq-success, var(--ehq-success)); border-color: transparent; }
.erh-render-context .erh-badge.is-warning { background: var(--ehq-warning-soft, var(--ehq-warning-soft)); color: var(--ehq-warning, var(--ehq-warning)); border-color: transparent; }
.erh-render-context .erh-badge.is-danger  { background: var(--ehq-danger-soft, var(--ehq-danger-soft));  color: var(--ehq-danger, var(--ehq-danger));  border-color: transparent; }
.erh-render-context .erh-badge.is-muted   { background: var(--ehq-surface-alt, var(--ehq-surface-alt));  color: var(--ehq-text-muted, var(--ehq-text-muted)); border-color: var(--ehq-border, var(--ehq-border)); }

/* ───────────────────────────────────────────────────────────────
   Drawer tabs (.ehq-tabs / .ehq-tab-btn / .ehq-tab-panel)
   ─────────────────────────────────────────────────────────────── */
.erh-render-context .ehq-tabs,
.ehq-drawer .ehq-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 16px;
    border-bottom: 1px solid var(--ehq-border, var(--ehq-border));
}
.erh-render-context .ehq-tab-btn,
.ehq-drawer .ehq-tab-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--ehq-text-muted, var(--ehq-text-muted));
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
    min-height: 40px;
}
.erh-render-context .ehq-tab-btn:hover,
.ehq-drawer .ehq-tab-btn:hover { color: var(--ehq-primary, var(--ehq-primary)); background: var(--ehq-primary-soft, var(--ehq-primary-soft)); }
.erh-render-context .ehq-tab-btn.is-active,
.ehq-drawer .ehq-tab-btn.is-active {
    color: var(--ehq-primary, var(--ehq-primary));
    border-bottom-color: var(--ehq-primary, var(--ehq-primary));
}
.erh-render-context .ehq-tab-panel,
.ehq-drawer .ehq-tab-panel { display: none; }
.erh-render-context .ehq-tab-panel.is-active,
.ehq-drawer .ehq-tab-panel.is-active { display: block; }

/* ───────────────────────────────────────────────────────────────
   Contracts drawer specifics
   ─────────────────────────────────────────────────────────────── */
.erh-contract-drawer .erh-drawer-title { margin: 0; font-size: 16px; font-weight: 650; }
.erh-contract-drawer .erh-drawer-close { width: 36px; height: 36px; padding: 0; min-height: 36px; border-radius: 8px; }
.erh-contract-drawer .erh-drawer-table th { font-size: 11px; }
.erh-contract-drawer .erh-drawer-table td { padding: 8px 10px; vertical-align: middle; }
.erh-contract-drawer .erh-drawer-table input,
.erh-contract-drawer .erh-drawer-table select { margin: 0; min-height: 36px; padding: 6px 8px; font-size: 13px; }
.erh-contract-drawer .erh-drawer-table .num { text-align: right; }
.erh-contract-drawer .erh-drawer-table .num input { text-align: right; }
.erh-contract-drawer .erh-drawer-actionbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.erh-contract-drawer .erh-drawer-total {
    font-size: 13px; color: var(--ehq-text-muted, var(--ehq-text-muted));
}
.erh-contract-drawer .erh-drawer-total.is-invalid { color: var(--ehq-danger, var(--ehq-danger)); font-weight: 600; }
.erh-contract-drawer .erh-drawer-total strong { color: inherit; font-variant-numeric: tabular-nums; }
.erh-contract-drawer .erh-drawer-foot-right { display: flex; gap: 8px; margin-left: auto; }
.erh-contract-drawer [data-erh-drawer-delete-disabled] { visibility: hidden; }
.erh-contract-drawer.is-edit-mode [data-erh-drawer-delete-disabled] { visibility: visible; }
.erh-contract-drawer .erh-drawer-empty td { color: var(--ehq-text-muted, var(--ehq-text-muted)); font-style: italic; text-align: center; padding: 16px; }

/* Drawer width breakpoints (480 desktop / 90vw tablet / 100vw mobile) */
@media (max-width: 1023px) {
    .erh-contract-drawer { width: 90vw; }
}
@media (max-width: 767px) {
    .erh-contract-drawer { width: 100vw; }
    .erh-contract-drawer .erh-drawer-foot { flex-direction: column-reverse; align-items: stretch; }
    .erh-contract-drawer .erh-drawer-foot-right { width: 100%; justify-content: space-between; }
}

/* End v1.4.0 — Contracts & Splits */

/* — END §34 — */

/* ════════════════════════════════════════════════════════════════════
   §35 — e-SUITE-ADMIN (migrated from ë • distribution v1.10.26
                         assets/css/e-suite-admin.css, 912 LOC)
   ════════════════════════════════════════════════════════════════════
   Scope: body.wp-admin .erh-wrap + descendants. Defines admin-only token
   set (--erh-admin-*) and overrides for wp-admin chrome inside the plugin.
   ──────────────────────────────────────────────────────────────────── */

/* WordPress admin companion for the e-hq template v0.2.23. Plugin-local only. */
body.wp-admin .erh-wrap {
  --erh-admin-ink: #0f172a;
  --erh-admin-muted: #475569;
  --erh-admin-line: #d9e6f7;
  --erh-admin-soft-line: #e6eef8;
  --erh-admin-card: #ffffff;
  --erh-admin-paper: #f4f7fc;
  --erh-admin-blue: #0f6bff;
  --erh-admin-blue-deep: #0b2f6b;
  --erh-admin-blue-soft: #eaf2ff;
  --erh-admin-radius: 10px;
  --erh-admin-shadow: 0 12px 28px rgba(15, 44, 94, 0.08);
  box-sizing: border-box !important;
  color: var(--erh-admin-ink) !important;
  margin: 0 !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow-x: clip !important;
  padding: 18px 20px 32px 18px !important;
  width: auto !important;
}

body.wp-admin .erh-wrap *,
body.wp-admin .erh-wrap *::before,
body.wp-admin .erh-wrap *::after {
  box-sizing: border-box !important;
  letter-spacing: 0 !important;
}

body.wp-admin .erh-wrap .erh-page-hero {
  align-items: center !important;
  background:
    linear-gradient(135deg, rgba(15, 107, 255, 0.08), rgba(77, 163, 255, 0.06)),
    var(--erh-admin-card) !important;
  border: 1px solid var(--erh-admin-line) !important;
  border-radius: 12px !important;
  box-shadow: var(--erh-admin-shadow) !important;
  display: grid !important;
  gap: 14px !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  margin: 0 0 18px !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 16px !important;
}

body.wp-admin .erh-wrap .erh-page-hero h1 {
  color: var(--erh-admin-ink) !important;
  font-size: clamp(22px, 1.8vw, 30px) !important;
  line-height: 1.12 !important;
  margin: 0 0 4px !important;
  padding: 0 !important;
}

body.wp-admin .erh-wrap .erh-page-hero p {
  color: var(--erh-admin-muted) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  margin: 0 !important;
  max-width: 920px !important;
}

body.wp-admin .erh-wrap .erh-brand-mark {
  border-radius: 10px !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14) !important;
  flex: 0 0 44px !important;
}

body.wp-admin .erh-wrap .erh-version-pill {
  align-self: start !important;
  background: var(--erh-admin-blue-soft) !important;
  border: 1px solid rgba(15, 107, 255, 0.18) !important;
  border-radius: 999px !important;
  color: var(--erh-admin-blue) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

body.wp-admin .erh-wrap .erh-panel,
body.wp-admin .erh-wrap .erh-card,
body.wp-admin .erh-wrap .erh-mini-card,
body.wp-admin .erh-wrap .erh-kpi-card,
body.wp-admin .erh-wrap .erh-filter-toolbar,
body.wp-admin .erh-wrap .erh-contract-manager,
body.wp-admin .erh-wrap .erh-contract-track-panel {
  background: var(--erh-admin-card) !important;
  border: 1px solid var(--erh-admin-line) !important;
  border-radius: var(--erh-admin-radius) !important;
  box-shadow: none !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.wp-admin .erh-wrap .erh-panel-heading {
  align-items: center !important;
  border-bottom: 1px solid var(--erh-admin-soft-line) !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  justify-content: space-between !important;
  margin: -2px 0 14px !important;
  padding: 0 0 12px !important;
}

body.wp-admin .erh-wrap .erh-panel-title {
  align-items: center !important;
  display: flex !important;
  gap: 10px !important;
  min-width: 0 !important;
}

body.wp-admin .erh-wrap .erh-panel-title .dashicons,
body.wp-admin .erh-wrap .erh-kpi-card .dashicons {
  align-items: center !important;
  background: var(--erh-admin-blue-soft) !important;
  border-radius: 8px !important;
  color: var(--erh-admin-blue) !important;
  display: inline-flex !important;
  justify-content: center !important;
}

body.wp-admin .erh-wrap .erh-panel-heading h2,
body.wp-admin .erh-wrap .erh-panel-heading h3 {
  color: var(--erh-admin-ink) !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.wp-admin .erh-wrap .erh-panel-heading small,
body.wp-admin .erh-wrap .erh-note {
  color: var(--erh-admin-muted) !important;
  line-height: 1.45 !important;
}

body.wp-admin .erh-wrap .erh-grid,
body.wp-admin .erh-wrap .erh-kpi-grid,
body.wp-admin .erh-wrap .erh-catalog-grid,
body.wp-admin .erh-wrap .erh-dashboard-panels,
body.wp-admin .erh-wrap .erh-health-grid {
  max-width: 100% !important;
  min-width: 0 !important;
}

body.wp-admin .erh-wrap .erh-contract-workbench {
  align-items: start !important;
  display: grid !important;
  gap: 14px !important;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px) !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.wp-admin .erh-wrap .erh-contract-workbench-main,
body.wp-admin .erh-wrap .erh-contract-workbench-side {
  max-width: 100% !important;
  min-width: 0 !important;
}

body.wp-admin .erh-wrap .erh-contract-workbench-side {
  align-self: start !important;
  position: sticky !important;
  top: 42px !important;
}

body.wp-admin .erh-wrap .erh-table-scroll,
body.wp-admin .erh-wrap .ehq-table-scroll,
body.wp-admin .erh-wrap .erh-front-table-scroll,
body.wp-admin .erh-wrap .erh-panel:has(table) {
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
}

body.wp-admin .erh-wrap .erh-table-scroll,
body.wp-admin .erh-wrap .ehq-table-scroll,
body.wp-admin .erh-wrap .erh-front-table-scroll {
  border: 1px solid var(--erh-admin-line) !important;
  border-radius: var(--erh-admin-radius) !important;
  background: #fff !important;
}

body.wp-admin .erh-wrap table.widefat,
body.wp-admin .erh-wrap .widefat,
body.wp-admin .erh-wrap table.erh-table {
  border: 0 !important;
  border-collapse: collapse !important;
  max-width: none !important;
  min-width: 860px !important;
  table-layout: auto !important;
  width: 100% !important;
}

body.wp-admin .erh-wrap th,
body.wp-admin .erh-wrap td {
  font-size: 12px !important;
  line-height: 1.35 !important;
  max-width: 420px !important;
  overflow-wrap: anywhere !important;
  padding: 8px 10px !important;
  vertical-align: middle !important;
}

body.wp-admin .erh-wrap .widefat thead th,
body.wp-admin .erh-wrap .widefat tfoot th {
  background: #eef5ff !important;
  border-bottom: 1px solid var(--erh-admin-line) !important;
  color: #40516b !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

body.wp-admin .erh-wrap .widefat tbody tr:hover td {
  background: #f8fbff !important;
}

body.wp-admin .erh-wrap td code,
body.wp-admin .erh-wrap td pre {
  display: block !important;
  max-width: 42rem !important;
  overflow-wrap: anywhere !important;
  white-space: pre-wrap !important;
}

body.wp-admin .erh-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
body.wp-admin .erh-wrap select,
body.wp-admin .erh-wrap textarea {
  border: 1px solid rgba(148, 163, 184, 0.58) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  color: var(--erh-admin-ink) !important;
  max-width: 100% !important;
  min-height: 34px !important;
}

body.wp-admin .erh-wrap input:focus,
body.wp-admin .erh-wrap select:focus,
body.wp-admin .erh-wrap textarea:focus {
  border-color: rgba(15, 107, 255, 0.62) !important;
  box-shadow: 0 0 0 3px rgba(15, 107, 255, 0.12) !important;
}

body.wp-admin .erh-wrap input[type="file"] {
  width: 100% !important;
}

body.wp-admin .erh-wrap .button,
body.wp-admin .erh-wrap button,
body.wp-admin .erh-wrap input[type="submit"] {
  align-items: center !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  justify-content: center !important;
  line-height: 1.2 !important;
  min-height: 32px !important;
  padding: 5px 12px !important;
  white-space: normal !important;
}

body.wp-admin .erh-wrap .button-primary,
body.wp-admin .erh-wrap button[type="submit"] {
  background: var(--erh-admin-blue) !important;
  border-color: var(--erh-admin-blue) !important;
  color: #fff !important;
}

body.wp-admin .erh-wrap .erh-actions,
body.wp-admin .erh-wrap .erh-inline-form,
body.wp-admin .erh-wrap .erh-module-actions,
body.wp-admin .erh-wrap .erh-front-module-actions {
  align-items: center !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  min-width: 0 !important;
}

body.wp-admin .erh-wrap .erh-pagination,
body.wp-admin .erh-wrap .ehq-pagination {
  align-items: center !important;
  background: #fff !important;
  border: 1px solid var(--erh-admin-line) !important;
  border-radius: var(--erh-admin-radius) !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  justify-content: flex-end !important;
  margin: 10px 0 !important;
  padding: 8px !important;
}

body.wp-admin .erh-wrap .erh-pagination span:first-child {
  color: var(--erh-admin-muted) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  margin-right: auto !important;
}

@media (max-width: 1180px) {
  body.wp-admin .erh-wrap .erh-contract-workbench {
    grid-template-columns: 1fr !important;
  }

  body.wp-admin .erh-wrap .erh-contract-workbench-side {
    position: static !important;
  }
}

@media (max-width: 782px) {
  body.wp-admin .erh-wrap {
    padding: 12px 10px 28px 10px !important;
  }

  body.wp-admin .erh-wrap .erh-page-hero {
    align-items: start !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  body.wp-admin .erh-wrap .erh-version-pill {
    grid-column: 1 / -1 !important;
    justify-self: start !important;
  }

  body.wp-admin .erh-wrap table.widefat,
  body.wp-admin .erh-wrap .widefat,
  body.wp-admin .erh-wrap table.erh-table {
    min-width: 760px !important;
  }
}

/* ───────────────────────────────────────────────────────────────
   Status badges (statements, payments)
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-badge {
  display: inline-block !important;
  padding: 2px 9px !important;
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  background: var(--erh-bg-muted, #f0f4ff) !important;
  color: var(--erh-text-secondary, #555) !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

body.wp-admin .erh-wrap .erh-badge--generated,
body.wp-admin .erh-wrap .erh-badge--draft {
  background: #fff3cd !important;
  color: #856404 !important;
}

body.wp-admin .erh-wrap .erh-badge--locked,
body.wp-admin .erh-wrap .erh-badge--paid {
  background: #d4edda !important;
  color: #155724 !important;
}

body.wp-admin .erh-wrap .erh-badge--void {
  background: #f8d7da !important;
  color: #721c24 !important;
  text-decoration: line-through !important;
}

/* ───────────────────────────────────────────────────────────────
   Danger button variant
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-btn-danger {
  background: #dc3545 !important;
  border-color: #b02a37 !important;
  color: #fff !important;
}
body.wp-admin .erh-wrap .erh-btn-danger:hover {
  background: #b02a37 !important;
  color: #fff !important;
}

/* ───────────────────────────────────────────────────────────────
   Form row: horizontal field layout
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-form-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px 20px !important;
  align-items: flex-end !important;
  margin-bottom: 12px !important;
}

body.wp-admin .erh-wrap .erh-form-row label {
  margin-bottom: 0 !important;
  flex-shrink: 0 !important;
}

/* ───────────────────────────────────────────────────────────────
   KPI row used on payments balance view
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-kpi-label--accent {
  color: var(--erh-blue, var(--ehq-primary)) !important;
  font-weight: 700 !important;
}
body.wp-admin .erh-wrap .erh-kpi-value--accent {
  color: var(--erh-blue, var(--ehq-primary)) !important;
  font-size: 22px !important;
}

/* ───────────────────────────────────────────────────────────────
   Inline filter row (payee dropdown above payments table)
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-inline-filter {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

/* ═══════════════════════════════════════════════════════════════
   POLISH PHASE: Dashboard Redesign v0.2
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   Typography: Calibri/Helvetica System Font Stack
   ─────────────────────────────────────────────────────────────── */
:root {
  --erh-font-family: 'Calibri', 'Helvetica', 'Arial', sans-serif;
  --erh-font-size-base: 14px;
  --erh-font-size-heading: 20px;
  --erh-font-weight-regular: 400;
  --erh-font-weight-bold: 600;
  --erh-font-weight-extra-bold: 700;
  --erh-spacing-icon-title: 8px;
  --erh-spacing-currency-code: 8px;
}

body.wp-admin .erh-wrap {
  font-family: var(--erh-font-family);
  font-size: var(--erh-font-size-base);
  font-weight: var(--erh-font-weight-regular);
}

body.wp-admin .erh-wrap h1,
body.wp-admin .erh-wrap h2,
body.wp-admin .erh-wrap h3,
body.wp-admin .erh-wrap h4,
body.wp-admin .erh-wrap h5,
body.wp-admin .erh-wrap h6 {
  font-family: var(--erh-font-family);
  font-weight: var(--erh-font-weight-bold);
}

/* ───────────────────────────────────────────────────────────────
   Dashboard Layout: New Grid Structure
   ─────────────────────────────────────────────────────────────── */

/* Top: KPI Row */
body.wp-admin .erh-wrap .erh-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Main dashboard 2-column layout */
body.wp-admin .erh-wrap .erh-dashboard-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* ───────────────────────────────────────────────────────────────
   Earnings Timeline: COMPACT (250px max)
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-earnings-timeline {
  height: 250px !important;
  max-height: 250px !important;
}

body.wp-admin .erh-wrap .erh-earnings-timeline canvas {
  max-height: 200px !important;
}

/* ───────────────────────────────────────────────────────────────
   Top Payees: MOVED TOP LEFT, 25 Visible, Scrollable
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-top-payees {
  height: 600px;
  overflow-y: auto;
  border: 1px solid #d0deff;
  border-radius: 8px;
  background: #ffffff;
}

body.wp-admin .erh-wrap .erh-top-payees-header {
  position: sticky;
  top: 0;
  background: #f6f8ff;
  padding: 12px;
  border-bottom: 1px solid #d0deff;
  font-weight: 600;
  font-size: 13px;
  color: #333;
  z-index: 10;
}

body.wp-admin .erh-wrap .erh-top-payees-row {
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f6;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  font-size: 12px;
  align-items: center;
}

body.wp-admin .erh-wrap .erh-top-payees-row:hover {
  background: #f9faff;
}

body.wp-admin .erh-wrap .erh-top-payees-row:last-child {
  border-bottom: none;
}

body.wp-admin .erh-wrap .erh-top-payees-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ───────────────────────────────────────────────────────────────
   Top Tracks: 10 Visible, Scrollable (320px)
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-top-tracks {
  height: 320px;
  overflow-y: auto;
  border: 1px solid #d0deff;
  border-radius: 8px;
  background: #ffffff;
}

body.wp-admin .erh-wrap .erh-top-tracks-header {
  position: sticky;
  top: 0;
  background: #f6f8ff;
  padding: 12px;
  border-bottom: 1px solid #d0deff;
  font-weight: 600;
  font-size: 13px;
  color: #333;
  z-index: 10;
}

body.wp-admin .erh-wrap .erh-top-tracks-row {
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f6;
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr;
  gap: 12px;
  font-size: 12px;
  align-items: center;
}

body.wp-admin .erh-wrap .erh-top-tracks-row:hover {
  background: #f9faff;
}

body.wp-admin .erh-wrap .erh-top-tracks-row:last-child {
  border-bottom: none;
}

/* ───────────────────────────────────────────────────────────────
   Top Stores: 10 Visible, Scrollable (260px)
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-top-stores {
  height: 260px;
  overflow-y: auto;
  border: 1px solid #d0deff;
  border-radius: 8px;
  background: #ffffff;
}

body.wp-admin .erh-wrap .erh-top-stores-header {
  position: sticky;
  top: 0;
  background: #f6f8ff;
  padding: 12px;
  border-bottom: 1px solid #d0deff;
  font-weight: 600;
  font-size: 13px;
  color: #333;
  z-index: 10;
}

body.wp-admin .erh-wrap .erh-top-stores-row {
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f6;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  font-size: 12px;
  align-items: center;
}

body.wp-admin .erh-wrap .erh-top-stores-row:hover {
  background: #f9faff;
}

body.wp-admin .erh-wrap .erh-top-stores-row:last-child {
  border-bottom: none;
}

/* ───────────────────────────────────────────────────────────────
   KPI Cards: Enhanced Style with Gradient & Hover
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-kpi-card {
  background: linear-gradient(135deg, #f6f8ff 0%, #ffffff 100%);
  border: 1px solid #d0deff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

body.wp-admin .erh-wrap .erh-kpi-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--ehq-primary);
  transform: translateY(-2px);
}

body.wp-admin .erh-wrap .erh-kpi-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.8;
  display: block;
}

body.wp-admin .erh-wrap .erh-kpi-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

body.wp-admin .erh-wrap .erh-kpi-value {
  font-size: 24px;
  font-weight: var(--erh-font-weight-extra-bold);
  color: var(--ehq-primary);
  margin: 12px 0 8px;
  word-break: break-word;
}

body.wp-admin .erh-wrap .erh-kpi-meta {
  font-size: 11px;
  color: #999;
  margin-top: 8px;
}

/* ───────────────────────────────────────────────────────────────
   Currency Display: Add 8px gap between $ and code
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-money-amount::after {
  content: ' ';
  margin-right: var(--erh-spacing-currency-code);
}

/* Icon + Title spacing */
body.wp-admin .erh-wrap .erh-icon-title {
  display: flex;
  align-items: center;
  gap: var(--erh-spacing-icon-title);
}

body.wp-admin .erh-wrap .erh-icon-title .erh-icon {
  flex-shrink: 0;
}

body.wp-admin .erh-wrap .erh-icon-title .erh-title {
  flex: 1;
}

/* ───────────────────────────────────────────────────────────────
   Panel Headings: Consistent spacing rule
   ─────────────────────────────────────────────────────────────── */
body.wp-admin .erh-wrap .erh-panel-heading {
  display: flex;
  align-items: center;
  gap: var(--erh-spacing-icon-title);
  margin-bottom: 16px;
}

body.wp-admin .erh-wrap .erh-panel-heading .dashicons {
  flex-shrink: 0;
  font-size: 20px;
  width: 20px;
  height: 20px;
  color: var(--ehq-primary);
}

body.wp-admin .erh-wrap .erh-panel-heading h2 {
  margin: 0;
  font-size: var(--erh-font-size-heading);
}

/* ───────────────────────────────────────────────────────────────
   Login Page & Error Page Styling
   ─────────────────────────────────────────────────────────────── */
.erh-auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f6f8ff 0%, #ffffff 100%);
  padding: 20px;
  font-family: var(--erh-font-family);
}

.erh-auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.erh-logo-auth {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.erh-auth-header h1 {
  font-size: 28px;
  font-weight: var(--erh-font-weight-bold);
  color: var(--ehq-primary);
  margin: 0;
  font-family: var(--erh-font-family);
}

.erh-auth-form {
  background: white;
  border: 1px solid #d0deff;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.erh-auth-form label {
  display: block;
  margin-bottom: 12px;
  font-weight: var(--erh-font-weight-bold);
  color: #333;
  font-size: 13px;
}

.erh-auth-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid #d0deff;
  border-radius: 6px;
  font-family: var(--erh-font-family);
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.erh-auth-form input:focus {
  outline: none;
  border-color: var(--ehq-primary);
  box-shadow: 0 0 0 3px rgba(15, 107, 255, 0.1);
}

.erh-auth-form button {
  width: 100%;
  padding: 12px;
  background: var(--ehq-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: var(--erh-font-weight-bold);
  cursor: pointer;
  font-family: var(--erh-font-family);
  font-size: 14px;
  transition: background 0.2s;
}

.erh-auth-form button:hover {
  background: #0d54cc;
}

.erh-auth-footer {
  text-align: center;
  margin-top: 24px;
  color: #999;
  font-size: 12px;
  max-width: 400px;
}

/* ───────────────────────────────────────────────────────────────
   Mobile Responsive
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  body.wp-admin .erh-wrap .erh-dashboard-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body.wp-admin .erh-wrap .erh-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  body.wp-admin .erh-wrap .erh-top-tracks-row,
  body.wp-admin .erh-wrap .erh-top-stores-row,
  body.wp-admin .erh-wrap .erh-top-payees-row {
    gap: 8px;
    font-size: 11px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT FIX v2 — 2-Column Grid
   ═══════════════════════════════════════════════════════════════ */

/* Force 2-column layout for dashboard main section */
.erh-dashboard-main {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 20px !important;
  margin-bottom: 24px !important;
  width: 100% !important;
}

/* Earnings Timeline - Left Column, Top */
.erh-dashboard-main .erh-earnings-timeline {
  grid-column: 1 !important;
  grid-row: 1 !important;
  height: 250px !important;
  max-height: 250px !important;
}

/* Top Payees - Right Column, Top */
.erh-dashboard-main .erh-top-payees {
  grid-column: 2 !important;
  grid-row: 1 !important;
  height: 600px !important;
  overflow-y: auto !important;
}

/* Top Tracks - Left Column, Bottom */
.erh-dashboard-main .erh-top-tracks {
  grid-column: 1 !important;
  grid-row: 2 !important;
  height: 320px !important;
  overflow-y: auto !important;
}

/* Top Stores - Right Column, Bottom */
.erh-dashboard-main .erh-top-stores {
  grid-column: 2 !important;
  grid-row: 2 !important;
  height: 260px !important;
  overflow-y: auto !important;
}

/* Currency spacing fix - 8px gap between amount and code */
.erh-money-display {
  display: inline-block;
}

.erh-money-amount,
.erh-currency-code {
  display: inline;
}

.erh-money-amount::after {
  content: ' ';
  margin-right: 8px;
}

/* Fix Top Stores pagination - show only 10 rows */
.erh-top-stores-body {
  max-height: 260px;
  overflow-y: auto;
}

.erh-top-stores-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f6;
  font-size: 12px;
  align-items: center;
}

.erh-top-stores-row:nth-child(n+11) {
  display: none;
}


/* — END §35 — */

/* ════════════════════════════════════════════════════════════════════
   §36 — e-SUITE-FRONT (migrated from ë • distribution v1.10.27
                         assets/css/e-suite-front.css, 2147 LOC)
   ════════════════════════════════════════════════════════════════════
   Scope: frontend module (/distribution/ views). Defines --ehq-app-*
   tokens + frontend-specific shell + table + drawer overrides.

   Previously enqueued as 'erh-suite-app' via enqueue_shared_stylesheet()
   helper. The helper is kept as a no-op safety net (returns '' since the
   source file is gone) and can be removed in v1.10.28.
   ──────────────────────────────────────────────────────────────────── */

:root {
    --ehq-app-ink: #111827;
    --ehq-app-paper: #f4f7fc;
    --ehq-app-card: #ffffff;
    --ehq-app-line: rgba(30, 41, 59, 0.14);
    --ehq-app-blue: var(--wp--preset--color--primary, #0f6bff);
    --ehq-app-blue-deep: var(--wp--preset--color--primary-dark, #0b2f6b);
    --ehq-app-blue-soft: #eaf2ff;
    --ehq-app-sky: #4da3ff;
    --ehq-app-gold: var(--wp--preset--color--accent, #c8963e);
    --ehq-app-shadow: 0 1rem 2.6rem rgba(15, 44, 94, 0.12);
    --ehq-app-shadow-tight: 0 0.65rem 1.6rem rgba(15, 44, 94, 0.09);
    --ehq-app-radius: 1.15rem;
    --ehq-app-radius-sm: 0.75rem;
}

.eof-wrap,
.erh-wrap,
.erh-standalone-body,
.eof-frontend-body {
    background:
        radial-gradient(circle at 10% 0%, rgba(15, 107, 255, 0.12), transparent 24rem),
        radial-gradient(circle at 85% 8%, rgba(11, 47, 107, 0.1), transparent 26rem),
        var(--ehq-app-paper) !important;
}

.eof-page-hero,
.erh-page-hero,
.erh-front-hero,
.eof-front-lock section,
.erh-front-lock {
    background: var(--ehq-app-card) !important;
    border: 1px solid var(--ehq-app-line) !important;
    border-radius: var(--ehq-app-radius) !important;
    box-shadow: var(--ehq-app-shadow) !important;
}

.eof-page-hero h1,
.erh-page-hero h1,
.erh-front-hero h1 {
    color: var(--ehq-app-ink) !important;
    letter-spacing: 0 !important;
}

.eof-brand-mark,
.erh-brand-mark,
.erh-front-mark {
    background: var(--ehq-app-ink) !important;
    border-radius: 999px !important;
    color: var(--ehq-app-paper) !important;
}

.eof-version-pill,
.erh-version-pill,
.erh-status-pill,
.eof-chip {
    background: rgba(23, 105, 255, 0.1) !important;
    border: 1px solid rgba(23, 105, 255, 0.18) !important;
    color: var(--ehq-app-blue) !important;
}

.erh-wrap a.button,
.eof-wrap a.button,
.eof-wrap button,
.erh-wrap button,
.erh-front-lock a,
.eof-front-lock a {
    border-radius: 999px !important;
    font-weight: 800 !important;
}

.eof-app-root,
.erh-dashboard-grid,
.erh-front-grid {
    --module-accent: var(--ehq-app-blue);
}

.erh-wrap,
.erh-standalone-body {
    --module-accent: var(--ehq-app-blue);
}

/* Shared module safeguards: keep internal pages fluid and touch-friendly. */
.eof-wrap,
.erh-wrap,
.eof-frontend-body,
.erh-standalone-body {
    max-width: 100%;
    overflow-x: hidden;
}

.eof-wrap *,
.erh-wrap *,
.eof-frontend-body *,
.erh-standalone-body * {
    box-sizing: border-box;
}

.eof-panel,
.erh-panel,
.eof-form,
.erh-filter-toolbar,
.eof-reference-list,
.erh-table-scroll {
    max-width: 100%;
    min-width: 0;
}

.eof-panel:has(table),
.erh-panel:has(table),
.erh-table-scroll {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

.eof-panel th,
.eof-panel td,
.erh-panel th,
.erh-panel td {
    overflow-wrap: anywhere;
}

@media (max-width: 782px) {
    .eof-page-hero,
    .erh-page-hero,
    .eof-front-topbar,
    .erh-front-topbar {
        align-items: flex-start !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}

/* Cache-busted responsive polish shared by installed modules. */
.erh-front-table-scroll,
.erh-table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.erh-filter-toolbar p.submit,
.erh-toolbar p.submit {
    margin: 0 !important;
    padding: 0 !important;
}

/* W3POS-inspired shared element system for office/distribution modules. */
.eof-wrap,
.erh-wrap,
.eof-frontend-body,
.erh-standalone-body {
    color: var(--ehq-app-ink);
}

.eof-wrap a,
.erh-wrap a,
.eof-frontend-body a,
.erh-standalone-body a {
    color: var(--module-accent, var(--ehq-app-blue));
    text-decoration: none;
    text-underline-offset: 0.18em;
}

.eof-wrap a:hover,
.erh-wrap a:hover,
.eof-frontend-body a:hover,
.erh-standalone-body a:hover {
    color: var(--ehq-app-sky, #4da3ff);
    text-decoration: underline;
}

.eof-wrap .button,
.erh-wrap .button,
.eof-wrap button,
.erh-wrap button,
.eof-frontend-body button,
.erh-standalone-body button,
.eof-frontend-body .button,
.erh-standalone-body .button,
.ehq-module-button {
    align-items: center !important;
    border-radius: 0.75rem !important;
    box-shadow: none !important;
    cursor: pointer;
    display: inline-flex !important;
    font-weight: 800 !important;
    gap: 0.42rem;
    justify-content: center;
    min-height: 2.45rem;
    padding: 0.55rem 0.95rem !important;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
    white-space: normal;
}

.eof-wrap .button-primary,
.erh-wrap .button-primary,
.eof-wrap button[type="submit"],
.erh-wrap button[type="submit"],
.ehq-module-button.is-primary {
    background: var(--module-accent, var(--ehq-app-blue)) !important;
    border-color: var(--module-accent, var(--ehq-app-blue)) !important;
    color: #fff !important;
}

.eof-wrap .button:hover,
.erh-wrap .button:hover,
.eof-wrap button:hover,
.erh-wrap button:hover,
.ehq-module-button:hover {
    box-shadow: 0 0.6rem 1.35rem rgba(15, 107, 255, 0.16) !important;
    transform: translateY(-1px);
}

.eof-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.erh-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.eof-wrap select,
.erh-wrap select,
.eof-wrap textarea,
.erh-wrap textarea,
.eof-frontend-body input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.erh-standalone-body input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.eof-frontend-body select,
.erh-standalone-body select,
.eof-frontend-body textarea,
.erh-standalone-body textarea {
    background: #fff !important;
    border: 1px solid rgba(148, 163, 184, 0.55) !important;
    border-radius: 0.72rem !important;
    box-shadow: 0 1px 0 rgba(15, 44, 94, 0.04);
    color: var(--ehq-app-ink) !important;
    max-width: 100%;
    min-height: 2.55rem;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.eof-wrap input:focus,
.erh-wrap input:focus,
.eof-wrap select:focus,
.erh-wrap select:focus,
.eof-wrap textarea:focus,
.erh-wrap textarea:focus,
.eof-frontend-body input:focus,
.erh-standalone-body input:focus,
.eof-frontend-body select:focus,
.erh-standalone-body select:focus,
.eof-frontend-body textarea:focus,
.erh-standalone-body textarea:focus {
    border-color: rgba(15, 107, 255, 0.62) !important;
    box-shadow: 0 0 0 0.22rem rgba(15, 107, 255, 0.12) !important;
}

.eof-wrap input[type="checkbox"],
.erh-wrap input[type="checkbox"],
.eof-wrap input[type="radio"],
.erh-wrap input[type="radio"] {
    border-color: rgba(100, 116, 139, 0.5) !important;
    box-shadow: none !important;
}

.eof-wrap input[type="checkbox"]:checked,
.erh-wrap input[type="checkbox"]:checked,
.eof-wrap input[type="radio"]:checked,
.erh-wrap input[type="radio"]:checked {
    background-color: var(--module-accent, var(--ehq-app-blue)) !important;
    border-color: var(--module-accent, var(--ehq-app-blue)) !important;
}

.ehq-module-canvas {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.34fr);
    max-width: 100%;
    min-width: 0;
}

.ehq-module-section,
.ehq-module-rail,
.ehq-module-cardlet,
.ehq-module-metric,
.eof-panel,
.erh-panel,
.erh-front-panel {
    background: var(--ehq-app-card) !important;
    border: 1px solid var(--ehq-app-line) !important;
    border-radius: var(--ehq-app-radius) !important;
    box-shadow: var(--ehq-app-shadow-tight) !important;
    min-width: 0;
}

.ehq-module-section,
.ehq-module-rail,
.ehq-module-cardlet,
.ehq-module-metric {
    overflow: hidden;
    padding: clamp(1rem, 2vw, 1.35rem);
}

.ehq-module-stack {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.ehq-module-toolbar,
.erh-filter-toolbar,
.eof-toolbar,
.erh-toolbar {
    align-items: end;
    display: grid !important;
    gap: 0.75rem !important;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    max-width: 100%;
    min-width: 0;
}

.ehq-module-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.ehq-module-cardlet {
    position: relative;
}

.ehq-module-cardlet::before {
    background: linear-gradient(135deg, rgba(15, 107, 255, 0.16), transparent 65%);
    content: "";
    height: 7rem;
    position: absolute;
    right: -2.5rem;
    top: -2.5rem;
    transform: rotate(12deg);
    width: 10rem;
}

.ehq-module-metric strong {
    color: var(--ehq-app-ink);
    display: block;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0;
    line-height: 1;
}

.ehq-module-metric span {
    color: var(--ehq-text-muted);
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    margin-top: 0.35rem;
    text-transform: uppercase;
}

.ehq-module-status,
.erh-status-pill,
.eof-chip {
    align-items: center;
    background: rgba(15, 107, 255, 0.1) !important;
    border: 1px solid rgba(15, 107, 255, 0.18) !important;
    border-radius: 999px !important;
    color: var(--module-accent, var(--ehq-app-blue)) !important;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 900;
    gap: 0.35rem;
    min-height: 1.9rem;
    padding: 0 0.7rem;
}

.ehq-module-table-scroll,
.erh-front-table-scroll,
.erh-table-scroll {
    background:
        linear-gradient(to right, var(--ehq-app-card) 30%, rgba(255, 255, 255, 0)),
        linear-gradient(to right, rgba(255, 255, 255, 0), var(--ehq-app-card) 70%) 100% 0,
        radial-gradient(farthest-side at 0 50%, rgba(15, 44, 94, 0.12), rgba(15, 44, 94, 0)),
        radial-gradient(farthest-side at 100% 50%, rgba(15, 44, 94, 0.12), rgba(15, 44, 94, 0)) 100% 0;
    background-attachment: local, local, scroll, scroll;
    background-repeat: no-repeat;
    background-size: 2.5rem 100%, 2.5rem 100%, 0.85rem 100%, 0.85rem 100%;
    border-radius: var(--ehq-app-radius);
    max-width: 100%;
    overflow-x: auto;
}

.eof-wrap table,
.erh-wrap table,
.eof-frontend-body table,
.erh-standalone-body table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    color: var(--ehq-app-ink);
}

.ehq-module-table-scroll table,
.erh-front-table-scroll table,
.erh-table-scroll table {
    min-width: 100%;
}

.eof-wrap th,
.erh-wrap th,
.eof-frontend-body th,
.erh-standalone-body th {
    background: #f8fbff !important;
    color: #334155 !important;
    font-size: 0.74rem;
    font-weight: 900 !important;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.eof-wrap td,
.erh-wrap td,
.eof-frontend-body td,
.erh-standalone-body td {
    border-color: rgba(148, 163, 184, 0.22) !important;
    vertical-align: middle;
}

.eof-wrap tbody tr,
.erh-wrap tbody tr,
.eof-frontend-body tbody tr,
.erh-standalone-body tbody tr {
    transition: background 120ms ease;
}

.eof-wrap tbody tr:hover,
.erh-wrap tbody tr:hover,
.eof-frontend-body tbody tr:hover,
.erh-standalone-body tbody tr:hover {
    background: rgba(15, 107, 255, 0.045) !important;
}

.ehq-zone-main {
    min-width: 0;
}

.ehq-zone-rail {
    min-width: 0;
}

.ehq-zone-wide,
.ehq-span-2 {
    grid-column: 1 / -1;
}

.ehq-order-1 {
    order: 1;
}

.ehq-order-2 {
    order: 2;
}

.ehq-order-3 {
    order: 3;
}

.ehq-order-4 {
    order: 4;
}

.ehq-order-5 {
    order: 5;
}

.ehq-order-6 {
    order: 6;
}

@media (max-width: 1180px) {
    .ehq-module-canvas {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 782px) {
    .ehq-module-toolbar,
    .erh-filter-toolbar,
    .eof-toolbar,
    .erh-toolbar {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .eof-wrap .button,
    .erh-wrap .button,
    .eof-wrap button,
    .erh-wrap button,
    .ehq-module-button {
        width: 100%;
    }
}

/* Blue polished stabilization: modules adapt to the common template shell. */
.eof-wrap,
.eof-root,
.eof-frontend-body,
.eof-front-shell,
.erh-wrap,
.erh-standalone-body,
.erh-front-shell {
    --eof-primary: var(--ehq-app-blue);
    --eof-primary-deep: var(--ehq-app-blue-deep);
    --eof-primary-soft: var(--ehq-app-blue-soft);
    --eof-border: #cfe0f3;
    --eof-border-strong: #bfd3ec;
    --eof-bg: var(--ehq-app-paper);
    --eof-ink: var(--ehq-app-ink);
    --eof-muted: #516179;
    --eof-navy: var(--ehq-app-blue-deep);
    --eof-navy-muted: #516179;
    --eof-blue-pale: var(--ehq-app-blue-soft);
    --eof-blue-line: #cfe0f3;
    --erh-blue: var(--ehq-app-blue);
    --erh-primary: var(--ehq-app-blue);
    --erh-primary-dark: var(--ehq-app-blue-deep);
    --erh-primary-deep: var(--ehq-app-blue-deep);
    --erh-primary-soft: var(--ehq-app-blue-soft);
    --erh-primary-softer: #f6f9ff;
    --erh-body-bg: var(--ehq-app-paper);
    --erh-border: #cfe0f3;
    --erh-border-strong: #bfd3ec;
    --erh-ink: var(--ehq-app-ink);
    --erh-muted: #516179;
    --erh-navy: var(--ehq-app-blue-deep);
    --erh-navy-muted: #516179;
    --erh-blue-pale: var(--ehq-app-blue-soft);
    --erh-blue-line: #cfe0f3;
}

.eof-wrap,
.eof-root,
.eof-frontend-body,
.erh-wrap,
.erh-standalone-body,
.erh-front-shell {
    background:
        radial-gradient(circle at 12% -6%, rgba(15, 107, 255, 0.12), transparent 28rem),
        radial-gradient(circle at 92% 0%, rgba(11, 47, 107, 0.09), transparent 26rem),
        var(--ehq-app-paper) !important;
}

.erh-standalone-body {
    color: var(--ehq-app-ink) !important;
    margin: 0 !important;
    overflow-x: hidden !important;
}

.erh-front-shell {
    box-sizing: border-box;
    display: grid;
    gap: 1rem;
    margin: 0 auto;
    max-width: 1440px;
    min-width: 0;
    padding: clamp(0.85rem, 2vw, 1.5rem);
    width: 100%;
}

.erh-front-topbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.9rem clamp(1rem, 2vw, 1.35rem) !important;
}

.erh-front-brand {
    align-items: center;
    color: var(--ehq-app-ink) !important;
    display: inline-flex;
    gap: 0.85rem;
    min-width: 0;
    text-decoration: none !important;
}

.erh-front-brand-mark {
    align-items: center;
    background: var(--ehq-app-blue-soft);
    border: 1px solid rgba(15, 107, 255, 0.2);
    border-radius: 1rem;
    display: inline-flex;
    flex: 0 0 auto;
    height: 3rem;
    justify-content: center;
    overflow: hidden;
    width: 3rem;
}

.erh-front-brand-mark img {
    display: block;
    height: 2.15rem;
    object-fit: contain;
    width: 2.15rem;
}

.erh-front-brand small,
.erh-front-brand strong {
    display: block;
    line-height: 1.15;
}

.erh-front-brand small {
    color: var(--ehq-app-blue);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.erh-front-brand strong {
    color: var(--ehq-app-blue-deep);
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    letter-spacing: 0;
}

.erh-front-topbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.erh-front-button,
.erh-front-button:visited {
    align-items: center;
    border: 1px solid rgba(15, 107, 255, 0.24);
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 900;
    gap: 0.35rem;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.55rem 0.9rem;
    text-decoration: none !important;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

.erh-front-button:hover {
    box-shadow: 0 0.75rem 1.5rem rgba(15, 107, 255, 0.16);
    transform: translateY(-1px);
}

.erh-front-button.is-primary {
    background: var(--ehq-app-blue) !important;
    border-color: var(--ehq-app-blue) !important;
    color: #fff !important;
}

.erh-front-button.is-secondary {
    background: #fff !important;
    color: var(--ehq-app-blue-deep) !important;
}

.erh-front-nav {
    align-items: center;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--ehq-app-line);
    border-radius: var(--ehq-app-radius);
    box-shadow: var(--ehq-app-shadow-tight);
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.55rem;
    scrollbar-width: thin;
}

.erh-front-nav-link,
.erh-front-nav-link:visited {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ehq-text-muted) !important;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 900;
    gap: 0.38rem;
    min-height: 2.25rem;
    padding: 0.48rem 0.78rem;
    text-decoration: none !important;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.erh-front-nav-link .dashicons {
    font-size: 1rem;
    height: 1rem;
    line-height: 1;
    width: 1rem;
}

.erh-front-nav-link:hover,
.erh-front-nav-link.is-active {
    background: var(--ehq-app-blue-soft) !important;
    border-color: rgba(15, 107, 255, 0.24) !important;
    color: var(--ehq-app-blue-deep) !important;
}

.erh-front-workspace,
.erh-front-backend,
.erh-front-backend .erh-wrap {
    box-sizing: border-box;
    margin: 0 !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.erh-front-backend .erh-wrap {
    display: block !important;
}

.erh-front-backend .erh-page-hero {
    display: none !important;
}

.eof-page-hero,
.eof-front-topbar,
.erh-page-hero,
.erh-front-hero,
.erh-front-topbar {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(234, 242, 255, 0.82) 58%, rgba(246, 249, 255, 0.94)),
        var(--ehq-app-card) !important;
    border-color: var(--ehq-app-line) !important;
}

.eof-brand-mark,
.eof-front-brand .dashicons,
.erh-brand-mark,
.erh-front-mark,
.erh-kpi-card .dashicons,
.erh-front-kpi > i.dashicons {
    background: var(--ehq-app-blue-soft) !important;
    color: var(--ehq-app-blue) !important;
}

.eof-wrap .button-primary,
.eof-wrap input.button-primary,
.eof-wrap input[type="submit"].button-primary,
.eof-frontend-body .eof-form button,
.eof-frontend-body .eof-small-button,
.eof-front-lock a,
.erh-wrap .button-primary,
.erh-wrap input.button-primary,
.erh-wrap input[type="submit"].button-primary,
.erh-front-backend .button-primary,
.erh-front-backend input.button-primary,
.erh-front-backend input[type="submit"].button-primary,
.erh-front-lock a,
.erh-pagination .erh-page-current,
.erh-front-backend .erh-pagination .erh-page-current {
    background: var(--ehq-app-blue) !important;
    border-color: var(--ehq-app-blue) !important;
    color: #fff !important;
}

.eof-wrap .button:hover,
.eof-wrap button:hover,
.eof-front-topbar a:hover,
.eof-front-side nav a:hover,
.eof-front-side nav a.is-active,
.erh-wrap .button:hover,
.erh-wrap button:hover,
.erh-pagination .button:hover,
.erh-dashboard-table-pager .button:hover,
.erh-dashboard-table-pager button:hover,
.erh-front-backend .button:hover {
    background: var(--ehq-app-blue-soft) !important;
    border-color: rgba(15, 107, 255, 0.28) !important;
    color: var(--ehq-app-blue-deep) !important;
}

.erh-bar-track span,
.erh-store-meter span,
.erh-mini-progress span,
.erh-front-bar > span:first-child,
.erh-front-store-row i {
    background: linear-gradient(180deg, #4da3ff, var(--ehq-app-blue)) !important;
}

.erh-front-store-row i {
    background: linear-gradient(90deg, #4da3ff, var(--ehq-app-blue)) !important;
}

.eof-version-pill,
.eof-badge,
.eof-status,
.eof-chip,
.erh-version-pill,
.erh-status-pill,
.ehq-module-status {
    background: var(--ehq-app-blue-soft) !important;
    border-color: rgba(15, 107, 255, 0.22) !important;
    color: var(--ehq-app-blue-deep) !important;
}

.eof-table-wrap,
.erh-table-scroll,
.erh-front-table-scroll,
.erh-dashboard-table-scroll,
.erh-catalog-table-scroll,
.erh-duplicate-table-scroll {
    border-color: #cfe0f3 !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.eof-panel,
.erh-panel,
.erh-front-panel,
.erh-dashboard-table-panel,
.erh-front-dashboard-main,
.erh-front-dashboard-side,
.erh-front-dashboard-layout,
.erh-catalog-bulk-form,
.erh-duplicates-grid {
    min-width: 0 !important;
}

.eof-panel table,
.erh-panel table,
.erh-front-panel table {
    max-width: 100%;
}

.erh-dashboard-table-panel .erh-table,
.erh-front-panel table {
    table-layout: fixed !important;
    width: 100% !important;
}

.erh-catalog-table,
.erh-front-backend .erh-catalog-table {
    min-width: 1120px !important;
    table-layout: fixed !important;
}

.erh-wrap .widefat thead th,
.erh-wrap .widefat tfoot th,
.eof-panel th,
.erh-front-panel th,
.erh-front-backend .widefat thead th {
    background: linear-gradient(180deg, #f8fbff, var(--ehq-app-blue-soft)) !important;
    border-color: #cfe0f3 !important;
    color: var(--ehq-text-muted) !important;
}

.erh-wrap .widefat tbody tr:hover td,
.eof-panel tbody tr:hover td,
.erh-front-panel tbody tr:hover td,
.erh-front-backend .widefat tbody tr:hover td {
    background: #f6fbff !important;
}

.erh-catalog-filter,
.erh-front-backend .erh-catalog-filter {
    align-items: end !important;
    display: grid !important;
    gap: 0.7rem !important;
    grid-template-columns: minmax(16rem, 1.35fr) minmax(10rem, 0.6fr) minmax(12rem, 0.85fr) auto auto !important;
}

.erh-catalog-filter p.submit,
.erh-filter-toolbar p.submit,
.erh-toolbar p.submit {
    align-self: end !important;
}

.erh-catalog-filter .button,
.erh-catalog-filter input[type="submit"],
.erh-front-backend .erh-catalog-filter .button,
.erh-front-backend .erh-catalog-filter input[type="submit"] {
    min-width: 6.5rem !important;
    width: auto !important;
}

.erh-pagination,
.erh-dashboard-table-pager {
    align-items: center !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
}

.erh-pagination span:first-child,
.erh-dashboard-table-pager span {
    color: var(--ehq-text-muted) !important;
    font-weight: 700 !important;
    margin-right: auto !important;
}

@media (max-width: 1180px) {
    .erh-front-dashboard-layout,
    .erh-dashboard-panels,
    .erh-front-panels,
    .erh-duplicates-grid,
    .erh-front-backend .erh-duplicates-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 782px) {
    .eof-wrap,
    .erh-wrap {
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    .erh-catalog-filter,
    .erh-front-backend .erh-catalog-filter {
        grid-template-columns: 1fr !important;
    }

    .erh-catalog-filter .button,
    .erh-catalog-filter input[type="submit"],
    .erh-front-backend .erh-catalog-filter .button,
    .erh-front-backend .erh-catalog-filter input[type="submit"] {
        width: 100% !important;
    }
}

/* ─── Alignment normalisation ──────────────────────────────────────────────
   Ensure every direct content block inside the frontend shell shares the
   same left edge. Prevents the gap caused by mixed padding contexts between
   .erh-front-shell (padded) and .erh-front-backend children (padding: 0). */
.erh-front-shell > *,
.erh-front-backend > *,
.erh-front-workspace > * {
    box-sizing: border-box;
}

.erh-front-shell .erh-panel,
.erh-front-shell .erh-front-panel,
.erh-front-shell .erh-dashboard-table-panel,
.erh-front-shell .erh-front-dashboard-layout,
.erh-front-shell .erh-front-dashboard-main,
.erh-front-shell .erh-kpi-grid,
.erh-front-shell .erh-dashboard-main,
.erh-front-shell .erh-catalog-grid,
.erh-front-shell .erh-wrap {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ==========================================================================

   ë • hq suite layout system
   Purpose: product UI sizing, no global horizontal drift,
   compact controls, single real pagination, local table scroll.
   ============================================================ */
:root {
  --ehq-suite-page-gap: 16px;
  --ehq-suite-blue: var(--wp--preset--color--primary, #0f6bff);
  --ehq-suite-ink: #0f172a;
  --ehq-suite-muted: #475569;
  --ehq-suite-line: #cfe0f7;
  --ehq-suite-card: #fff;
  --ehq-suite-bg: #eef4fb;
}

/* Frontend distribution module: the theme owns the page shell. */
body.erh-standalone-body {
  background: var(--ehq-suite-bg) !important;
  color: var(--ehq-suite-ink) !important;
  margin: 0 !important;
  overflow-x: hidden !important;
}

body.erh-standalone-body .erh-front-shell,
.erh-front-shell {
  width: 100% !important;
  max-width: 1440px !important;
  min-width: 0 !important;
  overflow-x: clip !important;
}

body.erh-standalone-body .erh-front-workspace,
body.erh-standalone-body .erh-front-backend,
body.erh-standalone-body .erh-front-backend .erh-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.erh-standalone-body .erh-front-backend .erh-wrap {
  display: block !important;
}

body.erh-standalone-body .erh-front-backend .erh-page-hero {
  display: none !important;
}

body.erh-standalone-body .erh-front-topbar,
body.erh-standalone-body .erh-front-nav {
  max-width: 100% !important;
  min-width: 0 !important;
}

/* Cards/forms */
body.erh-standalone-body .erh-front-hero,
body.erh-standalone-body .erh-front-kpi,
body.erh-standalone-body .erh-front-mini,
body.erh-standalone-body .erh-front-panel,
body.erh-standalone-body .erh-front-backend .erh-panel,
body.erh-standalone-body .erh-front-backend .erh-card,
body.erh-standalone-body .erh-front-backend .erh-filter-toolbar {
  background: var(--ehq-suite-card) !important;
  border: 1px solid var(--ehq-suite-line) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.erh-standalone-body .erh-front-backend .erh-panel,
body.erh-standalone-body .erh-front-backend .erh-card {
  padding: 14px !important;
  margin: 0 0 14px !important;
}

body.erh-standalone-body .erh-front-backend .erh-grid,
body.erh-standalone-body .erh-front-backend .erh-grid.compact {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)) !important;
  gap: 12px !important;
  margin: 0 0 14px !important;
}

/* Tables: never drive the page width. */
body.erh-standalone-body .ehq-table-scroll,
body.erh-standalone-body .erh-table-scroll,
body.erh-standalone-body .erh-front-table-scroll {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  border: 1px solid var(--ehq-suite-line) !important;
  border-radius: 10px !important;
  background: #fff !important;
}

body.erh-standalone-body .erh-front-backend table,
body.erh-standalone-body .erh-wrap table,
body.erh-standalone-body .widefat {
  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  margin: 0 !important;
}

body.erh-standalone-body .erh-front-backend th,
body.erh-standalone-body .erh-front-backend td,
body.erh-standalone-body .erh-wrap th,
body.erh-standalone-body .erh-wrap td {
  font-size: 12px !important;
  line-height: 1.35 !important;
  padding: 8px 10px !important;
  vertical-align: middle !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

body.erh-standalone-body .erh-front-backend th,
body.erh-standalone-body .erh-wrap th {
  background: #eef5ff !important;
  color: #40516b !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

body.erh-standalone-body .erh-front-backend td code,
body.erh-standalone-body .erh-front-backend td pre,
body.erh-standalone-body .erh-wrap td code,
body.erh-standalone-body .erh-wrap td pre {
  display: block !important;
  max-width: 42rem !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

/* Controls and buttons compact */
body.erh-standalone-body .erh-front-backend input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
body.erh-standalone-body .erh-front-backend select,
body.erh-standalone-body .erh-front-backend textarea {
  min-height: 34px !important;
  height: auto !important;
  border-radius: 8px !important;
  border: 1px solid #bfd2ee !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
  max-width: 100% !important;
}

body.erh-standalone-body .erh-front-backend .button,
body.erh-standalone-body .erh-front-backend .button-primary,
body.erh-standalone-body .erh-front-backend .button-secondary,
body.erh-standalone-body .erh-front-backend button,
body.erh-standalone-body .erh-front-backend input[type="submit"],
body.erh-standalone-body .btn {
  min-height: 32px !important;
  height: auto !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

/* Pagination: only real pagination, compact, top/bottom friendly. */
body.erh-standalone-body .erh-pagination,
body.erh-standalone-body .ehq-pagination {
  align-items: center !important;
  background: #fff !important;
  border: 1px solid #d9e6f7 !important;
  border-radius: 10px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  justify-content: flex-end !important;
  margin: 10px 0 !important;
  padding: 8px !important;
  position: static !important;
  top: auto !important;
  z-index: 1 !important;
}

body.erh-standalone-body .erh-pagination span:first-child {
  color: #40516b !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  margin-right: auto !important;
}

body.erh-standalone-body .ehq-pagination-clone {
  display: none !important;
}

/* Contract page: reduce side editor pressure. */
body.erh-standalone-body .erh-contract-workbench {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px) !important;
  gap: 14px !important;
  align-items: start !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.erh-standalone-body .erh-contract-workbench-main,
body.erh-standalone-body .erh-contract-workbench-side {
  min-width: 0 !important;
  max-width: 100% !important;
}

body.erh-standalone-body .erh-contract-workbench-side {
  position: sticky !important;
  top: 78px !important;
  align-self: start !important;
}

body.erh-standalone-body .erh-contract-workbench-side .erh-panel,
body.erh-standalone-body .erh-contract-workbench-side .erh-card,
body.erh-standalone-body .erh-contract-manage-panel {
  max-height: calc(100vh - 100px) !important;
  overflow: auto !important;
}

body.erh-standalone-body .erh-contract-workbench-side input,
body.erh-standalone-body .erh-contract-workbench-side select {
  width: 100% !important;
  max-width: 100% !important;
}

/* Dashboard: do not let right rail force horizontal drift. */
body.erh-standalone-body .erh-front-dashboard-layout,
body.erh-standalone-body .erh-front-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px) !important;
  gap: 14px !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.erh-standalone-body .erh-front-dashboard-main,
body.erh-standalone-body .erh-front-dashboard-side {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 1180px) {
  body.erh-standalone-body .erh-contract-workbench,
  body.erh-standalone-body .erh-front-dashboard-layout,
  body.erh-standalone-body .erh-front-content {
    grid-template-columns: 1fr !important;
  }

  body.erh-standalone-body .erh-contract-workbench-side {
    position: static !important;
  }

  body.erh-standalone-body .erh-contract-workbench-side .erh-panel,
  body.erh-standalone-body .erh-contract-workbench-side .erh-card,
  body.erh-standalone-body .erh-contract-manage-panel {
    max-height: none !important;
  }
}

@media (max-width: 860px) {
  .erh-front-shell {
    padding: 12px !important;
  }

  .erh-front-topbar {
    align-items: stretch !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .erh-front-topbar-actions {
    justify-content: stretch;
  }

  .erh-front-topbar-actions .erh-front-button {
    flex: 1 1 10rem;
  }

  body.erh-standalone-body .erh-pagination,
  body.erh-standalone-body .ehq-pagination {
    position: static !important;
  }
}

/* Dashboard side rail and readable audit/details cells. */
body.erh-standalone-body .erh-front-store-panel .erh-front-store-list {
  max-height: 32rem !important;
  overflow: auto !important;
}

body.erh-standalone-body .erh-front-store-panel .erh-front-store-row {
  min-width: 0 !important;
}

body.erh-standalone-body .erh-front-table-scroll td,
body.erh-standalone-body .erh-front-table-scroll th {
  min-width: 0 !important;
}

body.erh-standalone-body .erh-front-table-scroll td code,
body.erh-standalone-body .erh-front-table-scroll td pre {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}


/* Table header behavior: keep headers in the table head and prevent mid-table header drift. */
body.erh-standalone-body .erh-front-table-scroll table thead,
body.erh-standalone-body .erh-front-table-scroll table thead tr {
  display: table-header-group !important;
}

body.erh-standalone-body .erh-front-table-scroll table tbody,
body.erh-standalone-body .erh-front-table-scroll table tbody tr {
  display: table-row-group !important;
}

body.erh-standalone-body .erh-front-table-scroll table th,
body.erh-standalone-body .erh-front-table-scroll table td {
  position: static !important;
}

body.erh-standalone-body .erh-front-table-scroll table tr[data-erh-dashboard-row] {
  display: table-row !important;
}

/* Money values: keep multi-currency totals readable in dashboard order. */
.erh-money-lines,
.erh-front-kpi strong.erh-money-lines,
.erh-front-desk-total strong.erh-money-lines,
.erh-front-desk-list strong.erh-money-lines,
.erh-front-hero h2.erh-money-lines {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.12;
  white-space: normal;
}

.erh-money-lines span {
  display: block;
}

/* e-distribution final component polish: source-level component system. */
.erh-front-shell { color: #111827; }

.erh-front-workspace,
.erh-front-dashboard-main,
.erh-front-dashboard-side {
  display: grid !important;
  gap: 12px !important;
}

.erh-front-kpis,
.erh-front-mini-grid,
.erh-front-two,
.erh-front-panels,
.erh-front-dashboard-layout,
.erh-front-duplicate-grid {
  gap: 12px !important;
}

.erh-front-panel,
.erh-front-module-head,
.erh-front-hero,
.erh-front-kpi,
.erh-front-mini {
  margin: 0 !important;
}

.erh-front-nav {
  align-items: center;
  display: grid !important;
  gap: 6px !important;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)) !important;
  overflow: hidden !important;
  padding: 8px !important;
  width: 100% !important;
}

.erh-front-nav-link,
.erh-front-nav-link:visited {
  border-radius: 7px !important;
  flex: initial !important;
  justify-content: flex-start !important;
  min-height: 32px !important;
  padding: 6px 8px !important;
  transform: none !important;
  width: 100% !important;
}

.erh-front-dashboard-hero {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  position: relative;
}

.erh-front-dashboard-hero::before {
  background: radial-gradient(circle at 14% 18%, rgba(15, 107, 255, 0.18), transparent 24%), radial-gradient(circle at 88% 12%, rgba(77, 163, 255, 0.22), transparent 28%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.erh-front-hero-copy,
.erh-front-progress { position: relative; z-index: 1; }

.erh-front-hero-copy { align-content: center; display: grid; gap: 10px; }

.erh-front-hero-copy > span,
.erh-front-kpi > span,
.erh-front-mini > span {
  color: #5b6b83;
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.erh-front-hero-copy h2,
.erh-front-kpi strong,
.erh-front-mini strong { color: #101828; letter-spacing: 0; }

.erh-front-progress {
  align-items: center;
  align-self: center;
  aspect-ratio: 1;
  border: 10px solid #fff;
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(15, 55, 120, 0.16);
  display: grid;
  justify-items: center;
  min-width: 124px;
  padding: 18px;
}

.erh-front-progress::after { background: #fff; border-radius: inherit; content: ""; inset: 12px; position: absolute; }
.erh-front-progress strong,
.erh-front-progress span { position: relative; z-index: 1; }
.erh-front-progress strong { color: #0b2f6b; font-size: 22px; font-weight: 950; letter-spacing: 0; }
.erh-front-progress span { color: var(--ehq-text-muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }

.erh-front-kpis { align-items: stretch; }

.erh-front-kpi {
  background: linear-gradient(135deg, #fff 0%, #f8fbff 100%) !important;
  display: grid !important;
  gap: 8px !important;
  grid-template-columns: minmax(0, 1fr) 38px !important;
  grid-template-rows: auto 1fr auto !important;
  min-height: 118px !important;
  overflow: hidden !important;
}

.erh-front-kpi > span,
.erh-front-kpi strong,
.erh-front-kpi small { grid-column: 1; min-width: 0; }

.erh-front-kpi strong.erh-money-lines {
  align-self: center;
  display: flex !important;
  flex-direction: column !important;
  font-size: clamp(21px, 1.7vw, 28px) !important;
  gap: 2px !important;
  line-height: 1.08 !important;
  margin: 0 !important;
}

.erh-front-kpi small { color: #4b5b73; font-size: 12px; line-height: 1.35; }

.erh-front-kpi > i.dashicons {
  align-items: center;
  border-radius: 10px;
  display: inline-flex;
  font-size: 17px;
  grid-column: 2;
  grid-row: 1 / span 3;
  height: 36px;
  justify-content: center;
  justify-self: end;
  position: static !important;
  width: 36px;
}

.erh-front-kpi.is-money > i.dashicons,
.erh-front-kpi.is-paid > i.dashicons { background: #e8f7ff !important; color: #0078d4 !important; }
.erh-front-kpi.is-bank > i.dashicons { background: var(--ehq-primary-soft) !important; color: var(--ehq-primary) !important; }
.erh-front-kpi.is-warn > i.dashicons { background: #eef2ff !important; color: #3156d4 !important; }

.erh-front-catalog-snapshot .erh-front-mini { background: linear-gradient(135deg, #fff, #f8fbff) !important; display: grid; gap: 7px; }

.erh-front-button,
.erh-front-button:visited,
.erh-dashboard-table-pager button,
.erh-catalog-actions .erh-front-button,
.erh-front-inline-actions .erh-front-button {
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
  min-height: 32px !important;
  padding: 6px 10px !important;
  width: auto !important;
}

.erh-catalog-actions,
.erh-front-inline-actions { align-items: center !important; gap: 6px !important; }
.erh-catalog-actions form { display: inline-flex !important; margin: 0 !important; }
.erh-catalog-actions .erh-front-button { min-width: 58px !important; }

.erh-dashboard-table-panel,
.erh-front-table-scroll {
  box-sizing: border-box !important;
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
}

.erh-front-table-scroll table,
.erh-dashboard-table-panel table {
  max-width: none !important;
  min-width: 1120px !important;
  table-layout: fixed !important;
  width: 100% !important;
}

.erh-front-table-scroll th,
.erh-front-table-scroll td {
  overflow-wrap: anywhere !important;
  vertical-align: middle !important;
}

.erh-chart-panel { overflow: visible !important; }
.erh-front-bars { align-items: end; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); min-height: 250px; padding: 14px 4px 4px; }
.erh-front-bar { align-items: center; display: grid; gap: 8px; justify-items: center; min-width: 0; position: relative; }
.erh-front-bar-track { align-items: end; background: linear-gradient(180deg, #eef5ff, #f8fbff); border: 1px solid #d8e6f8; border-radius: 999px; display: flex !important; height: 168px; overflow: hidden; padding: 3px; width: 16px; }
.erh-front-bar-track i { background: linear-gradient(180deg, #2f8cff 0%, var(--ehq-primary) 58%, #0b2f6b 100%); border-radius: inherit; box-shadow: 0 8px 18px rgba(15, 107, 255, 0.25); display: block; width: 100%; }
.erh-front-bar small { color: #56677f; font-size: 10px; font-weight: 800; max-width: 58px; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

.erh-front-store-list { display: grid; gap: 8px; }
.erh-front-store-row { align-items: center; background: #fff; border: 1px solid #d8e6f8; border-radius: 12px; display: grid !important; gap: 6px 12px; grid-template-columns: minmax(0, 1fr) auto; padding: 8px 12px; position: relative; }
.erh-front-store-row strong { align-items: center; color: #10233f; display: inline-flex; gap: 10px; min-width: 0; }
.erh-front-store-row strong img { flex-shrink: 0; height: 32px; object-fit: contain; width: 32px; }
.erh-front-store-row strong span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erh-front-store-row em { color: #0b2f6b; font-style: normal; font-weight: 950; text-align: right; }
.erh-front-store-row small { color: var(--ehq-text-muted); font-size: 11px; font-weight: 800; grid-column: 2; text-align: right; }
.erh-store-meter { background: #edf4ff; border-radius: 999px; display: block !important; grid-column: 1 / -1; height: 8px; overflow: hidden; }
.erh-store-meter i { background: linear-gradient(90deg, #4da3ff, var(--ehq-primary), #0b2f6b) !important; border-radius: inherit; display: block; height: 100%; }

.erh-chart-tooltip { background: #0b2f6b; border-radius: 10px; bottom: calc(100% + 8px); box-shadow: 0 16px 38px rgba(15, 35, 75, 0.22); color: #fff; display: none; left: 50%; min-width: 150px; padding: 9px 10px; position: absolute; transform: translateX(-50%); z-index: 6; }
.erh-front-bar:hover .erh-chart-tooltip,
.erh-front-bar:focus .erh-chart-tooltip,
.erh-front-store-row:hover .erh-chart-tooltip,
.erh-front-store-row:focus .erh-chart-tooltip { display: grid; gap: 3px; }

.erh-front-module-head,
.erh-front-panel,
.erh-front-form,
.erh-front-toolbar { overflow: visible !important; }
.erh-front-form-grid { align-items: end; }
.erh-front-form-grid label,
.erh-front-toolbar label { display: grid !important; gap: 7px !important; }

@media (max-width: 760px) {
  .erh-front-dashboard-hero,
  .erh-front-kpi,
  .erh-front-store-row { grid-template-columns: 1fr !important; }
  .erh-front-progress,
  .erh-front-kpi > i.dashicons,
  .erh-front-store-row em,
  .erh-front-store-row small { justify-self: start; text-align: left; }
  .erh-front-nav { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)) !important; }
}

/* Targeted polish pass: menu hover, actionable mapping, compact actions, flexible catalogue. */
.erh-front-nav-link:hover,
.erh-front-nav-link:focus-visible,
.erh-front-nav-link.is-active {
  background: linear-gradient(135deg, #eef6ff, #ffffff) !important;
  border-color: #9fc7ff !important;
  box-shadow: inset 0 0 0 1px rgba(15, 107, 255, 0.10) !important;
  color: #07326f !important;
  outline: none !important;
  transform: none !important;
}

.erh-front-toolbar {
  align-items: end !important;
  grid-template-columns: minmax(190px, 1fr) minmax(180px, 1fr) minmax(240px, 1.15fr) auto auto !important;
}

.erh-front-toolbar input,
.erh-front-toolbar select,
.erh-front-form input,
.erh-front-form select,
.erh-front-form textarea {
  background: #fff !important;
  border: 1px solid #bfd4f0 !important;
  border-radius: 8px !important;
  box-shadow: inset 0 1px 0 rgba(15, 47, 107, 0.03) !important;
  min-height: 38px !important;
}

.erh-front-toolbar input:focus,
.erh-front-toolbar select:focus,
.erh-front-form input:focus,
.erh-front-form select:focus,
.erh-front-form textarea:focus {
  border-color: var(--ehq-primary) !important;
  box-shadow: 0 0 0 3px rgba(15, 107, 255, 0.12) !important;
  outline: none !important;
}

.erh-upload-capacity-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.erh-upload-capacity-metric {
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border: 1px solid #d8e6f8;
  border-radius: 11px;
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
}

.erh-upload-capacity-metric span {
  color: #5b6b83;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.erh-upload-capacity-metric strong {
  color: #0b2f6b;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0;
}

.erh-upload-capacity-metric small {
  color: var(--ehq-text-muted);
  font-size: 12px;
  font-weight: 750;
}

.is-top-tracks th:first-child,
.is-top-tracks td:first-child {
  text-align: center !important;
  width: 56px !important;
}

.is-top-tracks td:first-child {
  color: #0b2f6b;
  font-weight: 950;
}

.erh-action-link,
.erh-action-link:visited {
  align-items: center;
  background: transparent !important;
  border: 0 !important;
  color: #0b3a7a !important;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px !important;
  font-weight: 900 !important;
  min-height: 28px !important;
  padding: 2px 4px !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  width: auto !important;
}

.erh-action-link:hover,
.erh-action-link:focus-visible {
  color: var(--ehq-primary) !important;
}

.erh-action-link.is-danger {
  color: #c01616 !important;
}

.erh-table-actions form,
.erh-catalog-actions form {
  display: inline-flex !important;
  margin: 0 !important;
}

.is-catalogue-tracks .erh-front-table-scroll table {
  min-width: max(100%, 1380px) !important;
  table-layout: auto !important;
}

.is-catalogue-tracks th,
.is-catalogue-tracks td {
  min-width: 120px;
  white-space: normal !important;
}

.is-catalogue-tracks th:last-child,
.is-catalogue-tracks td:last-child {
  min-width: 160px;
  width: 160px;
}

.erh-batch-picker-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  margin-top: 12px;
}

.erh-batch-chip {
  background: linear-gradient(135deg, #fff, #f8fbff);
  border: 1px solid #cfe0f3;
  border-radius: 10px;
  color: #0b2f6b !important;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-decoration: none !important;
}

.erh-batch-chip:hover {
  border-color: #91bfff;
  box-shadow: 0 10px 24px rgba(15, 107, 255, 0.10);
}

.erh-batch-chip span {
  color: #40516b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erh-batch-chip small {
  color: #65758f;
  font-weight: 800;
}

.erh-front-dashboard-layout {
  align-items: start !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr) !important;
}

.erh-front-dashboard-side,
.erh-front-store-panel {
  align-self: start !important;
}

.erh-front-store-panel .erh-front-store-list {
  max-height: 260px !important;
  overflow: auto !important;
}

.erh-allocation-queue-control {
  align-items: center !important;
  display: grid !important;
  gap: 8px !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
}

.erh-allocation-queue-control span {
  grid-column: 1 !important;
}

.erh-allocation-queue-control button {
  grid-column: 2 !important;
  grid-row: 1 / span 2 !important;
  justify-self: end !important;
}

.erh-front-two .erh-front-form,
.erh-front-form {
  padding: 18px !important;
}

.erh-front-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)) !important;
}

.erh-front-span-2 {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .erh-front-toolbar,
  .erh-front-dashboard-layout,
  .erh-allocation-queue-control {
    grid-template-columns: 1fr !important;
  }
  .erh-allocation-queue-control button { grid-column: 1 !important; grid-row: auto !important; justify-self: start !important; }
  .erh-front-span-2 { grid-column: auto; }
}

.erh-modal-is-open { overflow: hidden; }

.erh-modal[hidden] { display: none !important; }

.erh-modal {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 22px;
  position: fixed;
  z-index: 99999;
}

.erh-modal-backdrop {
  background: rgba(8, 24, 52, 0.48);
  backdrop-filter: blur(7px);
  inset: 0;
  position: absolute;
}

.erh-modal-card {
  background: #fff;
  border: 1px solid #c8dcf7;
  border-radius: 18px;
  box-shadow: 0 34px 90px rgba(12, 43, 90, 0.26);
  max-height: min(88vh, 820px);
  max-width: 1120px;
  overflow: auto;
  position: relative;
  width: min(100%, 1120px);
}

.erh-contract-split-modal-form {
  border: 0 !important;
  box-shadow: none !important;
  display: grid;
  gap: 14px;
  padding: 18px !important;
}

.erh-modal-head,
.erh-modal-actions,
.erh-modal-scope,
.erh-contract-modal-options,
.erh-contract-modal-switches,
.erh-contract-modal-row {
  display: grid;
  gap: 10px;
}

.erh-modal-head {
  align-items: center;
  border-bottom: 1px solid #d8e6f8;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 12px;
}

.erh-modal-head span,
.erh-modal-scope strong {
  color: #5b6b83;
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.erh-modal-head h3 {
  color: #101828;
  font-size: 24px;
  line-height: 1.05;
  margin: 2px 0 4px;
}

.erh-modal-head p { color: #40516b; margin: 0; }

.erh-modal-close {
  align-items: center;
  background: #eef6ff !important;
  border: 1px solid #bfd8ff !important;
  border-radius: 999px !important;
  color: #0b2f6b !important;
  cursor: pointer;
  display: inline-flex;
  font-size: 22px !important;
  height: 38px;
  justify-content: center;
  line-height: 1 !important;
  width: 38px !important;
}

.erh-modal-scope,
.erh-contract-modal-options {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.erh-modal-scope {
  background: linear-gradient(135deg, #f8fbff, #fff);
  border: 1px solid #d8e6f8;
  border-radius: 13px;
  padding: 12px;
}

.erh-modal-scope span { color: #17233a; font-weight: 850; }

.erh-contract-modal-switches {
  background: #f8fbff;
  border: 1px solid #d8e6f8;
  border-radius: 13px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding: 12px;
}

.erh-contract-modal-rows { display: grid; gap: 10px; }

.erh-contract-modal-row {
  align-items: end;
  background: linear-gradient(135deg, #fff, #f9fcff);
  border: 1px solid #d8e6f8;
  border-radius: 13px;
  grid-template-columns: 34px minmax(130px, 1fr) minmax(150px, 1.1fr) minmax(120px, 0.8fr) minmax(92px, 0.55fr) minmax(130px, 1fr) auto;
  padding: 10px;
}

.erh-row-index {
  align-items: center;
  align-self: center;
  background: var(--ehq-primary);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.erh-split-total {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #d8e6f8;
  border-radius: 13px;
  display: grid;
  gap: 4px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.erh-split-total span,
.erh-split-total small { color: #5b6b83; font-weight: 850; }
.erh-split-total strong { color: #0b2f6b; font-size: 24px; font-weight: 950; }
.erh-split-total strong.is-valid { color: #087443; }
.erh-split-total strong.is-invalid { color: #c01616; }
.erh-split-total small { grid-column: 1 / -1; }

.erh-modal-actions {
  align-items: center;
  border-top: 1px solid #d8e6f8;
  grid-template-columns: auto 1fr auto auto;
  padding-top: 12px;
}

@media (max-width: 900px) {
  .erh-contract-modal-row,
  .erh-modal-actions { grid-template-columns: 1fr; }
  .erh-row-index { justify-self: start; }
}

.ehq-sortable-heading {
  padding: 0 !important;
  user-select: none;
}

.ehq-sort-button {
  align-items: center;
  background: transparent !important;
  border: 0 !important;
  color: inherit !important;
  cursor: pointer;
  display: inline-flex;
  font: inherit !important;
  font-weight: 900 !important;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
  padding: 10px 12px !important;
  text-transform: inherit;
  width: 100% !important;
}

.ehq-sort-button i {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.42;
  position: relative;
}

.ehq-sort-button i::before,
.ehq-sort-button i::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  content: "";
  display: block;
  height: 0;
  width: 0;
}

.ehq-sort-button i::before {
  border-bottom: 5px solid currentColor;
  margin-bottom: 2px;
}

.ehq-sort-button i::after {
  border-top: 5px solid currentColor;
}

.ehq-sortable-heading[aria-sort="ascending"] .ehq-sort-button,
.ehq-sortable-heading[aria-sort="descending"] .ehq-sort-button,
.ehq-sort-button:hover,
.ehq-sort-button:focus-visible {
  color: #0b2f6b !important;
  outline: none !important;
}

.ehq-sortable-heading[aria-sort="ascending"] .ehq-sort-button i,
.ehq-sortable-heading[aria-sort="descending"] .ehq-sort-button i {
  opacity: 1;
}

.ehq-sortable-heading[aria-sort="ascending"] .ehq-sort-button i::after,
.ehq-sortable-heading[aria-sort="descending"] .ehq-sort-button i::before {
  opacity: 0.24;
}

/* ═══════════════════════════════════════════════════════════════
   ë • dashboard polish — compact tables, tight store rows
   ═══════════════════════════════════════════════════════════════ */

/* ── Fix 1: Top Tracks — narrow # rank column ──────────────────
   table-layout: fixed distributes 5 columns equally (~20% each).
   The rank column only needs ~2.5rem; pin it, let artist+track
   share the freed space. Amount and Units get fixed widths too.  */
.erh-dashboard-table-panel.is-top-tracks table {
  table-layout: fixed !important;
}
.erh-dashboard-table-panel.is-top-tracks table th:nth-child(1),
.erh-dashboard-table-panel.is-top-tracks table td:nth-child(1) {
  color: #9aa3b0 !important;
  font-weight: 700 !important;
  text-align: center !important;
  width: 2.5rem !important;
}
.erh-dashboard-table-panel.is-top-tracks table th:nth-child(4),
.erh-dashboard-table-panel.is-top-tracks table td:nth-child(4) {
  text-align: right !important;
  white-space: nowrap !important;
  width: 7rem !important;
}
.erh-dashboard-table-panel.is-top-tracks table th:nth-child(5),
.erh-dashboard-table-panel.is-top-tracks table td:nth-child(5) {
  text-align: right !important;
  white-space: nowrap !important;
  width: 5rem !important;
}
/* artist: let it share remaining space, clip overflow */
.erh-dashboard-table-panel.is-top-tracks table td:nth-child(2),
.erh-dashboard-table-panel.is-top-tracks table th:nth-child(2) {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
/* track: same */
.erh-dashboard-table-panel.is-top-tracks table td:nth-child(3),
.erh-dashboard-table-panel.is-top-tracks table th:nth-child(3) {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* ── Fix 2: Top Stores — compact row height ────────────────────
   Reduce padding, tighten gap, shrink store logo and meter bar.
   Each row drops from ~48px to ~36px, saving ~60px across 5 rows. */
.erh-front-store-list {
  gap: 5px !important;
}
.erh-front-store-row {
  gap: 3px 10px !important;
  padding: 5px 10px !important;
}
.erh-front-store-row strong img {
  height: 24px !important;
  width: 24px !important;
}
.erh-store-meter {
  height: 4px !important;
}

/* ── Fix 3: Dashboard layout — prevent right-column overflow ───
   Lower the store list scroll-cap so the right column never
   towers above the left, eliminating the dead white space gap.  */
.erh-front-store-panel .erh-front-store-list {
  max-height: 220px !important;
}

/* ── Fix 4: Single-column stack, stores in 2-col grid ─────────
   Removes the side-by-side layout entirely. Everything stacks
   full-width: timeline → stores (2-col grid) → top tracks.
   Zero white space gaps.                                        */

/* Hero / Total Earnings — compact */
.erh-front-hero.erh-front-dashboard-hero {
  min-height: unset !important;
  padding: 1rem 1.5rem !important;
}
.erh-front-hero.erh-front-dashboard-hero h2 {
  font-size: clamp(1.3rem, 2.5vw, 2rem) !important;
  margin: 0.15rem 0 !important;
}
.erh-front-hero.erh-front-dashboard-hero p {
  font-size: 0.78rem !important;
  margin: 0 !important;
}

/* KPI row — tighter */
.erh-front-kpis {
  gap: 0.6rem !important;
}
.erh-front-kpi {
  padding: 0.65rem 0.9rem !important;
}
.erh-front-kpi strong {
  font-size: clamp(1rem, 2vw, 1.4rem) !important;
}

/* Stores: 2-column grid, ultra-compact rows */
.erh-front-store-panel .erh-front-store-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  max-height: none !important;
  overflow: visible !important;
}
.erh-front-store-row {
  gap: 3px 10px !important;
  padding: 5px 10px !important;
  border-radius: 8px !important;
}
.erh-front-store-row strong {
  font-size: 0.82rem !important;
  gap: 6px !important;
}
.erh-front-store-row strong img {
  height: 20px !important;
  width: 20px !important;
}
.erh-front-store-row em {
  font-size: 0.82rem !important;
}
.erh-front-store-row small {
  font-size: 0.68rem !important;
}
.erh-store-meter {
  height: 3px !important;
}

/* — END §36 — */

/* ════════════════════════════════════════════════════════════════════
   §37 — ADMIN CORE (migrated from ë • distribution v1.10.27
                      assets/css/admin.css, 4036 LOC)
   ════════════════════════════════════════════════════════════════════
   THE BIG ONE. Plugin-base styles — used by every admin page and every
   frontend view. Scope: .erh-wrap + descendants (admin) and .erh-front-*
   descendants (frontend). Defines plugin-specific layout, tables, forms,
   drawer chrome, KPI cards, panels, badges, pagination, etc.

   Previously enqueued as 'erh-admin' from both class-erh-admin.php:105 and
   class-erh-frontend.php:95. Both enqueues remain BUT now point to a stub
   that loads nothing — the styles live here.

   This is the last of 6 plugin CSS files migrated. Plugin assets/css/ is
   now empty. Subsequent sessions can replace the prefixed selectors with
   spec selectors progressively.
   ──────────────────────────────────────────────────────────────────── */

.erh-wrap {
    box-sizing: border-box;
    max-width: min(1680px, calc(100vw - 72px));
    margin-left: auto;
    margin-right: auto;
    padding-right: 20px;
    width: 100%;
}

@media (max-width: 782px) {
    .erh-wrap {
        max-width: calc(100vw - 20px);
        padding-right: 10px;
    }
}

.erh-wrap h2,
.erh-wrap h3 {
    color: #101517;
}

.erh-page-hero {
    align-items: center;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 14px;
    margin: 18px 0 22px;
    padding: 18px;
}

.erh-page-hero h1 {
    color: #101517;
    font-size: 24px;
    line-height: 1.2;
    margin: 0 0 4px;
    padding: 0;
}

.erh-page-hero p {
    color: #50575e;
    font-size: 14px;
    margin: 0;
    max-width: 760px;
}

.erh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.erh-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.erh-card,
.erh-panel {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 16px;
}

.erh-card span {
    display: block;
    color: #646970;
    font-size: 12px;
    text-transform: uppercase;
}

.erh-card strong {
    display: block;
    font-size: 28px;
    margin-top: 4px;
}

.erh-brand-mark {
    align-items: center;
    background: #05070a;
    border-radius: 8px;
    color: #fff;
    display: flex;
    height: 44px;
    justify-content: center;
    overflow: hidden;
    width: 44px;
}

.erh-brand-mark img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.erh-version-pill {
    background: var(--ehq-primary-soft);
    border: 1px solid #cfe0f3;
    border-radius: 999px;
    color: var(--ehq-primary);
    font-weight: 600;
    margin-left: auto;
    padding: 6px 10px;
}

.erh-kpi-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    margin: 18px 0;
}

.erh-kpi-card,
.erh-mini-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.erh-kpi-card {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    min-height: 122px;
    min-width: 0;
    padding: 20px;
}

.erh-kpi-card > div {
    min-width: 0;
}

.erh-kpi-card span,
.erh-mini-card span {
    color: #646970;
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.erh-kpi-card strong {
    color: #101517;
    display: block;
    font-size: clamp(22px, 1.7vw, 30px);
    line-height: 1.1;
    margin: 12px 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erh-kpi-card small {
    color: #50575e;
    display: block;
    font-size: 13px;
}

.erh-kpi-card .dashicons {
    flex: 0 0 34px;
    align-items: center;
    background: var(--ehq-primary-soft);
    border-radius: 6px;
    color: var(--ehq-primary);
    display: flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

@media (min-width: 1500px) {
    .erh-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

@media (max-width: 1180px) {
    .erh-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    }
}

@media (max-width: 782px) {
    .erh-kpi-card strong {
        font-size: 24px;
    }
}

.erh-catalog-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin: 18px 0 26px;
}

.erh-mini-card {
    min-height: 94px;
    padding: 18px;
}

.erh-mini-card strong {
    display: block;
    font-size: 28px;
    line-height: 1;
    margin-top: 12px;
}

.erh-dashboard-panels {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    margin: 18px 0;
}

.erh-panel-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.erh-panel-heading h2,
.erh-panel h2 {
    font-size: 16px;
    margin: 0;
}

.erh-panel-heading a {
    color: #50575e;
    text-decoration: none;
}

.erh-chart-panel {
    min-height: 280px;
}

.erh-bar-chart {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(12, minmax(24px, 1fr));
    min-height: 210px;
}

.erh-bar-item {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.erh-bar-track {
    align-items: end;
    background: linear-gradient(to top, #f0f0f1 1px, transparent 1px);
    background-size: 100% 25%;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    height: 160px;
}

.erh-bar-track span {
    background: var(--ehq-primary);
    border-radius: 4px 4px 0 0;
    display: block;
    min-height: 3px;
    width: 100%;
}

.erh-bar-item small {
    color: #646970;
    font-size: 11px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erh-store-list {
    display: grid;
    gap: 14px;
}

.erh-store-row {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 12px minmax(120px, 1fr) auto;
}

.erh-dot {
    border-radius: 999px;
    display: block;
    height: 10px;
    width: 10px;
}

.erh-store-row strong {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erh-store-row em {
    color: #50575e;
    font-style: normal;
}

.erh-store-meter {
    background: #f0f0f1;
    border-radius: 999px;
    grid-column: 2 / 4;
    height: 7px;
    overflow: hidden;
}

.erh-store-meter span {
    background: var(--ehq-primary);
    display: block;
    height: 100%;
}

.erh-health-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.erh-health-item {
    background: #f6f7f7;
    border-left: 4px solid #46b37d;
    border-radius: 6px;
    padding: 12px;
}

.erh-health-item.is-warn {
    border-left-color: #dba617;
}

.erh-health-item.is-bad {
    border-left-color: #d63638;
}

.erh-health-item span,
.erh-health-item small {
    color: #646970;
    display: block;
}

.erh-health-item span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.erh-health-item strong {
    color: #101517;
    display: block;
    font-size: 24px;
    line-height: 1.1;
    margin: 8px 0 4px;
}

.erh-action-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.erh-action-row {
    align-items: center;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    color: #1d2327;
    display: grid;
    gap: 2px 12px;
    grid-template-columns: 1fr auto;
    padding: 12px;
    text-decoration: none;
}

.erh-action-row:hover {
    border-color: var(--ehq-primary);
    color: var(--ehq-primary);
}

.erh-action-row span {
    color: #50575e;
}

.erh-action-row .dashicons {
    grid-column: 2;
    grid-row: 1 / 3;
}

.erh-panel {
    margin: 16px 0;
}

.erh-panel h2:first-child,
.erh-panel h3:first-child {
    margin-top: 0;
}

.erh-danger-panel {
    background: #fffafa;
    border-color: #d63638;
}

.erh-panel label,
.erh-toolbar label {
    display: block;
    margin: 10px 0;
    font-weight: 600;
}

.erh-panel input,
.erh-panel select,
.erh-panel textarea,
.erh-toolbar input,
.erh-toolbar select,
.erh-inline-form select {
    min-width: 220px;
    max-width: 100%;
}

.erh-wrap input[type="text"],
.erh-wrap input[type="date"],
.erh-wrap input[type="number"],
.erh-wrap input[type="search"],
.erh-wrap select,
.erh-wrap textarea {
    border-color: #c3c4c7;
    border-radius: 6px;
}

.erh-wrap .button,
.erh-wrap .button-primary,
.erh-wrap .button-secondary {
    border-radius: 6px;
}

.erh-wrap .button-primary {
    background: var(--ehq-primary);
    border-color: var(--ehq-primary);
}

.erh-wrap .button-primary:hover,
.erh-wrap .button-primary:focus {
    background: #0759aa;
    border-color: #0759aa;
}

.erh-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.erh-three {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
}

.erh-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 16px 0;
}

.erh-filter-toolbar {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 12px;
}

.erh-filter-toolbar label {
    margin: 0;
}

.erh-filter-toolbar input {
    min-width: 260px;
}

.erh-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.erh-alias-form input {
    min-width: 180px;
}

.erh-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.erh-table-scroll {
    border: 1px solid #dcdcde;
    border-radius: 8px;
    margin: 12px 0;
    overflow-x: auto;
}

.erh-table-scroll .widefat {
    border: 0;
    margin: 0;
}

.erh-mapping-batches .erh-panel-heading span {
    color: #646970;
    font-size: 12px;
    font-weight: 600;
}

.erh-mapping-batches tr.is-current-batch td {
    background: #eef6ff;
}

.erh-mapping-table {
    min-width: 1180px;
}

.erh-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 12px 0;
}

.erh-pagination .erh-page-current {
    background: var(--ehq-primary);
    border-color: var(--ehq-primary);
    color: #fff;
    cursor: default;
}

.erh-status-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 9px;
    text-transform: uppercase;
}

.erh-status-badge.is-ok {
    background: #e8f5ed;
    color: #008a20;
}

.erh-status-badge.is-bad {
    background: #fcf0f1;
    color: #b32d2e;
}

.erh-status-badge.is-work {
    background: var(--ehq-primary-soft);
    color: var(--ehq-primary);
}

.erh-mini-progress {
    background: #dcdcde;
    border-radius: 999px;
    height: 6px;
    margin-top: 6px;
    max-width: 120px;
    overflow: hidden;
}

.erh-mini-progress span {
    background: var(--ehq-primary);
    display: block;
    height: 100%;
}

.erh-split-total {
    align-items: center;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0;
    padding: 12px;
}

.erh-split-total span {
    color: #646970;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.erh-split-total strong {
    font-size: 20px;
}

.erh-split-total strong.is-ok {
    color: #008a20;
}

.erh-split-total strong.is-bad {
    color: #b32d2e;
}

.erh-split-total small {
    color: #50575e;
    margin-left: auto;
}

.erh-contract-builder {
    display: grid;
    gap: 16px;
}

.erh-builder-step {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.erh-builder-step span {
    align-items: center;
    background: var(--ehq-primary);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.erh-builder-step strong {
    color: #101517;
    font-size: 15px;
}

.erh-split-card-grid,
.erh-cost-card-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.erh-split-card,
.erh-cost-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 14px;
}

.erh-split-card.is-empty,
.erh-cost-card.is-empty {
    background: #fbfbfc;
}

.erh-split-card-head {
    align-items: start;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.erh-split-card-head span {
    color: #646970;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.erh-split-card-head strong {
    color: #101517;
    font-size: 14px;
    text-align: right;
}

.erh-split-card-head .erh-remove-card {
    flex: 0 0 auto;
    font-size: 12px;
    text-decoration: none;
}

.erh-split-card label,
.erh-cost-card label {
    margin: 8px 0;
}

.erh-split-card input,
.erh-split-card select,
.erh-cost-card input,
.erh-cost-card select {
    width: 100%;
}

.erh-split-card-row {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
}

.erh-builder-save {
    border-top: 1px solid #dcdcde;
    padding-top: 14px;
}

.erh-extraction-review {
    border-top: 1px solid #dcdcde;
    margin-top: 18px;
    padding-top: 16px;
}

.erh-extraction-review h4 {
    margin: 18px 0 8px;
}

.erh-ai-scan-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin: 14px 0;
}

.erh-ai-scan-grid > div,
.erh-ai-scope-suggestion,
.erh-ai-warnings {
    background: #f4f7fc;
    border: 1px solid #cfe0f3;
    border-radius: 8px;
    padding: 12px;
}

.erh-ai-scan-grid strong,
.erh-ai-scope-suggestion strong,
.erh-ai-warnings strong {
    color: #313949;
}

.erh-ai-scan-grid small,
.erh-ai-scan-grid div div,
.erh-ai-scan-grid div small {
    color: var(--ehq-text-muted);
}

.erh-ai-scope-suggestion {
    align-items: center;
    display: flex;
    gap: 12px;
    margin: 6px 0 8px;
}

.erh-ai-scope-suggestion .dashicons {
    align-items: center;
    background: var(--ehq-primary);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.erh-ai-scope-suggestion p,
.erh-ai-warnings ul {
    margin: 4px 0 0;
}

.erh-ai-warnings {
    background: #f6f9ff;
    border-color: #f3c8b7;
    margin-top: 14px;
}

.erh-panel textarea {
    width: 100%;
}

.erh-note {
    max-width: 760px;
    color: #50575e;
    font-size: 14px;
}

.erh-compact-lines div {
    margin: 2px 0;
    white-space: nowrap;
}

.erh-table {
    margin-top: 16px;
}

.erh-wrap .widefat {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    border-spacing: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.erh-wrap .widefat thead th {
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    color: #50575e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    padding: 12px 10px;
    text-transform: uppercase;
}

.erh-wrap .widefat td {
    color: #343b40;
    padding: 11px 10px;
    vertical-align: top;
}

.erh-wrap .widefat.striped > tbody > :nth-child(odd) {
    background-color: #fbfbfc;
}

.erh-wrap .widefat.striped > tbody > :nth-child(even) {
    background-color: #fff;
}

.erh-wrap .widefat tbody tr:hover td {
    background: var(--ehq-primary-soft);
}

.erh-sortable th {
    cursor: pointer;
}

.erh-sortable th[data-sort-direction="asc"]::after {
    content: " ▲";
}

.erh-sortable th[data-sort-direction="desc"]::after {
    content: " ▼";
}

.erh-panel summary {
    cursor: pointer;
    font-weight: 600;
}

.erh-automation-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.erh-automation-panel p {
    margin: 0;
    flex: 1 1 420px;
}

#erh-workload-overlay {
    align-items: center;
    background: rgba(30, 30, 30, 0.45);
    bottom: 0;
    display: none;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 100000;
}

#erh-workload-overlay.is-visible {
    display: flex;
}

.erh-workload-dialog {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
    max-width: 460px;
    padding: 24px;
    width: calc(100% - 48px);
}

.erh-workload-title {
    color: #1d2327;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.erh-workload-percent {
    color: var(--ehq-primary);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 12px;
}

.erh-workload-bar {
    background: #dcdcde;
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.erh-workload-bar span {
    background: var(--ehq-primary);
    display: block;
    height: 100%;
    transition: width 0.3s ease;
    width: 0;
}

.erh-workload-message {
    color: #50575e;
    margin: 12px 0 0;
}

.erh-catalog-open {
    font-weight: 600;
    text-align: left;
}

.erh-bulk-form .erh-toolbar {
    margin-bottom: 8px;
}

.erh-modal {
    align-items: center;
    background: rgba(30, 30, 30, 0.45);
    bottom: 0;
    display: none;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 100001;
}

.erh-modal.is-visible {
    display: flex;
}

.erh-modal-dialog {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
    max-height: calc(100vh - 64px);
    max-width: 560px;
    overflow: auto;
    padding: 24px;
    position: relative;
    width: calc(100% - 48px);
}

.erh-modal-close {
    font-size: 28px;
    line-height: 1;
    position: absolute;
    right: 16px;
    top: 12px;
    text-decoration: none;
}

.erh-modal label {
    display: block;
    font-weight: 600;
    margin: 12px 0;
}

.erh-modal input,
.erh-modal select {
    display: block;
    margin-top: 4px;
    width: 100%;
}

.erh-modal-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* ë • hq / W3POS palette pass: primary blue stays blue-led. */
.erh-wrap {
    --erh-primary: #0f6bff;
    --erh-primary-deep: #0b2f6b;
    --erh-primary-soft: #eaf2ff;
    --erh-body-bg: #f4f7fc;
    --erh-border: #cfe0f3;
    --erh-ink: #111827;
    --erh-muted: #516179;
}

.erh-page-hero,
.erh-card,
.erh-panel,
.erh-kpi-card,
.erh-mini-card,
.erh-filter-toolbar,
.erh-table-scroll {
    border-color: var(--erh-border);
    box-shadow: 0 3px 5px rgba(15, 44, 94, 0.08);
}

.erh-page-hero {
    background:
        linear-gradient(90deg, rgba(234, 242, 255, 0.92), rgba(255, 255, 255, 0.86)),
        #fff;
}

.erh-page-hero h1,
.erh-wrap h2,
.erh-wrap h3,
.erh-kpi-card strong,
.erh-mini-card strong,
.erh-card strong {
    color: var(--erh-ink);
}

.erh-page-hero p,
.erh-card span,
.erh-kpi-card span,
.erh-mini-card span,
.erh-kpi-card small,
.erh-note {
    color: var(--erh-muted);
}

.erh-brand-mark,
.erh-kpi-card .dashicons {
    background: var(--erh-primary-soft);
    color: var(--erh-primary);
}

.erh-kpi-card strong span,
.erh-card strong span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erh-wrap .button-primary,
.erh-wrap input.button-primary,
.erh-wrap input[type="submit"].button-primary,
.erh-pagination .erh-page-current {
    background: var(--erh-primary) !important;
    border-color: var(--erh-primary) !important;
    color: #fff !important;
}

.erh-wrap .button-primary:hover,
.erh-wrap input.button-primary:hover,
.erh-wrap input[type="submit"].button-primary:hover,
.erh-wrap .button:hover,
.erh-pagination .button:hover {
    background: var(--erh-primary-soft) !important;
    border-color: var(--erh-primary) !important;
    color: var(--erh-ink) !important;
}

.erh-table-scroll {
    overflow-x: auto;
    width: 100%;
}

.erh-table {
    min-width: 760px;
}

.erh-wrap .widefat thead th,
.erh-wrap .widefat tfoot th,
.erh-wrap .widefat tbody td,
.erh-wrap .widefat tbody th {
    line-height: 1.35;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.erh-wrap .widefat tbody tr:hover td {
    background: var(--erh-primary-soft);
}

.erh-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.erh-pagination span:first-child {
    color: var(--erh-muted);
    font-size: 13px;
    font-weight: 600;
    margin-right: 4px;
}

.erh-pagination .button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 32px;
}

.erh-store-list {
    gap: 12px;
}

.erh-store-row {
    align-items: center;
    display: grid;
    gap: 8px 12px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
}

.erh-store-logo {
    background-image: url("../img/store-logos.webp");
    background-repeat: no-repeat;
    background-size: 400px 169px;
    border: 1px solid var(--erh-border);
    border-radius: 8px;
    display: block;
    height: 40px;
    overflow: hidden;
    width: 40px;
}

.erh-store-logo.is-spotify { background-position: 0 0; }
.erh-store-logo.is-apple { background-position: -40px 0; }
.erh-store-logo.is-deezer { background-position: -80px 0; }
.erh-store-logo.is-soundcloud { background-position: -120px 0; }
.erh-store-logo.is-youtube { background-position: -160px 0; }
.erh-store-logo.is-amazon { background-position: -200px 0; }
.erh-store-logo.is-tidal { background-position: -240px 0; }
.erh-store-logo.is-pandora { background-position: -280px 0; }
.erh-store-logo.is-iheartradio { background-position: -320px 0; }
.erh-store-logo.is-generic { background-position: -360px 0; }

.erh-store-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erh-store-meter {
    grid-column: 2 / 4;
}

.erh-store-meter span,
.erh-bar-track span {
    background: linear-gradient(180deg, #4da3ff, var(--erh-primary));
}

/* Precision UI pass: compact panels, visible table structure, safer overflow. */
.erh-wrap {
    --erh-primary: #0f6bff;
    --erh-primary-deep: #0b2f6b;
    --erh-primary-soft: #edf6ff;
    --erh-body-bg: #f5f5f4;
    --erh-border: #d1daec;
    --erh-border-strong: #cfe0f3;
    --erh-ink: #171717;
    --erh-muted: #6b625e;
    color: var(--erh-ink);
    font-family: var(--ehq3-font, var(--ehq-font, "Open Sans", system-ui, sans-serif));
    font-size: 13px;
    max-width: min(1500px, calc(100vw - 52px));
}

.erh-page-hero,
.erh-card,
.erh-panel,
.erh-kpi-card,
.erh-mini-card,
.erh-filter-toolbar,
.erh-table-scroll {
    border-color: var(--erh-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(23, 23, 23, 0.04) !important;
}

.erh-page-hero {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.86)),
        #fff !important;
    margin: 14px 0 16px !important;
    padding: 14px !important;
}

.erh-page-hero h1 {
    color: var(--erh-ink) !important;
    font-size: 21px !important;
    line-height: 1.1 !important;
}

.erh-page-hero p {
    color: var(--erh-muted) !important;
    font-size: 12.5px !important;
}

.erh-grid,
.erh-kpi-grid,
.erh-catalog-grid,
.erh-dashboard-panels,
.erh-health-grid,
.erh-two,
.erh-three,
.erh-split-card-grid,
.erh-cost-card-grid {
    gap: 12px !important;
}

.erh-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
}

.erh-dashboard-panels {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)) !important;
}

.erh-card,
.erh-panel,
.erh-mini-card,
.erh-kpi-card {
    padding: 14px !important;
}

.erh-kpi-card {
    min-height: 104px !important;
}

.erh-kpi-card span,
.erh-mini-card span,
.erh-card span {
    color: var(--erh-muted) !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
}

.erh-kpi-card strong,
.erh-mini-card strong,
.erh-card strong {
    color: var(--erh-ink) !important;
    font-size: clamp(20px, 2vw, 25px) !important;
    line-height: 1.08 !important;
    margin: 8px 0 5px !important;
}

.erh-kpi-card small,
.erh-note,
.erh-page-hero p,
.erh-action-row span {
    color: var(--erh-muted) !important;
    font-size: 12.5px !important;
}

.erh-kpi-card .dashicons,
.erh-brand-mark {
    border-radius: 7px !important;
    height: 32px !important;
    width: 32px !important;
}

.erh-kpi-card .dashicons {
    display: none !important;
}

.erh-panel {
    overflow-x: auto !important;
}

.erh-panel h2,
.erh-panel h3,
.erh-panel-heading h2,
.erh-panel-heading h3 {
    color: var(--erh-ink) !important;
    font-size: 17px !important;
    line-height: 1.2 !important;
    margin: 0 0 12px !important;
}

.erh-panel-heading {
    margin-bottom: 12px !important;
}

.erh-table-scroll,
.erh-panel > table.widefat,
.erh-panel > form > table.widefat {
    background: #fff !important;
    border: 1px solid var(--erh-border) !important;
    border-radius: 8px !important;
    margin: 10px 0 !important;
    overflow-x: auto !important;
}

.erh-table-scroll .widefat,
.erh-panel > table.widefat,
.erh-panel > form > table.widefat,
.erh-table {
    background: #fff !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    min-width: 680px !important;
    table-layout: auto !important;
    width: 100% !important;
}

.erh-wrap .widefat thead th,
.erh-wrap .widefat tfoot th {
    background: #fafafa !important;
    border-bottom: 1px solid var(--erh-border-strong) !important;
    border-right: 1px solid var(--erh-border) !important;
    color: #746b66 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    line-height: 1.25 !important;
    padding: 9px 10px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}

.erh-wrap .widefat tbody td,
.erh-wrap .widefat tbody th {
    background: #fff !important;
    border-bottom: 1px solid #ece8e5 !important;
    border-right: 1px solid #f1eeec !important;
    color: #2a2725 !important;
    font-size: 12.5px !important;
    line-height: 1.35 !important;
    padding: 9px 10px !important;
    vertical-align: middle !important;
}

.erh-wrap .widefat th:last-child,
.erh-wrap .widefat td:last-child {
    border-right: 0 !important;
}

.erh-wrap .widefat tbody tr:last-child td {
    border-bottom: 0 !important;
}

.erh-wrap .widefat tbody tr:hover td {
    background: #f6f9ff !important;
}

.erh-wrap .widefat tbody td[colspan] {
    color: var(--erh-muted) !important;
}

.erh-panel label,
.erh-toolbar label {
    align-items: center !important;
    display: grid !important;
    gap: 8px 12px !important;
    grid-template-columns: minmax(110px, 170px) minmax(0, 360px) !important;
    margin: 8px 0 !important;
}

.erh-panel input,
.erh-panel select,
.erh-panel textarea,
.erh-toolbar input,
.erh-toolbar select,
.erh-inline-form select {
    border-color: var(--erh-border-strong) !important;
    border-radius: 7px !important;
    min-height: 36px !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.erh-wrap input[type="file"] {
    background: #fff !important;
    width: min(100%, 360px) !important;
}

.erh-wrap input[type="file"]::file-selector-button,
.erh-wrap input[type="file"]::-webkit-file-upload-button {
    background: #f6f6f6 !important;
    border: 0 !important;
    border-right: 1px solid var(--erh-border-strong) !important;
    color: var(--erh-ink) !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    margin: 0 10px 0 0 !important;
    min-height: 34px !important;
    padding: 0 14px !important;
}

.erh-wrap textarea {
    min-height: 104px !important;
    width: min(100%, 680px) !important;
}

.erh-wrap .button,
.erh-wrap .button-primary,
.erh-wrap .button-secondary,
.erh-pagination .button,
.erh-pagination .erh-page-current {
    border-radius: 7px !important;
    font-size: 12.5px !important;
    min-height: 34px !important;
}

.erh-pagination {
    border-top: 1px solid var(--erh-border) !important;
    gap: 6px !important;
    margin: 10px 0 0 !important;
    padding-top: 10px !important;
}

.erh-pagination span:first-child {
    color: var(--erh-muted) !important;
    font-size: 12.5px !important;
}

.erh-actions {
    min-width: 0 !important;
}

@media (max-width: 900px) {
    .erh-wrap {
        max-width: calc(100vw - 20px) !important;
        padding-right: 10px !important;
    }

    .erh-panel label,
    .erh-toolbar label {
        grid-template-columns: 1fr !important;
    }

    .erh-kpi-grid,
    .erh-dashboard-panels,
    .erh-two,
    .erh-three {
        grid-template-columns: 1fr !important;
    }
}

/* Secondary cool accents: pale blue surfaces and navy structure. */
.erh-wrap {
    --erh-navy: #17243a;
    --erh-navy-muted: #516179;
    --erh-blue-pale: #edf6ff;
    --erh-blue-line: #cfe0f3;
}

.erh-page-hero {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(237, 246, 255, 0.74) 54%, rgba(244, 248, 255, 0.88)),
        #fff !important;
}

.erh-page-hero h1,
.erh-wrap h2,
.erh-wrap h3,
.erh-kpi-card strong,
.erh-mini-card strong,
.erh-card strong {
    color: var(--erh-navy) !important;
}

.erh-page-hero p,
.erh-card span,
.erh-kpi-card span,
.erh-mini-card span,
.erh-kpi-card small,
.erh-note,
.erh-panel label,
.erh-toolbar label {
    color: var(--erh-navy-muted) !important;
}

.erh-wrap .widefat thead th,
.erh-wrap .widefat tfoot th {
    background: linear-gradient(180deg, #f7fbff, var(--erh-blue-pale)) !important;
    border-bottom-color: var(--erh-blue-line) !important;
    border-right-color: var(--erh-blue-line) !important;
    color: var(--erh-navy-muted) !important;
}

.erh-wrap .widefat tbody tr:hover td {
    background: #f6fbff !important;
}

.erh-table-scroll,
.erh-filter-toolbar,
.erh-panel > table.widefat,
.erh-panel > form > table.widefat {
    border-color: var(--erh-blue-line) !important;
}

.erh-health-item,
.erh-action-row,
.erh-split-total {
    background: #f8fbff !important;
    border-color: var(--erh-blue-line) !important;
}

.erh-version-pill {
    background: var(--erh-blue-pale) !important;
    border-color: var(--erh-blue-line) !important;
    color: var(--erh-navy) !important;
}

/* Template error fixes: contain tables inside cards and redesign contract cards. */
.erh-dashboard-panels > .erh-panel,
.erh-two > .erh-panel,
.erh-three > .erh-panel,
.erh-duplicates-grid > .erh-panel,
.erh-contract-builder,
.erh-split-card,
.erh-cost-card {
    min-width: 0 !important;
}

.erh-dashboard-table-panel,
.erh-duplicate-panel {
    overflow: hidden !important;
}

.erh-dashboard-table-scroll,
.erh-duplicate-table-scroll {
    max-width: 100% !important;
    overflow-x: auto !important;
}

.erh-table-scroll-cols-2 .erh-table {
    min-width: 360px !important;
}

.erh-table-scroll-cols-3 .erh-table,
.erh-duplicate-table-scroll .erh-table {
    min-width: 460px !important;
}

.erh-table-scroll-cols-4 .erh-table {
    min-width: 620px !important;
}

.erh-dashboard-table-panel .widefat td:first-child {
    max-width: 520px !important;
    white-space: normal !important;
}

.erh-dashboard-table-panel .widefat td,
.erh-duplicate-panel .widefat td {
    overflow-wrap: anywhere !important;
}

.erh-duplicates-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.erh-duplicate-panel .widefat {
    table-layout: fixed !important;
}

.erh-duplicate-panel .widefat th:nth-child(1),
.erh-duplicate-panel .widefat td:nth-child(1) {
    width: 35% !important;
}

.erh-duplicate-panel .widefat th:nth-child(2),
.erh-duplicate-panel .widefat td:nth-child(2),
.erh-duplicate-panel .widefat th:nth-child(4),
.erh-duplicate-panel .widefat td:nth-child(4) {
    width: 80px !important;
}

.erh-duplicate-panel .widefat th:nth-child(3),
.erh-duplicate-panel .widefat td:nth-child(3) {
    width: auto !important;
}

.erh-split-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)) !important;
}

.erh-split-card,
.erh-cost-card {
    background: #fff !important;
    border-color: var(--erh-blue-line) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(23, 23, 23, 0.04) !important;
}

.erh-split-card label,
.erh-cost-card label {
    align-items: stretch !important;
    color: var(--erh-navy-muted) !important;
    display: grid !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    gap: 5px !important;
    grid-template-columns: 1fr !important;
    margin: 0 !important;
}

.erh-split-card input,
.erh-split-card select,
.erh-cost-card input,
.erh-cost-card select {
    min-height: 34px !important;
    min-width: 0 !important;
    width: 100% !important;
}

.erh-split-card-head {
    align-items: center !important;
    border-bottom: 1px solid var(--erh-border) !important;
    display: grid !important;
    gap: 8px !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    margin: 0 0 12px !important;
    padding-bottom: 10px !important;
}

.erh-split-card-head strong {
    color: var(--erh-navy) !important;
    overflow: hidden !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.erh-split-controls-row {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 140px) !important;
}

.erh-cost-card-grid {
    gap: 8px !important;
    grid-template-columns: 1fr !important;
}

.erh-cost-card {
    padding: 12px !important;
}

.erh-cost-card-head {
    margin-bottom: 0 !important;
}

.erh-cost-card-fields {
    align-items: end !important;
    display: grid !important;
    gap: 10px !important;
    grid-template-columns: minmax(120px, 170px) minmax(220px, 1fr) minmax(210px, 250px) minmax(112px, auto) !important;
}

.erh-cost-money-row {
    gap: 8px !important;
    grid-template-columns: minmax(0, 1fr) 88px !important;
}

.erh-cost-recoupable {
    align-items: center !important;
    background: var(--erh-blue-pale) !important;
    border: 1px solid var(--erh-blue-line) !important;
    border-radius: 7px !important;
    display: inline-flex !important;
    gap: 7px !important;
    justify-content: center !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
}

.erh-cost-recoupable input {
    min-height: 0 !important;
    width: auto !important;
}

.erh-cost-recoupable span {
    color: var(--erh-navy) !important;
}

.erh-builder-save {
    background: linear-gradient(90deg, var(--erh-blue-pale), #f6f9ff) !important;
    border: 1px solid var(--erh-blue-line) !important;
    border-radius: 8px !important;
    margin-top: 14px !important;
    padding: 12px !important;
}

@media (min-width: 1180px) {
    .erh-dashboard-panels {
        grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr) !important;
    }
}

@media (max-width: 1180px) {
    .erh-duplicates-grid,
    .erh-dashboard-panels {
        grid-template-columns: 1fr !important;
    }

    .erh-cost-card-fields {
        grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.3fr) minmax(210px, 0.8fr) !important;
    }

    .erh-cost-recoupable {
        justify-content: flex-start !important;
    }
}

/* Contracts v2: track-first royalty workspace. */
.erh-contract-workbench {
    align-items: start !important;
    display: grid !important;
    gap: 14px !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr) !important;
}

.erh-contract-workbench-main,
.erh-contract-workbench-side {
    display: grid !important;
    gap: 14px !important;
    min-width: 0 !important;
}

.erh-contract-workbench-side {
    position: sticky !important;
    top: 48px !important;
}

.erh-contract-import-drawer {
    padding: 0 !important;
}

.erh-contract-import-drawer > summary,
.erh-contract-advanced > summary {
    align-items: center !important;
    cursor: pointer !important;
    display: grid !important;
    gap: 10px !important;
    grid-template-columns: auto minmax(0, auto) minmax(0, 1fr) !important;
    list-style: none !important;
    padding: 14px 16px !important;
}

.erh-contract-import-drawer > summary::-webkit-details-marker,
.erh-contract-advanced > summary::-webkit-details-marker {
    display: none !important;
}

.erh-contract-import-drawer > summary .dashicons,
.erh-contract-advanced > summary .dashicons {
    background: var(--erh-blue-pale) !important;
    border: 1px solid var(--erh-blue-line) !important;
    border-radius: 7px !important;
    color: var(--erh-navy) !important;
    display: grid !important;
    height: 30px !important;
    place-items: center !important;
    width: 30px !important;
}

.erh-contract-import-drawer > summary strong,
.erh-contract-advanced > summary strong {
    color: var(--erh-navy) !important;
    font-size: 14px !important;
}

.erh-contract-import-drawer > summary small,
.erh-contract-advanced > summary small {
    color: var(--erh-navy-muted) !important;
    font-size: 12px !important;
}

.erh-contract-import-drawer > :not(summary),
.erh-contract-advanced > :not(summary) {
    margin-left: 16px !important;
    margin-right: 16px !important;
}

.erh-contract-import-drawer > :last-child,
.erh-contract-advanced > :last-child {
    margin-bottom: 16px !important;
}

.erh-contract-filter {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 180px) minmax(96px, 120px) auto auto !important;
}

.erh-contract-track-table {
    table-layout: fixed !important;
    min-width: 920px !important;
}

.erh-contract-track-table th:nth-child(1),
.erh-contract-track-table td:nth-child(1) {
    width: 15% !important;
}

.erh-contract-track-table th:nth-child(2),
.erh-contract-track-table td:nth-child(2) {
    width: 22% !important;
}

.erh-contract-track-table th:nth-child(3),
.erh-contract-track-table td:nth-child(3) {
    width: 17% !important;
}

.erh-contract-track-table th:nth-child(4),
.erh-contract-track-table td:nth-child(4) {
    width: 115px !important;
}

.erh-contract-track-table th:nth-child(5),
.erh-contract-track-table td:nth-child(5) {
    width: 120px !important;
}

.erh-contract-track-table th:nth-child(6),
.erh-contract-track-table td:nth-child(6) {
    width: 130px !important;
}

.erh-contract-track-table th:nth-child(8),
.erh-contract-track-table td:nth-child(8) {
    width: 92px !important;
}

.erh-contract-track-table tr.is-selected td {
    background: #f4fbff !important;
}

.erh-contract-manager h3 {
    color: var(--erh-navy) !important;
    font-size: 14px !important;
    margin: 14px 0 8px !important;
}

.erh-contract-scope-summary {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    margin: 0 0 12px !important;
}

.erh-contract-scope-summary span {
    background: #f8fbff !important;
    border: 1px solid var(--erh-blue-line) !important;
    border-radius: 999px !important;
    color: var(--erh-navy-muted) !important;
    font-size: 12px !important;
    padding: 5px 9px !important;
}

.erh-contract-compact-fields {
    display: grid !important;
    gap: 8px !important;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(126px, 0.6fr) minmax(126px, 0.6fr) !important;
}

.erh-contract-compact-fields label,
.erh-contract-split-row label,
.erh-contract-cost-row label {
    color: var(--erh-navy-muted) !important;
    display: grid !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    gap: 4px !important;
    margin: 0 !important;
}

.erh-contract-options {
    display: grid !important;
    gap: 6px !important;
    margin: 12px 0 !important;
}

.erh-contract-options label {
    align-items: center !important;
    color: var(--erh-navy-muted) !important;
    display: flex !important;
    font-size: 12px !important;
    gap: 7px !important;
    margin: 0 !important;
}

.erh-contract-split-list,
.erh-contract-cost-list {
    display: grid !important;
    gap: 8px !important;
}

.erh-contract-split-row,
.erh-contract-cost-row {
    align-items: end !important;
    background: #fff !important;
    border: 1px solid var(--erh-blue-line) !important;
    border-radius: 8px !important;
    display: grid !important;
    gap: 8px !important;
    min-width: 0 !important;
    padding: 9px !important;
}

.erh-contract-split-row {
    grid-template-columns: 28px minmax(140px, 1.1fr) minmax(140px, 1fr) minmax(105px, 0.8fr) minmax(78px, 0.45fr) minmax(140px, 1fr) auto !important;
}

.erh-contract-cost-row {
    grid-template-columns: 28px minmax(120px, 0.75fr) minmax(180px, 1.25fr) minmax(90px, 0.5fr) minmax(76px, 0.35fr) minmax(118px, auto) auto !important;
}

.erh-row-index {
    align-items: center !important;
    background: var(--erh-primary-soft) !important;
    border: 1px solid rgba(239, 89, 42, 0.18) !important;
    border-radius: 999px !important;
    color: var(--erh-primary) !important;
    display: inline-flex !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    height: 26px !important;
    justify-content: center !important;
    width: 26px !important;
}

.erh-contract-split-row input,
.erh-contract-split-row select,
.erh-contract-cost-row input,
.erh-contract-cost-row select,
.erh-contract-compact-fields input,
.erh-contract-compact-fields select {
    min-height: 34px !important;
    min-width: 0 !important;
    width: 100% !important;
}

.erh-contract-manager .erh-split-total {
    margin: 12px 0 !important;
}

.erh-contract-advanced {
    margin-top: 14px !important;
    padding: 0 !important;
}

.erh-contract-advanced h3 {
    color: var(--erh-navy) !important;
    font-size: 14px !important;
    margin-top: 14px !important;
}

.erh-muted {
    color: var(--erh-navy-muted) !important;
}

@media (max-width: 1380px) {
    .erh-contract-workbench {
        grid-template-columns: 1fr !important;
    }

    .erh-contract-workbench-side {
        position: static !important;
    }
}

@media (max-width: 980px) {
    .erh-contract-filter,
    .erh-contract-compact-fields,
    .erh-contract-split-row,
    .erh-contract-cost-row {
        grid-template-columns: 1fr !important;
    }

    .erh-row-index {
        justify-self: start !important;
    }
}

@media (max-width: 760px) {
    .erh-split-controls-row,
    .erh-cost-card-fields,
    .erh-cost-money-row {
        grid-template-columns: 1fr !important;
    }

    .erh-split-card-head {
        grid-template-columns: 1fr auto !important;
    }

    .erh-split-card-head span {
        grid-column: 1 / 3 !important;
    }
}

/* Multi-file import */
.erh-import-form input[type="file"] {
    max-width: 520px !important;
    width: 100% !important;
}

.erh-import-form .erh-note {
    color: var(--erh-muted) !important;
    max-width: 720px !important;
}

/* Dashboard refinement: W3POS density, contained tables, hover stats. */
.erh-wrap {
    --erh-primary: #0f6bff;
    --erh-primary-deep: #0b2f6b;
    --erh-primary-soft: #edf6ff;
    --erh-navy: #313949;
    --erh-navy-muted: #555f72;
    --erh-blue-pale: #f4f7fc;
    --erh-blue-line: #d1daec;
    --erh-ink: #171717;
    --erh-muted: #626978;
    --erh-border: #e0e6f0;
    --erh-border-strong: #d1daec;
}

.erh-page-hero h1 {
    font-size: 20px !important;
}

.erh-page-hero p,
.erh-note {
    font-size: 12.5px !important;
}

.erh-kpi-grid {
    gap: 10px !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 196px), 1fr)) !important;
}

.erh-kpi-card {
    border-color: var(--erh-blue-line) !important;
    min-height: 88px !important;
    padding: 12px !important;
}

.erh-kpi-card span,
.erh-mini-card span {
    font-size: 10.5px !important;
}

.erh-kpi-card strong {
    font-size: clamp(18px, 1.45vw, 22px) !important;
    line-height: 1.12 !important;
    margin: 7px 0 4px !important;
    white-space: normal !important;
}

.erh-kpi-card strong span {
    display: block !important;
}

.erh-kpi-card small {
    font-size: 12px !important;
}

.erh-mini-card {
    min-height: 70px !important;
    padding: 11px 12px !important;
}

.erh-mini-card strong {
    font-size: 22px !important;
    margin-top: 8px !important;
}

.erh-dashboard-panels {
    gap: 12px !important;
    margin: 12px 0 !important;
}

.erh-panel {
    padding: 12px !important;
}

.erh-panel h2,
.erh-panel h3,
.erh-panel-heading h2,
.erh-panel-heading h3,
.erh-dashboard-table-panel h2 {
    font-size: 14px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
}

.erh-panel-heading {
    margin-bottom: 10px !important;
}

.erh-chart-panel {
    min-height: 0 !important;
    overflow: visible !important;
}

.erh-bar-chart {
    gap: 7px !important;
    min-height: 158px !important;
}

.erh-bar-track {
    height: 118px !important;
}

.erh-bar-track span,
.erh-store-meter span,
.erh-mini-progress span {
    background: linear-gradient(180deg, #4da3ff, var(--erh-primary)) !important;
}

.erh-bar-item,
.erh-store-row {
    position: relative !important;
}

.erh-chart-tooltip {
    background: var(--erh-navy) !important;
    border-radius: 7px !important;
    bottom: calc(100% + 8px) !important;
    box-shadow: 0 10px 24px rgba(23, 23, 23, 0.14) !important;
    color: #fff !important;
    display: grid !important;
    gap: 3px !important;
    left: 50% !important;
    min-width: 142px !important;
    opacity: 0 !important;
    padding: 8px 9px !important;
    pointer-events: none !important;
    position: absolute !important;
    transform: translate(-50%, 4px) !important;
    transition: opacity 140ms ease, transform 140ms ease !important;
    z-index: 20 !important;
}

.erh-store-row .erh-chart-tooltip {
    bottom: calc(100% + 4px) !important;
    left: auto !important;
    right: 0 !important;
    transform: translateY(4px) !important;
}

.erh-chart-tooltip strong,
.erh-chart-tooltip em,
.erh-chart-tooltip small {
    color: #fff !important;
    font-size: 11.5px !important;
    font-style: normal !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    text-transform: none !important;
    white-space: nowrap !important;
}

.erh-chart-tooltip small {
    color: #cdd7e6 !important;
}

.erh-bar-item:hover .erh-chart-tooltip,
.erh-bar-item:focus .erh-chart-tooltip,
.erh-store-row:hover .erh-chart-tooltip,
.erh-store-row:focus .erh-chart-tooltip {
    opacity: 1 !important;
    transform: translate(-50%, 0) !important;
}

.erh-store-row:hover .erh-chart-tooltip,
.erh-store-row:focus .erh-chart-tooltip {
    transform: translateY(0) !important;
}

.erh-dashboard-table-panel {
    overflow: hidden !important;
}

.erh-dashboard-table-panel.is-top-tracks {
    grid-column: 1 / -1 !important;
}

.erh-dashboard-table-scroll {
    box-sizing: border-box !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

.erh-dashboard-table-panel .erh-table {
    min-width: 0 !important;
    table-layout: fixed !important;
    width: 100% !important;
}

.erh-dashboard-table-panel .widefat th,
.erh-dashboard-table-panel .widefat td {
    font-size: 12px !important;
    overflow-wrap: anywhere !important;
    padding: 8px 9px !important;
    white-space: normal !important;
}

.erh-dashboard-table-panel .widefat th {
    font-size: 10.5px !important;
}

.erh-dashboard-table-panel .widefat td:nth-last-child(-n + 2),
.erh-dashboard-table-panel .widefat th:nth-last-child(-n + 2) {
    text-align: right !important;
}

.erh-dashboard-table-panel.is-top-tracks th:nth-child(1),
.erh-dashboard-table-panel.is-top-tracks td:nth-child(1) {
    width: 20% !important;
}

.erh-dashboard-table-panel.is-top-tracks th:nth-child(2),
.erh-dashboard-table-panel.is-top-tracks td:nth-child(2) {
    width: 50% !important;
}

.erh-dashboard-table-panel.is-top-tracks th:nth-child(3),
.erh-dashboard-table-panel.is-top-tracks td:nth-child(3) {
    width: 18% !important;
}

.erh-dashboard-table-panel.is-top-tracks th:nth-child(4),
.erh-dashboard-table-panel.is-top-tracks td:nth-child(4) {
    width: 12% !important;
}

.erh-dashboard-table-panel.is-top-tracks td:nth-child(2) {
    overflow-wrap: anywhere !important;
}

.erh-dashboard-table-panel.is-top-artists,
.erh-dashboard-table-panel.is-top-countries,
.erh-dashboard-table-panel.is-top-import-files {
    align-self: start !important;
}

.erh-dashboard-table-pager {
    align-items: center !important;
    border-top: 1px solid var(--erh-blue-line) !important;
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-end !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
}

.erh-dashboard-table-pager span {
    color: var(--erh-navy-muted) !important;
    font-size: 12px !important;
    margin-right: auto !important;
}

.erh-dashboard-table-pager .button,
.erh-dashboard-table-pager button {
    background: #fff !important;
    border: 1px solid var(--erh-blue-line) !important;
    border-radius: 7px !important;
    color: var(--erh-navy) !important;
    min-height: 30px !important;
    padding: 0 10px !important;
}

.erh-dashboard-table-pager .button:disabled,
.erh-dashboard-table-pager button:disabled {
    cursor: default !important;
    opacity: 0.45 !important;
}

/* Catalogue and duplicates containment. */
.erh-catalog-filter {
    align-items: end !important;
    display: grid !important;
    gap: 10px !important;
    grid-template-columns: minmax(230px, 1.4fr) minmax(150px, 0.7fr) minmax(180px, 1fr) auto auto !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.erh-catalog-filter label {
    display: grid !important;
    gap: 5px !important;
    grid-template-columns: 1fr !important;
    margin: 0 !important;
    min-width: 0 !important;
}

.erh-catalog-filter input,
.erh-catalog-filter select {
    min-width: 0 !important;
    width: 100% !important;
}

.erh-catalog-bulk-form {
    max-width: 100% !important;
    overflow: hidden !important;
}

.erh-catalog-bulk-form > .erh-toolbar {
    margin: 8px 0 !important;
}

.erh-catalog-table-scroll {
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    width: 100% !important;
}

.erh-catalog-table {
    min-width: 1120px !important;
    table-layout: fixed !important;
    width: 100% !important;
}

.erh-catalog-table th,
.erh-catalog-table td {
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

/* v0.4.14 — Column widths keyed to the col-* classes, not nth-child().
   The catalog table was reordered (Artist moved to position 2) but the
   old nth-child widths were never updated — Artist got 105px (cramped),
   ISRC got 24% (oversized). Class selectors are reorder-proof.
   Sum: 4 + 22 + 22 + 10 + 10 + 12 + 13 + 7 = 100%. */
.erh-catalog-table th.col-check,
.erh-catalog-table td.col-check {
    text-align: center !important;
    width: 4% !important;
}

.erh-catalog-table th.col-artist,
.erh-catalog-table td.col-artist {
    width: 22% !important;
}

.erh-catalog-table th.col-track,
.erh-catalog-table td.col-track {
    width: 22% !important;
}

.erh-catalog-table th.col-isrc,
.erh-catalog-table td.col-isrc {
    width: 10% !important;
}

.erh-catalog-table th.col-upc,
.erh-catalog-table td.col-upc {
    width: 10% !important;
}

.erh-catalog-table th.col-release,
.erh-catalog-table td.col-release {
    width: 12% !important;
}

.erh-catalog-table th.col-label,
.erh-catalog-table td.col-label {
    width: 13% !important;
}

.erh-catalog-table th.col-contrib,
.erh-catalog-table td.col-contrib {
    text-align: center !important;
    width: 7% !important;
}

.erh-catalog-open {
    display: inline !important;
    line-height: 1.35 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
    white-space: normal !important;
}

.erh-duplicates-grid {
    align-items: start !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.erh-duplicate-panel,
.erh-duplicate-table-scroll {
    max-width: 100% !important;
    overflow: hidden !important;
}

.erh-duplicate-table-scroll {
    overflow-x: auto !important;
}

.erh-duplicate-panel .widefat {
    min-width: 0 !important;
    table-layout: fixed !important;
    width: 100% !important;
}

.erh-duplicate-panel .widefat th,
.erh-duplicate-panel .widefat td {
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

@media (max-width: 1180px) {
    .erh-catalog-filter,
    .erh-duplicates-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Dashboard detail pass: lighter W3POS UI with visible pictograms. */
.erh-wrap {
    font-size: 13.5px !important;
}

.erh-kpi-card small,
.erh-panel td,
.erh-store-row strong,
.erh-store-row em,
.erh-note {
    font-size: 13px !important;
}

.erh-wrap .widefat thead th,
.erh-wrap .widefat tfoot th {
    font-size: 11.5px !important;
}

.erh-kpi-card {
    padding-right: 54px !important;
    position: relative !important;
}

.erh-kpi-card .dashicons {
    align-items: center !important;
    background: var(--erh-primary-soft) !important;
    border-radius: 8px !important;
    color: var(--erh-primary) !important;
    display: inline-flex !important;
    font-size: 17px !important;
    height: 34px !important;
    justify-content: center !important;
    line-height: 1 !important;
    position: absolute !important;
    right: 14px !important;
    top: 14px !important;
    width: 34px !important;
}

.erh-store-logo {
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.erh-store-panel .erh-dashboard-table-pager {
    margin-top: 10px !important;
}



/* ============================================================
   ë • hq suite layout system
   Purpose: product UI sizing, no global horizontal drift,
   compact controls, single real pagination, local table scroll.
   ============================================================ */
:root {
  --ehq-suite-sidebar: 184px;
  --ehq-suite-page-gap: 16px;
  --ehq-suite-blue: var(--wp--preset--color--primary, #0f6bff);
  --ehq-suite-ink: #0f172a;
  --ehq-suite-muted: #475569;
  --ehq-suite-line: #cfe0f7;
  --ehq-suite-card: #fff;
  --ehq-suite-bg: #eef4fb;
}

/* Standalone/frontend distribution shell */
body.erh-standalone-body {
  background: var(--ehq-suite-bg) !important;
  color: var(--ehq-suite-ink) !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  font-family: var(--ehq3-font, var(--ehq-font, "Open Sans", system-ui, sans-serif)) !important;
}

body.erh-standalone-body .erh-w3pos-wrapper,
body.erh-standalone-body #main-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: clip !important;
}

/* Make the app use the real available width: viewport minus sidebar, not 100vw. */
body.erh-standalone-body .erh-w3pos-nav-header.nav-header {
  width: var(--ehq-suite-sidebar) !important;
  min-width: var(--ehq-suite-sidebar) !important;
  max-width: var(--ehq-suite-sidebar) !important;
  height: 52px !important;
  left: 0 !important;
  top: 0 !important;
}

body.erh-standalone-body .erh-front-sidebar.deznav,
body.erh-standalone-body .erh-w3pos-sidebar.deznav {
  width: var(--ehq-suite-sidebar) !important;
  min-width: var(--ehq-suite-sidebar) !important;
  max-width: var(--ehq-suite-sidebar) !important;
  top: 52px !important;
  height: calc(100vh - 52px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.erh-standalone-body .erh-w3pos-header.header {
  left: var(--ehq-suite-sidebar) !important;
  right: 0 !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 var(--ehq-suite-page-gap) 0 !important;
  height: 62px !important;
}

body.erh-standalone-body .erh-w3pos-header .header-content {
  min-height: 58px !important;
  height: auto !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.erh-standalone-body .erh-front-main.content-body {
  margin-left: var(--ehq-suite-sidebar) !important;
  margin-right: 0 !important;
  padding: 78px var(--ehq-suite-page-gap) var(--ehq-suite-page-gap) !important;
  width: calc(100% - var(--ehq-suite-sidebar)) !important;
  max-width: calc(100% - var(--ehq-suite-sidebar)) !important;
  min-width: 0 !important;
  overflow-x: clip !important;
}

body.erh-standalone-body .erh-front-main .container-fluid {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

/* Keep module pages aligned and remove the huge vertical gaps. */
body.erh-standalone-body .erh-front-workspace,
body.erh-standalone-body .erh-front-backend,
body.erh-standalone-body .erh-front-backend .erh-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.erh-standalone-body .erh-front-backend .erh-wrap {
  display: block !important;
}

body.erh-standalone-body .erh-front-backend .erh-page-hero {
  display: none !important;
}

/* Cards/forms */
body.erh-standalone-body .erh-front-hero,
body.erh-standalone-body .erh-front-kpi,
body.erh-standalone-body .erh-front-mini,
body.erh-standalone-body .erh-front-panel,
body.erh-standalone-body .erh-front-backend .erh-panel,
body.erh-standalone-body .erh-front-backend .erh-card,
body.erh-standalone-body .erh-front-backend .erh-filter-toolbar {
  background: var(--ehq-suite-card) !important;
  border: 1px solid var(--ehq-suite-line) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.erh-standalone-body .erh-front-backend .erh-panel,
body.erh-standalone-body .erh-front-backend .erh-card {
  padding: 14px !important;
  margin: 0 0 14px !important;
}

body.erh-standalone-body .erh-front-backend .erh-grid,
body.erh-standalone-body .erh-front-backend .erh-grid.compact {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)) !important;
  gap: 12px !important;
  margin: 0 0 14px !important;
}

/* Tables: never drive the page width. */
body.erh-standalone-body .ehq-table-scroll,
body.erh-standalone-body .erh-table-scroll,
body.erh-standalone-body .erh-front-table-scroll {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  border: 1px solid var(--ehq-suite-line) !important;
  border-radius: 10px !important;
  background: #fff !important;
}

body.erh-standalone-body .erh-front-backend table,
body.erh-standalone-body .erh-wrap table,
body.erh-standalone-body .widefat {
  width: 100% !important;
  min-width: 820px !important;
  max-width: none !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
  margin: 0 !important;
}

body.erh-standalone-body .erh-front-backend th,
body.erh-standalone-body .erh-front-backend td,
body.erh-standalone-body .erh-wrap th,
body.erh-standalone-body .erh-wrap td {
  font-size: 12px !important;
  line-height: 1.35 !important;
  padding: 8px 10px !important;
  vertical-align: middle !important;
  max-width: 360px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.erh-standalone-body .erh-front-backend th,
body.erh-standalone-body .erh-wrap th {
  background: #eef5ff !important;
  color: #40516b !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

body.erh-standalone-body .erh-front-backend td code,
body.erh-standalone-body .erh-front-backend td pre,
body.erh-standalone-body .erh-wrap td code,
body.erh-standalone-body .erh-wrap td pre {
  display: block !important;
  max-width: 42rem !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

/* Controls and buttons compact */
body.erh-standalone-body .erh-front-backend input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
body.erh-standalone-body .erh-front-backend select,
body.erh-standalone-body .erh-front-backend textarea {
  min-height: 34px !important;
  height: auto !important;
  border-radius: 8px !important;
  border: 1px solid #bfd2ee !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
  max-width: 100% !important;
}

body.erh-standalone-body .erh-front-backend .button,
body.erh-standalone-body .erh-front-backend .button-primary,
body.erh-standalone-body .erh-front-backend .button-secondary,
body.erh-standalone-body .erh-front-backend button,
body.erh-standalone-body .erh-front-backend input[type="submit"],
body.erh-standalone-body .btn {
  min-height: 32px !important;
  height: auto !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

/* Pagination: only real pagination, compact, top/bottom friendly. */
body.erh-standalone-body .erh-pagination,
body.erh-standalone-body .ehq-pagination {
  align-items: center !important;
  background: #fff !important;
  border: 1px solid #d9e6f7 !important;
  border-radius: 10px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  justify-content: flex-end !important;
  margin: 10px 0 !important;
  padding: 8px !important;
  position: sticky !important;
  top: 64px !important;
  z-index: 3 !important;
}

body.erh-standalone-body .erh-pagination span:first-child {
  color: #40516b !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  margin-right: auto !important;
}

body.erh-standalone-body .ehq-v3-pagination-clone,
body.erh-standalone-body .ehq-pagination-clone {
  display: none !important;
}

/* Contract page: reduce side editor pressure. */
body.erh-standalone-body .erh-contract-workbench {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px) !important;
  gap: 14px !important;
  align-items: start !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.erh-standalone-body .erh-contract-workbench-main,
body.erh-standalone-body .erh-contract-workbench-side {
  min-width: 0 !important;
  max-width: 100% !important;
}

body.erh-standalone-body .erh-contract-workbench-side {
  position: sticky !important;
  top: 78px !important;
  align-self: start !important;
}

body.erh-standalone-body .erh-contract-workbench-side .erh-panel,
body.erh-standalone-body .erh-contract-workbench-side .erh-card,
body.erh-standalone-body .erh-contract-manage-panel {
  max-height: calc(100vh - 100px) !important;
  overflow: auto !important;
}

body.erh-standalone-body .erh-contract-workbench-side input,
body.erh-standalone-body .erh-contract-workbench-side select {
  width: 100% !important;
  max-width: 100% !important;
}

/* Dashboard: do not let right rail force horizontal drift. */
body.erh-standalone-body .erh-front-dashboard-layout,
body.erh-standalone-body .erh-front-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px) !important;
  gap: 14px !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.erh-standalone-body .erh-front-dashboard-main,
body.erh-standalone-body .erh-front-dashboard-side {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 1180px) {
  body.erh-standalone-body .erh-contract-workbench,
  body.erh-standalone-body .erh-front-dashboard-layout,
  body.erh-standalone-body .erh-front-content {
    grid-template-columns: 1fr !important;
  }

  body.erh-standalone-body .erh-contract-workbench-side {
    position: static !important;
  }

  body.erh-standalone-body .erh-contract-workbench-side .erh-panel,
  body.erh-standalone-body .erh-contract-workbench-side .erh-card,
  body.erh-standalone-body .erh-contract-manage-panel {
    max-height: none !important;
  }
}

@media (max-width: 860px) {
  :root { --ehq-suite-sidebar: 0px; }

  body.erh-standalone-body .erh-w3pos-nav-header.nav-header,
  body.erh-standalone-body .erh-front-sidebar.deznav,
  body.erh-standalone-body .erh-w3pos-sidebar.deznav,
  body.erh-standalone-body .erh-w3pos-header.header {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    left: auto !important;
    right: auto !important;
  }

  body.erh-standalone-body .erh-front-main.content-body {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
  }

  body.erh-standalone-body .erh-pagination,
  body.erh-standalone-body .ehq-pagination {
    position: static !important;
  }
}

/* ── Generic text link ────────────────────────────────────────────── */
.erh-text-link {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--erh-primary, var(--ehq-primary)) !important;
  cursor: pointer;
  display: inline;
  font-size: inherit;
  font-weight: 500;
  min-height: 0 !important;
  padding: 0 !important;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
  vertical-align: baseline;
}
.erh-text-link:hover {
  color: var(--erh-primary, var(--ehq-primary)) !important;
  text-decoration-color: currentColor;
}

/* ── Generic delete link/button — orange, no blue background ─────── */
.erh-btn-delete,
.erh-wrap .button.delete,
.erh-wrap input[type="submit"].delete,
.erh-wrap button.delete {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: #b32d2e !important;
  cursor: pointer;
  display: inline;
  font-size: inherit;
  font-weight: 500;
  min-height: 0 !important;
  padding: 0 !important;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s, color 0.15s;
  vertical-align: baseline;
}
.erh-btn-delete:hover,
.erh-wrap .button.delete:hover,
.erh-wrap input[type="submit"].delete:hover,
.erh-wrap button.delete:hover {
  background: none !important;
  color: #8a1f20 !important;
  text-decoration-color: currentColor;
}

/* Draft actions cell */
.erh-draft-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.erh-draft-actions .erh-inline-form {
  display: inline;
}

/* Bulk toolbar */
.erh-bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.erh-bulk-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}



/* Bulk approve splits — draft row highlight */
.erh-table tr.erh-row-draft td {
    background: #fffbf0;
}
.erh-table tr.erh-row-draft .erh-status-badge {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

/* ── Workload dialog: SVG progress ring ─────────────────────────────────── */
.erh-workload-ring {
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    transform: rotate(-90deg);
}
.erh-workload-ring-track {
    fill: none;
    stroke: var(--erh-border, #e2e8f0);
    stroke-width: 4;
}
.erh-workload-ring-fill {
    fill: none;
    stroke: var(--erh-accent, var(--ehq-primary));
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 150.796;
    stroke-dashoffset: 150.796;
    transition: stroke-dashoffset 0.6s ease;
}

/* ── Contract status overview ─────────────────────────────────────────── */
.erh-contract-overview-grid {
    margin-bottom: 16px;
}
.erh-card--warn {
    border-left: 3px solid #f59e0b;
}
.erh-contract-overview-alerts {
    margin-bottom: 20px;
}

/* ── Payout preview modal ─────────────────────────────────────────────── */
.erh-payout-preview-btn {
    margin-left: 4px;
}
.erh-payout-gross-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    gap: 8px;
}

/* ── Recoupment progress bar ─────────────────────────────────────────── */
.erh-recoupment-panel {
    margin-top: 16px;
}
.erh-recoupment-bar-wrap {
    margin-top: 12px;
}
.erh-recoupment-bar {
    background: var(--erh-border, #e2e8f0);
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}
.erh-recoupment-bar span {
    display: block;
    background: var(--erh-accent, var(--ehq-primary));
    height: 100%;
    transition: width 0.4s ease;
}
.erh-recoupment-status {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--erh-muted, #6b7280);
}

/* ── Batch edit panel ────────────────────────────────────────────────── */
.erh-batch-edit-panel {
    margin-top: 8px;
}
.erh-batch-edit-panel summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
}
.erh-actions-cell {
    display: flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
}

/* v0.4.15 — Table-row action cells: force a SINGLE non-wrapping row of
   compact buttons so the row keeps the standard height
   (templates-v2/05-table.html · ruler "row 44").

   Before: Statements/Payments/Mapping rows put 5 full-size .btn
   (min-height 44px each) in a .erh-actions cell. The cell wrapped them
   one-per-line → a ~250px-tall row. flex-wrap is the enemy here: it lets
   the browser keep the table column narrow and stack the buttons.

   Fix: nowrap forces the column to widen and the 5 buttons sit on one
   line; the buttons render at btn-sm size (28px) so the row stays ~44px.
   !important is required to beat the wp-admin `flex-wrap: wrap !important`
   rule on .erh-actions. */
td > .erh-actions,
td.erh-actions-cell,
td > .erh-actions-cell {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

td > .erh-actions .btn,
td.erh-actions-cell .btn,
td > .erh-actions-cell .btn {
    min-height: 28px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
}

/* ─── Client-side table filter ─────────────────────────────────────────── */
.erh-table-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 8px;
    flex-wrap: wrap;
}
.erh-table-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ehq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.erh-table-filter {
    flex: 1;
    min-width: 220px;
    max-width: 420px;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.erh-table-filter:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}
.erh-table-filter-count {
    font-size: 12px;
    color: var(--ehq-text-muted);
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Option C — Render context scaffolding
 * 
 * The shared dashboard body is wrapped in .erh-render-context with either
 * .erh-context-admin (wp-admin → narrower viewport) or .erh-context-frontend
 * (/distribution/ → wider viewport).
 * 
 * Container-type:inline-size enables CSS container queries on the body, so
 * any responsive rule inside can react to the actual container width rather
 * than the viewport (which is the wrong signal when the WP admin sidebar
 * takes ~250px and the frontend takes 0).
 * 
 * Add context-specific overrides under .erh-context-admin or .erh-context-frontend
 * only when the default responsive CSS isn't sufficient — keep these minimal.
 * ═══════════════════════════════════════════════════════════════════════════ */

.erh-render-context {
    container-type: inline-size;
    container-name: erh-dashboard;
    width: 100%;
    min-width: 0;
}

/* Container queries — adapt without context-specific branching */
@container erh-dashboard (max-width: 720px) {
    .erh-page-hero { flex-direction: column; align-items: flex-start; }
    .erh-page-hero .erh-brand-mark { width: 3rem; height: 3rem; }
}

@container erh-dashboard (min-width: 1100px) {
    .erh-kpi-card { padding-inline: 1.5rem; }
}

/* Context-specific tweaks (Pattern 2) — placeholders ready to use */
.erh-context-admin {
    /* wp-admin context — narrower */
}

.erh-context-frontend {
    /* /distribution/ context — wider */
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Dashboard polish — fully responsive, container-query-aware.
 * Applied via .erh-render-context wrapper. Uses container queries so the
 * layout adapts to its actual width regardless of where it lives (wp-admin
 * with sidebar pushing it right, or /distribution/ taking full viewport).
 * No overflow, no element escapes its container in any direction.
 * ═══════════════════════════════════════════════════════════════════════════ */

.erh-render-context {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    container-type: inline-size;
    container-name: erh-dashboard;
    padding: 0;
    margin: 0;
}

.erh-render-context *,
.erh-render-context *::before,
.erh-render-context *::after {
    box-sizing: border-box;
}

/* ── KPI grid — fully responsive via auto-fit ──────────────────────────── */
.erh-render-context .erh-card-grid,
.erh-render-context .erh-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: clamp(0.75rem, 1.5cqi, 1.25rem);
    width: 100%;
    margin-bottom: clamp(1rem, 2cqi, 1.5rem);
}

.erh-render-context .erh-card,
.erh-render-context .erh-kpi-card {
    min-width: 0;
    width: 100%;
    background: var(--erh-card-bg, #fff);
    border: 1px solid var(--erh-border, var(--ehq-border));
    border-radius: 14px;
    padding: clamp(0.875rem, 2cqi, 1.25rem);
    transition: transform 200ms cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 200ms cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.erh-render-context .erh-card:hover,
.erh-render-context .erh-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 44, 94, 0.08);
}

.erh-render-context .erh-card span,
.erh-render-context .erh-kpi-card span {
    display: block;
    font-size: clamp(0.7rem, 1.5cqi, 0.78rem);
    font-weight: 700;
    color: var(--erh-muted, var(--ehq-text-muted));
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.erh-render-context .erh-card strong,
.erh-render-context .erh-kpi-card strong {
    display: block;
    font-size: clamp(1.4rem, 3.5cqi, 1.875rem);
    font-weight: 800;
    color: var(--erh-ink, var(--ehq-text));
    letter-spacing: 0;
    line-height: 1.15;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ── Page hero (Dashboard header inside the body) ──────────────────────── */
.erh-render-context .erh-page-hero {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2cqi, 1.25rem);
    padding: clamp(1rem, 2.5cqi, 1.5rem);
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: clamp(1rem, 2cqi, 1.5rem);
}

.erh-render-context .erh-page-hero h1 {
    font-size: clamp(1.5rem, 4cqi, 2.25rem);
    line-height: 1.15;
    margin: 0;
    word-break: break-word;
}

.erh-render-context .erh-page-hero p {
    font-size: clamp(0.85rem, 1.8cqi, 0.95rem);
    margin: 0.25rem 0 0;
    color: var(--erh-muted, var(--ehq-text-muted));
}

/* ── Action grid (Recent imports, suspense, etc.) ──────────────────────── */
.erh-render-context .erh-action-grid,
.erh-render-context .erh-cards-row.is-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: clamp(0.75rem, 1.5cqi, 1.25rem);
    width: 100%;
}

/* ── Panel + table containment ─────────────────────────────────────────── */
.erh-render-context .erh-panel {
    width: 100%;
    margin: 0 0 clamp(1rem, 2cqi, 1.5rem);
    padding: clamp(0.875rem, 2cqi, 1.25rem);
    overflow: hidden;
    min-width: 0;
}

.erh-render-context .erh-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.erh-render-context table {
    width: 100%;
    table-layout: auto;
    max-width: 100%;
    margin: 0;
}

/* ── Container query breakpoints ───────────────────────────────────────── */

/* Cramped (wp-admin with expanded sidebar < 700px content) */
@container erh-dashboard (max-width: 700px) {
    .erh-render-context .erh-page-hero { flex-direction: column; align-items: flex-start; }
    .erh-render-context .erh-page-hero .erh-brand-mark { width: 2.75rem; height: 2.75rem; }
    .erh-render-context .erh-version-pill { align-self: flex-start; }
    .erh-render-context .erh-card-grid,
    .erh-render-context .erh-cards-row { gap: 0.6rem; }
}

/* Wide (frontend full viewport > 1200px) */
@container erh-dashboard (min-width: 1200px) {
    .erh-render-context .erh-card-grid,
    .erh-render-context .erh-cards-row {
        grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    }
}

/* ── Defensive: nothing escapes the context wrapper ────────────────────── */
.erh-render-context img,
.erh-render-context svg,
.erh-render-context iframe,
.erh-render-context canvas {
    max-width: 100%;
    height: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Priority 3 — Frontend/admin class harmonization layer
 *
 * Goal: make .erh-front-* classes (used in non-migrated frontend views) inherit
 * the EXACT visual styling of their admin equivalents (.erh-card, .erh-panel,
 * .erh-page-hero, etc.) so the public /distribution/ views look identical to
 * wp-admin even on pages not yet migrated to Option C.
 *
 * These rules sit in the .erh-render-context wrapper so they only apply to
 * dashboard-scoped renders and never leak into the wider wp-admin chrome.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── Cards / Panels ─────────────────────────────────────────────────────── */
.erh-render-context :is(
    .erh-card,
    .erh-panel,
    .erh-front-panel,
    .erh-front-kpi,
    .erh-front-mini,
    .erh-dashboard-table-panel,
    .erh-front-dashboard-table-panel
) {
    background: #fff;
    border: 1px solid var(--erh-border, #dcdcde);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: clamp(0.875rem, 2cqi, 1.25rem);
    margin: 0 0 clamp(1rem, 2cqi, 1.5rem);
    min-width: 0;
    transition: transform 200ms cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 200ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

.erh-render-context :is(
    .erh-card,
    .erh-front-panel,
    .erh-front-kpi
):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 44, 94, 0.08);
}

/* KPI labels + values — common across .erh-card span/strong + .erh-front-kpi */
.erh-render-context :is(.erh-card, .erh-front-kpi, .erh-front-mini) > span,
.erh-render-context :is(.erh-card, .erh-front-kpi, .erh-front-mini) .erh-kpi-label {
    display: block;
    font-size: clamp(0.7rem, 1.5cqi, 0.78rem);
    font-weight: 700;
    color: var(--erh-muted, var(--ehq-text-muted));
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.erh-render-context :is(.erh-card, .erh-front-kpi, .erh-front-mini) > strong,
.erh-render-context :is(.erh-card, .erh-front-kpi, .erh-front-mini) .erh-kpi-value {
    display: block;
    font-size: clamp(1.4rem, 3.5cqi, 1.875rem);
    font-weight: 800;
    color: var(--erh-ink, var(--ehq-text));
    letter-spacing: 0;
    line-height: 1.15;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ── Heroes (page intros) — .erh-page-hero ≡ .erh-front-hero ≡ .erh-front-dashboard-hero ── */
.erh-render-context :is(
    .erh-page-hero,
    .erh-front-hero,
    .erh-front-dashboard-hero,
    .erh-front-console-hero
) {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2cqi, 1.25rem);
    padding: clamp(1rem, 2.5cqi, 1.5rem);
    background: #fff;
    border: 1px solid var(--erh-border, #dcdcde);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    margin: 0 0 clamp(1rem, 2cqi, 1.5rem);
    flex-wrap: wrap;
    width: 100%;
}

.erh-render-context :is(.erh-page-hero, .erh-front-hero, .erh-front-dashboard-hero) h1,
.erh-render-context :is(.erh-page-hero, .erh-front-hero, .erh-front-dashboard-hero) h2 {
    font-size: clamp(1.5rem, 4cqi, 2.25rem);
    line-height: 1.15;
    color: var(--erh-ink, #101517);
    margin: 0;
    word-break: break-word;
}

.erh-render-context :is(.erh-page-hero, .erh-front-hero, .erh-front-dashboard-hero) p {
    font-size: clamp(0.85rem, 1.8cqi, 0.95rem);
    margin: 0.25rem 0 0;
    color: var(--erh-muted, var(--ehq-text-muted));
}

/* ── Grids — KPI rows + mini-grids ──────────────────────────────────────── */
.erh-render-context :is(
    .erh-grid,
    .erh-kpi-grid,
    .erh-card-grid,
    .erh-cards-row,
    .erh-front-kpis,
    .erh-front-mini-grid
) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: clamp(0.75rem, 1.5cqi, 1.25rem);
    width: 100%;
    margin-bottom: clamp(1rem, 2cqi, 1.5rem);
}

/* ── Buttons — .button ≡ .erh-front-button ──────────────────────────────── */
.erh-render-context :is(.erh-front-button, .erh-front-button:visited) {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 120ms ease, color 120ms ease,
                border-color 120ms ease, transform 120ms ease,
                box-shadow 120ms ease;
}

.erh-render-context .erh-front-button.is-primary {
    background: var(--erh-primary, var(--ehq-primary));
    color: #fff;
    border-color: var(--erh-primary, var(--ehq-primary));
}

.erh-render-context .erh-front-button.is-primary:hover {
    background: var(--erh-primary-deep, #0b2f6b);
    border-color: var(--erh-primary-deep, #0b2f6b);
    transform: translateY(-1px);
}

.erh-render-context .erh-front-button.is-secondary {
    background: #fff;
    color: var(--erh-primary, var(--ehq-primary));
    border-color: var(--erh-primary, var(--ehq-primary));
}

.erh-render-context .erh-front-button.is-secondary:hover {
    background: var(--erh-primary-soft, var(--ehq-primary-soft));
}

/* ── Forms — .erh-form-grid ≡ .erh-front-form-grid ──────────────────────── */
.erh-render-context :is(.erh-form-grid, .erh-front-form-grid) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: clamp(0.6rem, 1.2cqi, 0.875rem);
    width: 100%;
    margin-bottom: clamp(0.75rem, 1.5cqi, 1rem);
}

.erh-render-context :is(.erh-form-grid, .erh-front-form-grid) label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: clamp(0.75rem, 1.5cqi, 0.85rem);
    font-weight: 600;
    color: var(--erh-muted, var(--ehq-text-muted));
    min-width: 0;
}

.erh-render-context :is(.erh-form-grid, .erh-front-form-grid) :is(input, select, textarea) {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--erh-border, #cfe0f3);
    border-radius: 6px;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--erh-ink, var(--ehq-text));
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.erh-render-context :is(.erh-form-grid, .erh-front-form-grid) :is(input, select, textarea):focus {
    outline: none;
    border-color: var(--erh-primary, var(--ehq-primary));
    box-shadow: 0 0 0 3px rgba(15, 107, 255, 0.15);
}

/* ── Bulk toolbars — .erh-bulk-toolbar ≡ .erh-front-bulk-toolbar ────────── */
.erh-render-context :is(.erh-toolbar, .erh-bulk-toolbar, .erh-front-bulk-toolbar) {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    background: var(--erh-primary-soft, var(--ehq-primary-soft));
    border: 1px solid var(--erh-border, #cfe0f3);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.erh-render-context :is(.erh-bulk-label, .erh-toolbar > strong) {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--erh-ink, var(--ehq-text));
    margin-right: 0.25rem;
}

/* ── Tables — .erh-table-scroll ≡ .erh-front-table-scroll ───────────────── */
.erh-render-context :is(.erh-table-scroll, .erh-front-table-scroll) {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid var(--erh-border, #dcdcde);
}

.erh-render-context :is(.erh-table-scroll, .erh-front-table-scroll) table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.erh-render-context :is(.erh-table-scroll, .erh-front-table-scroll) th,
.erh-render-context :is(.erh-table-scroll, .erh-front-table-scroll) td {
    padding: 0.6rem 0.875rem;
    border-bottom: 1px solid var(--erh-border, #ecf1f7);
}

.erh-render-context :is(.erh-table-scroll, .erh-front-table-scroll) th {
    background: var(--erh-primary-soft, var(--ehq-primary-soft));
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: var(--erh-ink, var(--ehq-text));
}

.erh-render-context :is(.erh-table-scroll, .erh-front-table-scroll) tbody tr:hover td {
    background: rgba(15, 107, 255, 0.04);
}

/* ── Action links — .erh-action-link, .erh-front-action-link ───────────── */
.erh-render-context :is(.erh-action-link, .erh-front-action-link) {
    color: var(--erh-primary, var(--ehq-primary));
    text-decoration: none;
    font-weight: 600;
    transition: color 120ms ease;
}

.erh-render-context :is(.erh-action-link, .erh-front-action-link):hover {
    color: var(--erh-primary-deep, #0b2f6b);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Priority 4 — Modal + bulk form polish (consistency layer)
 * Modals escape .erh-render-context since they're position:fixed, but we still
 * style them tokenized for visual consistency with the cards/panels.
 * ═══════════════════════════════════════════════════════════════════════════ */

.erh-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(8, 14, 28, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.erh-modal:not([hidden]),
.erh-modal.is-visible,
.erh-modal[aria-hidden="false"] {
    display: flex;
}

.erh-modal-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.erh-modal-card,
.erh-modal-dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 32px 64px rgba(8, 14, 28, 0.35), 0 4px 16px rgba(8, 14, 28, 0.18);
    max-width: min(720px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    padding: 0;
    animation: erh-modal-pop 240ms cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes erh-modal-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.erh-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--erh-border, var(--ehq-border));
}

.erh-modal-head h3,
.erh-modal-head h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--erh-ink, var(--ehq-text));
}

.erh-modal-close {
    background: transparent;
    border: 0;
    color: var(--erh-muted, var(--ehq-text-muted));
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background-color 120ms, color 120ms;
}

.erh-modal-close:hover {
    background: var(--erh-primary-soft, var(--ehq-primary-soft));
    color: var(--erh-primary, var(--ehq-primary));
}

.erh-modal-body {
    padding: 1.25rem 1.5rem;
}
/* v0.4.11 — Alert variant for ErhDrawer.confirm() modals (icon-centered
   layout). Replaces the inline style="text-align:center" that used to be
   hardcoded in the erh-drawer.js modal template. */
.erh-modal-body.is-alert {
    text-align: center;
}
.erh-modal-body.is-alert .dashicons {
    display: block;
    margin: 0 auto var(--ehq-space-2, 8px);
}
.erh-modal-body.is-alert h2 {
    margin-top: var(--ehq-space-2, 8px);
}
.erh-modal-body.is-alert p {
    margin: var(--ehq-space-2, 8px) auto 0;
    max-width: 40ch;
}

.erh-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--erh-border, var(--ehq-border));
    background: var(--erh-blue-pale, #f6f9ff);
}

/* Bulk separator + label visual polish */
.erh-render-context .erh-bulk-separator {
    color: var(--erh-border, #cbd5e1);
    margin: 0 0.25rem;
    user-select: none;
}

.erh-render-context :is(.erh-bulk-toolbar, .erh-front-bulk-toolbar) label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--erh-muted, var(--ehq-text-muted));
    font-weight: 500;
}

.erh-render-context :is(.erh-bulk-toolbar, .erh-front-bulk-toolbar) :is(select, input) {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--erh-border, #cfe0f3);
    border-radius: 6px;
    background: #fff;
    font-size: 0.85rem;
    color: var(--erh-ink, var(--ehq-text));
}

/* ═══════════════════════════════════════════════════════════════════════════
 * Splits & Expenses Wizard (v1.1.0)
 * Step-by-step UI with progress bar, choice cards, split table, review screen.
 * Inside .erh-render-context so it inherits container queries + polish.
 * ═══════════════════════════════════════════════════════════════════════════ */

.erh-wizard-frame {
    margin: 1.25rem 0;
}

.erh-wizard-steps {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.erh-wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.6rem 0.4rem 0;
}

.erh-wizard-step + .erh-wizard-step::before {
    content: "›";
    color: #cbd5e1;
    margin-right: 0.5rem;
    font-size: 1rem;
}

.erh-wizard-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--ehq-text-muted);
    font-weight: 700;
    font-size: 0.75rem;
}

.erh-wizard-step.is-done .erh-wizard-step-num {
    background: #22c58b;
    color: #fff;
}

.erh-wizard-step.is-done .erh-wizard-step-label,
.erh-wizard-step.is-done {
    color: var(--ehq-text);
}

.erh-wizard-step.is-active .erh-wizard-step-num {
    background: var(--ehq-primary);
    color: #fff;
}

.erh-wizard-step.is-active .erh-wizard-step-label,
.erh-wizard-step.is-active {
    color: var(--ehq-primary);
    font-weight: 700;
}

.erh-wizard-card {
    background: #fff;
    border: 1px solid var(--ehq-border);
    border-radius: 16px;
    padding: clamp(1.25rem, 3cqi, 2.5rem);
    box-shadow: 0 4px 12px rgba(15, 44, 94, 0.04);
}

.erh-wizard-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 3cqi, 2rem);
    color: var(--ehq-text);
    line-height: 1.2;
}

.erh-wizard-help {
    color: var(--ehq-text-muted);
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.erh-wizard-hint {
    display: block;
    margin-top: 0.25rem;
    color: #94a3b8;
    font-size: 0.78rem;
}

/* Choice cards (Type, Scope, Apply mode) */
.erh-wizard-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}

.erh-wizard-choices.is-three {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.erh-wizard-choice {
    display: block;
    padding: 1.25rem;
    background: #fff;
    border: 2px solid var(--ehq-border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
    position: relative;
}

.erh-wizard-choice:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.erh-wizard-choice input[type="radio"] {
    position: absolute;
    top: 1rem;
    right: 1rem;
    accent-color: var(--ehq-primary);
}

.erh-wizard-choice:has(input:checked),
.erh-wizard-choice.is-selected {
    border-color: var(--ehq-primary);
    background: rgba(15, 107, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(15, 107, 255, 0.1);
}

.erh-wizard-choice-icon {
    font-size: 1.5rem;
    color: var(--ehq-primary);
    margin-bottom: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
}

.erh-wizard-choice-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ehq-text);
    margin-bottom: 0.25rem;
}

.erh-wizard-choice-desc {
    display: block;
    font-size: 0.85rem;
    color: var(--ehq-text-muted);
    line-height: 1.45;
}

/* Field grid */
.erh-wizard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 1rem;
    margin: 0 0 1.5rem;
}

.erh-wizard-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.erh-wizard-field.erh-wizard-field-full {
    grid-column: 1 / -1;
}

.erh-wizard-field label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ehq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.erh-wizard-field input,
.erh-wizard-field select,
.erh-wizard-field textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.92rem;
    color: var(--ehq-text);
    background: #fff;
    font-family: inherit;
    transition: border-color 120ms, box-shadow 120ms;
}

.erh-wizard-field input:focus,
.erh-wizard-field select:focus,
.erh-wizard-field textarea:focus {
    outline: none;
    border-color: var(--ehq-primary);
    box-shadow: 0 0 0 3px rgba(15, 107, 255, 0.15);
}

/* Split participants table */
.erh-wizard-split-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 0 1rem;
    border: 1px solid var(--ehq-border);
    border-radius: 10px;
    overflow: hidden;
}

.erh-wizard-split-table th {
    background: #f8fafc;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ehq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--ehq-border);
}

.erh-wizard-split-table td {
    padding: 0.5rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.erh-wizard-split-table tr:last-child td {
    border-bottom: 0;
}

.erh-wizard-split-table select,
.erh-wizard-split-table input {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
}

.erh-wizard-payee-name {
    margin-top: 0.25rem;
    font-size: 0.78rem !important;
    background: #f8fafc !important;
}

.erh-wizard-remove-line {
    background: transparent;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background-color 120ms, color 120ms;
}

.erh-wizard-remove-line:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.erh-wizard-split-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 1.5rem;
}

.erh-wizard-split-total {
    font-size: 0.95rem;
    color: var(--ehq-text);
}

.erh-wizard-split-total strong {
    font-size: 1.25rem;
    color: var(--ehq-primary);
    margin: 0 0.5rem;
    font-variant-numeric: tabular-nums;
}

.erh-wizard-split-total small {
    color: #94a3b8;
    font-size: 0.78rem;
}

/* Review */
.erh-wizard-review {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1rem;
    margin: 0 0 1.25rem;
}

.erh-wizard-review dt {
    font-weight: 700;
    color: var(--ehq-text-muted);
    font-size: 0.85rem;
}

.erh-wizard-review dd {
    margin: 0;
    color: var(--ehq-text);
}

.erh-wizard-review-lines {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.erh-wizard-review-lines li {
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--ehq-primary);
    background: rgba(15, 107, 255, 0.04);
    margin-bottom: 0.4rem;
    border-radius: 0 6px 6px 0;
    color: var(--ehq-text);
}

.erh-wizard-review-total {
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.5rem 0;
}

.erh-wizard-review-total.is-ok { color: #0d8a5e; }
.erh-wizard-review-total.is-bad { color: #dc2626; }

.erh-wizard-review-mode {
    font-size: 0.9rem;
    color: var(--ehq-text-muted);
    padding-top: 0.5rem;
    border-top: 1px solid var(--ehq-border);
}

/* Action bar */
.erh-wizard-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ehq-border);
}

.erh-wizard-actions .erh-front-button.is-primary {
    margin-left: auto;
}

/* Recovery section */
.erh-wizard-recovery-method {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--ehq-border);
    border-radius: 10px;
}

/* — END §37 — */

/* ════════════════════════════════════════════════════════════════════
   §38 — UTILITY CLASSES (v0.4.10 — for inline-style removal)
   ════════════════════════════════════════════════════════════════════
   Functional CSS utilities to replace common inline style="…" patterns
   in plugin PHP. Limited to spacing/alignment/dynamic-data primitives —
   not a general utility framework.
   ──────────────────────────────────────────────────────────────────── */

/* Margin top — uses --ehq-space-* tokens */
.u-mt-0 { margin-top: 0 !important; }
.u-mt-1 { margin-top: var(--ehq-space-1); }
.u-mt-2 { margin-top: var(--ehq-space-2); }
.u-mt-3 { margin-top: var(--ehq-space-3); }
.u-mt-4 { margin-top: var(--ehq-space-4); }
.u-mt-5 { margin-top: var(--ehq-space-5); }
.u-mt-6 { margin-top: var(--ehq-space-6); }
.u-mt-8 { margin-top: var(--ehq-space-8); }
.u-my-2 {
    margin-top: var(--ehq-space-2);
    margin-bottom: var(--ehq-space-2);
}

/* Margin bottom */
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-1 { margin-bottom: var(--ehq-space-1); }
.u-mb-2 { margin-bottom: var(--ehq-space-2); }
.u-mb-3 { margin-bottom: var(--ehq-space-3); }
.u-mb-4 { margin-bottom: var(--ehq-space-4); }
.u-mb-5 { margin-bottom: var(--ehq-space-5); }
.u-mb-6 { margin-bottom: var(--ehq-space-6); }

/* Margin left */
.u-ml-2 { margin-left: var(--ehq-space-2); }
.u-ml-3 { margin-left: var(--ehq-space-3); }

/* Padding */
.u-p-2 { padding: var(--ehq-space-2); }
.u-p-3 { padding: var(--ehq-space-3); }
.u-p-4 { padding: var(--ehq-space-4); }
.u-py-3 { padding-block: var(--ehq-space-3); }

/* Text alignment */
.u-text-center { text-align: center; }
.u-text-right  { text-align: right; }
.u-text-left   { text-align: left; }

/* Visibility — prefer hidden attribute, but class works too */
.u-hidden { display: none !important; }

.erh-render-context .erh-toolbar-title {
    margin: 0 auto 0 0;
}
.erh-render-context .erh-toolbar-tight {
    margin-top: calc(var(--ehq-space-2) * -1);
}
.erh-render-context .erh-drawer-action-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.erh-render-context .erh-kpi-label-spaced {
    margin-top: var(--ehq-space-2);
}
.erh-render-context .erh-inline-filter {
    margin-bottom: var(--ehq-space-4);
}
.erh-render-context .erh-input-user-id {
    width: 96px;
}
.erh-render-context .erh-input-isrc-prefix {
    width: 120px;
}
.erh-render-context .erh-payee-diagnostics {
    margin-top: 18px;
    padding: 14px;
    border: 1px dashed #b8c4d9;
    border-radius: var(--ehq-radius-sm, 6px);
    background: var(--ehq-surface, #fff);
}
.erh-render-context .erh-payee-diagnostics-title {
    margin: 0 0 var(--ehq-space-2);
    font-size: 14px;
}
.erh-render-context .erh-payee-diagnostics-note {
    margin: 0 0 var(--ehq-space-3);
    font-size: 12px;
}
.erh-render-context .erh-payee-diagnostics-summary {
    margin: 0 0 10px;
}
.erh-render-context tr.is-duplicate {
    background: #fff8e6;
}
.erh-render-context .erh-sql-recipe {
    margin-top: 14px;
}
.erh-render-context .erh-clickable-summary {
    cursor: pointer;
    font-weight: 600;
}
.erh-render-context .ehq-code-block {
    background: var(--ehq-surface-alt, #f1f5fb);
    padding: var(--ehq-space-3, 12px);
    border-radius: var(--ehq-radius-sm, 6px);
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
}
.erh-render-context .ehq-code-block.is-dark {
    background: #0e1a36;
    color: #cbd5e1;
}

/* Overflow */
.u-overflow-x-auto { overflow-x: auto; }

/* Width helpers — keep dynamic data using CSS custom properties */
/* Usage: <div class="u-bar-fill" style="--bar-width: 60%"></div>
   Width is set via the --bar-width custom property which IS dynamic data,
   and is the legitimate exception to the no-inline-style rule. */
.u-bar-fill { width: var(--bar-width, 0%); height: 100%; }
.u-bar-height { height: var(--bar-height, 0%); width: 100%; }

/* — END §38 — */

/* ──────────────────────────────────────────────────────────────────────
   39 — Live audit polish: dense tables and money lines
   Keeps status/action cells stable in Distribution work tables.
   ────────────────────────────────────────────────────────────────────── */
.erh-render-context .erh-status-badge,
.erh-render-context .erh-badge,
.erh-render-context .badge,
.ehq-v2 .erh-status-badge {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    line-height: 1.05;
    min-width: 4.75em;
    text-align: center;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

.erh-render-context :is(.erh-table, .ehq-table) td:has(> .erh-status-badge),
.erh-render-context :is(.erh-table, .ehq-table) td:has(> .erh-badge),
.erh-render-context :is(.erh-table, .ehq-table) td:has(> .badge) {
    width: 1%;
    white-space: nowrap !important;
}

.erh-render-context :is(.erh-table, .ehq-table) th:last-child,
.erh-render-context :is(.erh-table, .ehq-table) td:last-child {
    width: 1%;
    white-space: nowrap !important;
}

.erh-render-context :is(.erh-table, .ehq-table) :is(td, th).num,
.erh-render-context :is(.erh-table, .ehq-table) :is(td, th).is-number {
    white-space: nowrap !important;
}

.erh-render-context input[type="date"] {
    min-width: 148px;
}

.erh-render-context .erh-card strong .erh-money-lines,
.erh-render-context .ehq-card strong .erh-money-lines {
    display: grid;
    gap: 3px;
    line-height: 1.08;
    max-width: 100%;
    white-space: normal !important;
}

.erh-render-context .erh-card strong .erh-money-lines span,
.erh-render-context .ehq-card strong .erh-money-lines span {
    display: block;
    overflow-wrap: anywhere;
    word-break: normal;
}

.erh-render-context .erh-token-list {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    gap: 4px;
    max-width: 100%;
}

.erh-render-context .erh-stack-list {
    display: grid;
    gap: 4px;
    max-width: 100%;
}

.erh-render-context .erh-token {
    align-items: center;
    background: rgba(255, 210, 48, 0.1);
    border: 1px solid rgba(255, 210, 48, 0.28);
    border-radius: 999px;
    color: var(--ehq-text, #f5f7fb);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
    line-height: 1;
    min-height: 26px;
    padding: 5px 8px;
    white-space: nowrap;
}

.erh-render-context .erh-stack-list span {
    display: block;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
}

.erh-render-context .erh-file-cell,
.erh-render-context .erh-progress-cell,
.erh-render-context .erh-date-cell {
    line-height: 1.25;
}

.erh-render-context .erh-file-name,
.erh-render-context .erh-progress-cell span {
    display: block;
}

.erh-render-context .erh-file-cell small,
.erh-render-context .erh-progress-cell small {
    color: var(--ehq-text-muted, #8a94a8);
    display: block;
    margin-top: 4px;
    white-space: nowrap;
}

.erh-render-context .erh-id-cell,
.erh-render-context .erh-date-cell {
    white-space: nowrap !important;
}

.erh-render-context .erh-mapping-batches-table {
    min-width: 1460px;
    table-layout: fixed;
}

.erh-render-context .erh-mapping-batches-table .col-check { width: 48px; }
.erh-render-context .erh-mapping-batches-table .col-batch { width: 78px; }
.erh-render-context .erh-mapping-batches-table .col-file { width: 250px; }
.erh-render-context .erh-mapping-batches-table .col-status { width: 132px; }
.erh-render-context .erh-mapping-batches-table .col-rows { width: 92px; }
.erh-render-context .erh-mapping-batches-table .col-mapped { width: 138px; }
.erh-render-context .erh-mapping-batches-table .col-unmatched,
.erh-render-context .erh-mapping-batches-table .col-suspense { width: 104px; }
.erh-render-context .erh-mapping-batches-table .col-income { width: 124px; }
.erh-render-context .erh-mapping-batches-table .col-created { width: 156px; }
.erh-render-context .erh-mapping-batches-table .col-action { width: 340px; }

.erh-render-context .erh-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.erh-render-context .erh-table-actions .ehq-btn {
    white-space: nowrap;
}

.erh-render-context .erh-revenue-total-card {
    align-items: flex-start;
}

.erh-render-context .erh-revenue-total-card .erh-money-lines.is-compact {
    display: grid;
    gap: 4px;
}

.erh-render-context .erh-money-breakdown {
    margin-top: 10px;
    font-size: 0.86rem;
    color: var(--ehq-muted);
}

.erh-render-context .erh-money-breakdown summary {
    cursor: pointer;
    color: var(--ehq-accent);
    font-weight: 700;
}

.erh-render-context .erh-money-breakdown .erh-money-lines {
    margin-top: 8px;
    display: grid;
    gap: 3px;
    font-size: 0.86rem;
}

.erh-render-context .erh-mapping-batches-table .col-file {
    overflow-wrap: anywhere;
    white-space: normal !important;
}

.erh-render-context .erh-audit-toolbar {
    display: grid !important;
    grid-template-columns: minmax(148px, 0.55fr) minmax(148px, 0.55fr) minmax(110px, 0.4fr) minmax(190px, 0.8fr) auto auto auto;
}

.erh-render-context .erh-audit-toolbar label,
.erh-render-context .erh-audit-toolbar input,
.erh-render-context .erh-audit-toolbar select {
    min-width: 0;
}

.erh-render-context .erh-audit-table {
    min-width: 1180px;
    table-layout: fixed;
}

.erh-render-context .erh-audit-table .col-id { width: 76px; }
.erh-render-context .erh-audit-table .col-when { width: 148px; }
.erh-render-context .erh-audit-table .col-user { width: 72px; }
.erh-render-context .erh-audit-table .col-action { width: 160px; }
.erh-render-context .erh-audit-table .col-target { width: 170px; }
.erh-render-context .erh-audit-table .col-details {
    width: auto !important;
    white-space: normal !important;
}

.erh-render-context .erh-audit-table .erh-action-token {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.erh-render-context .erh-audit-table .erh-compact-lines div {
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.erh-render-context .erh-duplicates-grid {
    align-items: start;
}

.erh-render-context .erh-duplicate-table {
    min-width: 760px;
    table-layout: fixed;
}

.erh-render-context .erh-duplicate-table .erh-field-duplicate_key { width: 18%; }
.erh-render-context .erh-duplicate-table .erh-field-ids { width: 132px; }
.erh-render-context .erh-duplicate-table .erh-field-names { width: 25%; }
.erh-render-context .erh-duplicate-table .erh-field-count_rows { width: 86px; }
.erh-render-context .erh-duplicate-table .erh-duplicate-actions-cell { width: 260px !important; }

.erh-render-context .erh-fuzzy-duplicate-table .erh-field-artist-a,
.erh-render-context .erh-fuzzy-duplicate-table .erh-field-artist-b {
    width: 22%;
}

.erh-render-context .erh-fuzzy-duplicate-table .erh-field-distance,
.erh-render-context .erh-fuzzy-duplicate-table .erh-field-tracks-a,
.erh-render-context .erh-fuzzy-duplicate-table .erh-field-tracks-b {
    width: 82px;
}

.erh-render-context .erh-duplicate-table .erh-field-duplicate_key,
.erh-render-context .erh-duplicate-table .erh-field-names,
.erh-render-context .erh-fuzzy-duplicate-table .erh-field-artist-a,
.erh-render-context .erh-fuzzy-duplicate-table .erh-field-artist-b {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere;
}

.erh-render-context .erh-duplicate-table .erh-field-count_rows,
.erh-render-context .erh-duplicate-table .erh-field-distance,
.erh-render-context .erh-duplicate-table .erh-field-tracks-a,
.erh-render-context .erh-duplicate-table .erh-field-tracks-b {
    text-align: center;
    white-space: nowrap !important;
}

.erh-render-context .erh-duplicate-table .erh-duplicate-actions-cell {
    white-space: normal !important;
}

.erh-render-context .erh-duplicate-table .erh-duplicate-actions-cell .erh-actions {
    align-items: stretch;
    display: grid;
    gap: 6px;
    grid-template-columns: 1fr;
}

.erh-render-context .erh-duplicate-table .erh-duplicate-actions-cell .ehq-btn {
    justify-content: center;
    min-height: 36px;
    padding-inline: 10px;
    width: 100%;
}

@media (max-width: 900px) {
    .erh-render-context .erh-audit-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .erh-render-context .erh-audit-toolbar > .ehq-btn,
    .erh-render-context .erh-audit-toolbar > .btn,
    .erh-render-context .erh-audit-toolbar > button,
    .erh-render-context .erh-audit-toolbar > a {
        width: 100%;
    }
}

/* Distribution admin polish: stable action rows, visible hover states, and clear loading affordances. */
body .erh-render-context .ehq-table-wrap,
body .erh-render-context .erh-table-scroll {
    overflow-x: auto !important;
    width: 100% !important;
}

body .erh-render-context :is(.ehq-table, .erh-table) {
    min-width: 760px;
}

body .erh-render-context td > .erh-actions,
body .erh-render-context td.erh-actions-cell,
body .erh-render-context td > .erh-actions-cell {
    align-items: center !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

body .erh-render-context td > .erh-actions .ehq-btn,
body .erh-render-context td.erh-actions-cell .ehq-btn,
body .erh-render-context td > .erh-actions-cell .ehq-btn {
    flex: 0 0 auto !important;
    font-size: 12px !important;
    min-height: 30px !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
}

body .erh-render-context :is(.ehq-btn, .ehq-button, button, input[type="button"], input[type="submit"]):hover,
body .erh-drawer-shell :is(.ehq-btn, button):hover,
body .erh-modal :is(.ehq-btn, button):hover {
    border-color: var(--ehq3-primary, var(--ehq-primary, #f2cf2f)) !important;
    box-shadow: 0 0 0 3px rgba(242, 207, 47, 0.2) !important;
    filter: brightness(1.08);
    transform: translateY(-1px);
}

body .erh-render-context :is(.ehq-btn, .ehq-button, button, input[type="button"], input[type="submit"]):focus-visible,
body .erh-drawer-shell :is(.ehq-btn, button):focus-visible,
body .erh-modal :is(.ehq-btn, button):focus-visible {
    outline: 2px solid var(--ehq3-primary, var(--ehq-primary, #f2cf2f)) !important;
    outline-offset: 2px !important;
}

body .erh-render-context :is(.ehq-btn, .ehq-button, button, input[type="button"], input[type="submit"]):disabled,
body .erh-drawer-shell :is(.ehq-btn, button):disabled,
body .erh-modal :is(.ehq-btn, button):disabled {
    cursor: wait !important;
    opacity: 0.68 !important;
}

body .erh-statement-payments {
    margin: 18px 0 16px !important;
}

body .erh-statement-payments h3 {
    font-size: 14px !important;
    margin: 0 0 10px !important;
}

/* ──────────────────────────────────────────────────────────────────────
   40 — REDUCED MOTION (v0.4.17 polish — a11y)
   Honours the OS "reduce motion" setting. Neutralises non-essential
   transitions/animations across the v2 design system. Opacity-only
   keyframes (fades) are left intact as they are not vestibular triggers.
   ────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .erh-render-context *,
    .erh-render-context *::before,
    .erh-render-context *::after,
    .ehq-v2 *,
    .ehq-v2 *::before,
    .ehq-v2 *::after,
    .erh-drawer-shell,
    .erh-drawer-shell *,
    .erh-modal,
    .erh-modal *,
    .erh-toast,
    .erh-toast * {
        animation-duration: 0.01ms !important; /* !important: beats per-element transition declarations */
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* End e-HQ v2 theme — v0.4.17 polish */
