/* ============================================================
   945 CLUB — ADMIN TEXT CONTRAST LAYER
   Loaded last, after admin.css and admin-brutalist.css.

   When the panel moved from a dark ground to the storefront's white, the
   --admin-* tokens were repointed but 24 hardcoded #fff colours and several
   translucent rgba(255,255,255,.08) fills in admin.css bypass tokens entirely.
   On dark they worked; on white they collapse. Measured on the live Products
   view before this file existed:

     .btn-adm.secondary   white on rgba(255,255,255,.08)   ratio 1.00  invisible
     .adm-badge.published #0071e3 on rgba(0,113,227,.15)   ratio 1.00  invisible
     .adm-badge.out_of_stock                               ratio 1.73
     .adm-nav-badge "Auto"                                 ratio 2.02
     .adm-badge.in_stock                                   ratio 2.71

   Separately, 28 places used --admin-primary as a TEXT colour. On dark that read
   as an accent; on white it reads as an unstyled link, which is why product model
   names appeared blue in the product table.

   Rules applied here:
     1. Body text is ink. Blue is reserved for focus rings and real links.
     2. No translucent white fills -- brutalism wants solid blocks and hard rules.
     3. Status colour lives in the BORDER and the text, on a white ground, so a
        badge still reads at a glance without dropping below 4.5:1.
   ============================================================ */

/* --- 1. Text is ink, everywhere it was blue purely for emphasis -------------
   Inline style="color:var(--admin-primary)" in js/admin.js templates and
   admin.html cannot be reached by a normal rule, so these are !important. They
   are emphasis, not links: model numbers, order numbers, counts, resources. */
.admin-table td strong[style*="--admin-primary"],
.admin-table td span[style*="--admin-primary"],
.admin-table td [style*="color:var(--admin-primary)"],
.table-prod-info h4,
.table-prod-info strong,
.table-prod-cell strong {
  color: var(--ink-primary) !important;
}

/* Model line under a product name is secondary information, not a link. */
.table-prod-cell span[style*="--admin-primary"] {
  color: var(--ink-secondary) !important;
  font-weight: 600 !important;
}

/* Anything else that inherited white text on the now-white ground. */
.admin-user-name,
.sidebar-logo,
.kpi-val,
.image-dropzone-text,
.modal-head-adm h3,
.panel-title,
.admin-table td,
.size-stock-card span {
  color: var(--ink-primary);
}
.admin-user-role,
.kpi-sub,
.kpi-label,
.image-dropzone-sub,
.table-prod-info span {
  color: var(--ink-secondary);
}

/* --- 2. Secondary buttons: solid outline, never a translucent white fill ---- */
.btn-adm.secondary,
.btn-adm.secondary.sm,
.gallery-btn-primary,
.gallery-btn-del {
  background: var(--surface-primary) !important;
  color: var(--ink-primary) !important;
  border: 2px solid var(--ink-primary) !important;
}
.btn-adm.secondary:hover,
.gallery-btn-primary:hover,
.gallery-btn-del:hover {
  background: var(--surface-secondary) !important;
  color: var(--ink-primary) !important;
}
/* Destructive stays legible: white on a solid red block, not red on a red tint. */
.btn-adm.danger,
.gallery-btn-del:hover {
  background: var(--admin-danger) !important;
  color: #ffffff !important;
  border-color: var(--ink-primary) !important;
}

/* --- 3. Badges: white ground, coloured 2px border, coloured ink -------------
   All four combinations below clear 4.5:1 on #ffffff:
     #007a33 green  6.19 : 1
     #8a5300 amber  6.24 : 1
     #c8102e red    6.55 : 1
     #111113 ink   19.30 : 1                                                  */
.adm-badge,
.badge-adm,
.adm-nav-badge {
  background: var(--surface-primary) !important;
  border: 2px solid currentColor !important;
  font-weight: 800;
}
.adm-badge.in_stock      { color: #007a33 !important; }
.adm-badge.low_stock     { color: #8a5300 !important; }
.adm-badge.out_of_stock  { color: #c8102e !important; }
.adm-badge.published     { color: var(--ink-primary) !important; }
.adm-badge.draft,
.adm-badge.hidden        { color: var(--ink-secondary) !important; }

/* Sidebar count chips sit on white; on the active (ink) row they invert. */
.adm-nav-badge { color: var(--ink-primary) !important; }
.adm-nav-link.active .adm-nav-badge {
  background: var(--ink-primary) !important;
  color: var(--surface-primary) !important;
  border-color: var(--surface-primary) !important;
}

/* The "Auto" chip was white on #30d158 (2.02:1). Same treatment. */
.adm-nav-badge[style*="30d158"],
.adm-nav-badge.auto {
  background: var(--surface-primary) !important;
  color: #007a33 !important;
  border-color: #007a33 !important;
}

/* --- 4. Blue is for interaction only ---------------------------------------- */
.panel-link,
a.adm-link,
.modal-tab-btn.active {
  color: var(--blue);
}
.modal-tab-btn.active {
  background: var(--ink-primary);
  color: var(--surface-primary);
}

/* --- 5. Regressions caught by re-measuring after writing rule 3 --------------
   The blanket .badge-adm rule above set a white background on the sidebar's ADMIN
   chip, whose text admin-brutalist.css had already set to white -- white on white,
   ratio 1.00. It is a solid ink block by design, so exempt it explicitly. */
.sidebar-logo .badge-adm {
  background: var(--ink-primary) !important;
  color: var(--surface-primary) !important;
  border-color: var(--ink-primary) !important;
}

/* The colourway label in the product table is built in js/admin.js with a
   hardcoded color:#fff, which no token repoint could reach. */
.table-prod-cell span[style*="#fff"],
.admin-table td span[style*="color:#fff"] {
  color: var(--ink-primary) !important;
}
