/* ─────────────────────────────────────────────────────────────────────
   Admin Charts — espresso/gold dark override.
   admin-charts-light.css builds the entire clinical-records UI from --acl-*
   design tokens. Remapping those tokens here (loaded LAST) flips the whole
   app to the maison espresso/gold theme without touching any component rule.
   ───────────────────────────────────────────────────────────────────── */

:root {
  /* surfaces */
  --acl-bg-1: #0F0B07 !important;
  --acl-bg-2: #141009 !important;
  --acl-bg-3: #1A130B !important;
  --acl-card: #1A130B !important;            /* was #FFFFFF white cards */
  --acl-rule: rgba(255,255,255,0.08) !important;
  --acl-rule-strong: rgba(255,255,255,0.14) !important;   /* de-gold: neutral rule (was gold) */
  /* text */
  --acl-text: #F3E9D6 !important;
  --acl-dim: rgba(243,233,214,0.80) !important;
  --acl-mut: rgba(243,233,214,0.55) !important;
  /* indigo/cyan accents → neutral (gold ban; match the dashboard's restraint).
     Text/labels use a muted warm tan like the dashboard section labels; fills,
     tints and rules go neutral white-translucent. */
  --acl-blue: #C8BFB0 !important;                         /* muted tan labels (was bright gold) */
  --acl-blue-deep: #EEE9DF !important;                    /* near-white emphasis (was gold) */
  --acl-cyan: #C8BFB0 !important;
  --acl-blue-tint: rgba(255,255,255,0.06) !important;     /* neutral selected/hover bg */
  --acl-blue-tint-2: rgba(255,255,255,0.10) !important;
  --acl-blue-rule: rgba(255,255,255,0.14) !important;     /* neutral accent bars/borders */
  /* semantic colors — lifted for contrast on the dark ground */
  --acl-green: #70C97D !important;
  --acl-green-tint: rgba(74,166,90,0.14) !important;
  --acl-amber: #D4A93C !important;
  --acl-amber-tint: rgba(200,160,60,0.16) !important;
  --acl-red: #E58A8A !important;
  --acl-red-tint: rgba(200,80,80,0.14) !important;
  /* shadows go deep instead of soft-grey */
  --acl-shadow-soft: 0 12px 32px rgba(0,0,0,0.40) !important;
  --acl-shadow-lift: 0 18px 44px rgba(0,0,0,0.55) !important;
}

/* page ground (body bg gradient also derives from the tokens, but assert it) */
body {
  background: linear-gradient(180deg, #0F0B07 0%, #141009 50%, #0B0805 100%) !important;
  color: #F3E9D6 !important;
  -webkit-text-fill-color: #F3E9D6 !important;
}

/* Stragglers — hardcoded #FFFFFF text that sat on the indigo/cyan accent
   (now gold). On gold, white reads poorly → switch to dark ink. These are the
   exact accent buttons/badges from admin-charts-light.css. */
#loginGate .btn-gold,
body .filter-pill.active,
body .btn-print-chart,
body .btn-save,
body .btn-pending-create,
body .chart-card-avatar-badge,
body [class*="-badge"] {
  color: #2A1808 !important;
  -webkit-text-fill-color: #2A1808 !important;
}
/* De-gold the loud accent FILL buttons + active filter pill → neutral
   white-frost, matching the dashboard's primary buttons (no gold gradient).
   These previously took dark ink (#2A1808) because they sat on gold; on the
   white-frost ground they read with the normal off-white text. */
@media screen {
  body .btn-print-chart,
  body .btn-save,
  body .btn-pending-create {
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.24) !important;
    color: #F3E9D6 !important;
    -webkit-text-fill-color: #F3E9D6 !important;
    box-shadow: none !important;
  }
  body .btn-print-chart:hover,
  body .btn-save:hover,
  body .btn-pending-create:hover {
    background: rgba(255,255,255,0.18) !important;
    border-color: rgba(255,255,255,0.40) !important;
  }
  body .filter-pill.active {
    background: rgba(255,255,255,0.14) !important;
    border-color: rgba(255,255,255,0.32) !important;
    color: #F3E9D6 !important;
    -webkit-text-fill-color: #F3E9D6 !important;
  }
}

/* destructive action keeps a clear red ground with light ink */
body .btn-confirm-delete {
  background: rgba(190,70,70,0.92) !important;
  color: #FFF3F0 !important;
  -webkit-text-fill-color: #FFF3F0 !important;
}
/* screen (non-print) white panels → dark glass; print stays white (untouched) */
@media screen {
  body [style*="background:#FFFFFF"],
  body [style*="background: #FFFFFF"] { background: var(--acl-card) !important; }
}

/* Defensive: the chart JS injects rows/notes with inline light-theme colors.
   Catch the common ones inside the records shell (screen only, print stays light). */
@media screen {
  #adminContent [style*="color:#1A1F2E"], #adminContent [style*="color: #1A1F2E"],
  #adminContent [style*="color:#1a1f2e"] { color: var(--acl-text) !important; -webkit-text-fill-color: var(--acl-text) !important; }
  #adminContent [style*="color:rgba(26,31,46"] { color: var(--acl-mut) !important; }
  #adminContent [style*="color:#2A3FA8"], #adminContent [style*="color:#1E2D7A"],
  #adminContent [style*="color:#2EB6E0"] { color: var(--acl-blue) !important; }
  #adminContent [style*="background:#fff"], #adminContent [style*="background: #fff"],
  #adminContent [style*="background:#FFF"], #adminContent [style*="background: #FFF"],
  #adminContent [style*="background:#F8F5EE"], #adminContent [style*="background:#EDECEA"],
  #adminContent [style*="background:#E5E4E2"] { background: var(--acl-card) !important; border-color: var(--acl-rule) !important; }
  #adminContent [style*="background:rgba(42,63,168"] { background: var(--acl-blue-tint) !important; }
}
