/*
 * Neurocity Pay design tokens (--np-*).
 * Change neurocity-pay-rebrand, slice F0. Single source for colour, type and
 * radius tokens consumed by admin-theme.css (F1) and the webviews (F3).
 * Fonts load from Google Fonts in partials/np_head.html; no @font-face here
 * (the CSP font-src does not allow 'self' or data:).
 * --np-brand (#00C060) is a fill only: never use it as text colour on light
 * surfaces (TOK-004); success text uses --np-ok.
 */

:root {
  --np-bg: #F4F4F5;
  --np-surface: #FFFFFF;
  --np-surface-2: #FAFAFA;
  --np-ink: #0A0A0B;
  --np-ink-2: #3F3F46;
  --np-muted: #6B6B74;
  --np-line: #E4E4E7;
  --np-line-2: #D4D4D8;
  --np-line-ctl: #8A8A93;
  --np-btn: #0A0A0B;
  --np-btn-fg: #FFFFFF;
  --np-btn-hover: #27272A;
  --np-brand: #00C060;
  --np-ok: #007A43;
  --np-ok-bg: #E6F7EE;
  --np-warn: #B45309;
  --np-warn-bg: #FEF3C7;
  --np-err: #B91C1C;
  --np-err-bg: #FEE2E2;
  --np-rev: #6D28D9;
  --np-rev-bg: #EDE9FE;
  --np-info: #2563EB;
  --np-cancel-bg: #F4F4F5;
  --np-focus: #2563EB;

  --np-ink-900: #18181B;
  --np-ink-800: #27272A;
  --np-ink-700: #3F3F46;
  --np-ink-600: #52525B;
  --np-ink-500: #71717A;
  --np-ink-400: #A1A1AA;

  --np-ink-rgb: 10, 10, 11;
  --np-ok-rgb: 0, 122, 67;
  --np-warn-rgb: 180, 83, 9;
  --np-err-rgb: 185, 28, 28;
  --np-info-rgb: 37, 99, 235;

  --np-f-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --np-f-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --np-f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --np-r-ctl: 8px;
  --np-r-card: 12px;
  --np-r-badge: 999px;

  --np-shadow-sm: 0 1px 2px rgba(10, 10, 11, 0.06);
  --np-shadow-md: 0 4px 16px rgba(10, 10, 11, 0.08);
  --np-transition: 160ms ease;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --np-bg: #0A0A0B;
    --np-surface: #111113;
    --np-surface-2: #18181B;
    --np-ink: #FAFAFA;
    --np-ink-2: #D4D4D8;
    --np-muted: #A1A1AA;
    --np-line: #27272A;
    --np-line-2: #3F3F46;
    --np-line-ctl: #71717A;
    --np-btn: #FAFAFA;
    --np-btn-fg: #0A0A0B;
    --np-btn-hover: #E4E4E7;
    --np-brand: #00C060;
    --np-ok: #34D399;
    --np-ok-bg: rgba(0, 192, 96, 0.14);
    --np-warn: #FBBF24;
    --np-warn-bg: rgba(251, 191, 36, 0.12);
    --np-err: #F87171;
    --np-err-bg: rgba(248, 113, 113, 0.12);
    --np-rev: #A78BFA;
    --np-rev-bg: rgba(167, 139, 250, 0.14);
    --np-info: #60A5FA;
    --np-cancel-bg: #27272A;
    --np-focus: #60A5FA;
    --np-ink-rgb: 250, 250, 250;
    --np-ok-rgb: 52, 211, 153;
    --np-warn-rgb: 251, 191, 36;
    --np-err-rgb: 248, 113, 113;
    --np-info-rgb: 96, 165, 250;
    --np-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --np-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  }
}

/* Reserved for a future admin dark mode (D17); must stay identical to the block above. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --np-bg: #0A0A0B;
  --np-surface: #111113;
  --np-surface-2: #18181B;
  --np-ink: #FAFAFA;
  --np-ink-2: #D4D4D8;
  --np-muted: #A1A1AA;
  --np-line: #27272A;
  --np-line-2: #3F3F46;
  --np-line-ctl: #71717A;
  --np-btn: #FAFAFA;
  --np-btn-fg: #0A0A0B;
  --np-btn-hover: #E4E4E7;
  --np-brand: #00C060;
  --np-ok: #34D399;
  --np-ok-bg: rgba(0, 192, 96, 0.14);
  --np-warn: #FBBF24;
  --np-warn-bg: rgba(251, 191, 36, 0.12);
  --np-err: #F87171;
  --np-err-bg: rgba(248, 113, 113, 0.12);
  --np-rev: #A78BFA;
  --np-rev-bg: rgba(167, 139, 250, 0.14);
  --np-info: #60A5FA;
  --np-cancel-bg: #27272A;
  --np-focus: #60A5FA;
  --np-ink-rgb: 250, 250, 250;
  --np-ok-rgb: 52, 211, 153;
  --np-warn-rgb: 251, 191, 36;
  --np-err-rgb: 248, 113, 113;
  --np-info-rgb: 96, 165, 250;
  --np-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --np-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ---- Utilities ---------------------------------------------------------- */

.np-num {
  font-variant-numeric: tabular-nums;
}

.np-mono {
  font-family: var(--np-f-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.np-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.65em;
  border-radius: var(--np-r-badge);
  font-family: var(--np-f-body);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.np-badge .bi {
  font-size: 0.95em;
  line-height: 1;
}

.np-badge--ok {
  color: var(--np-ok);
  background: var(--np-ok-bg);
}

.np-badge--warn {
  color: var(--np-warn);
  background: var(--np-warn-bg);
}

.np-badge--err {
  color: var(--np-err);
  background: var(--np-err-bg);
}

.np-badge--rev {
  color: var(--np-rev);
  background: var(--np-rev-bg);
}

/* --np-cancel-bg equals --np-bg, so on grey/striped rows only the edge
   (--np-line-ctl, >= 3:1 on bg and surface) outlines the pill. */
.np-badge--cancel {
  color: var(--np-ink-2);
  background: var(--np-cancel-bg);
  box-shadow: inset 0 0 0 1px var(--np-line-ctl);
}

.np-badge--neutral {
  color: var(--np-ink-2);
  background: var(--np-surface-2);
  box-shadow: inset 0 0 0 1px var(--np-line-ctl);
}

.np-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--np-r-ctl);
  background: var(--np-btn);
  color: var(--np-btn-fg);
  font-family: var(--np-f-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.np-processed-by {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--np-muted);
  font-family: var(--np-f-body);
  font-size: 0.75rem;
}

.np-processed-by img {
  display: block;
  height: 16px;
  width: auto;
}

.np-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--np-line-2);
  border-radius: var(--np-r-ctl);
  background: var(--np-surface);
  color: var(--np-ink-2);
  line-height: 1;
  transition: background-color var(--np-transition), color var(--np-transition);
}

.np-copy:hover {
  background: var(--np-surface-2);
  color: var(--np-ink);
}

:focus-visible {
  outline: 2px solid var(--np-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .np-copy,
  .np-badge {
    transition: none !important;
  }
}
