/* ============================================================
   Concierge Desk extensions
   ------------------------------------------------------------
   Semantic --ha-* vars for the dense ops surface. Each is either
   a reference to an existing base token from colors_and_type.css,
   or an rgba() of an EXISTING base color's own rgb channels at a
   lower alpha (the same color at alpha, not a new color). The
   annotated rgba derivations:
     navy  20,60,85   = --ha-blue-primary  (#143C55)
     accent 45,133,255 = --ha-blue-accent  (#2D85FF)
     danger 197,16,38 = --ha-danger        (#C51026)
     success 13,150,152 = --ha-success      (#0D9698)
   No new raw colors are introduced.
   ============================================================ */
:root {
  /* Funnel status-pill set — one per Job status, each an existing token. */
  --ha-status-new: var(--ha-ink-muted);
  --ha-status-contacted: var(--ha-blue-muted);
  --ha-status-collecting: var(--ha-blue-muted);
  --ha-status-ready: var(--ha-blue-text);
  --ha-status-offered: var(--ha-blue-primary-soft);
  --ha-status-quoted: var(--ha-blue-primary-soft);
  --ha-status-presented: var(--ha-blue-accent);
  --ha-status-accepted: var(--ha-success);
  --ha-status-scheduled: var(--ha-success);
  --ha-status-fulfilled: var(--ha-blue-primary);
  --ha-status-onhold: var(--ha-ink-muted);
  --ha-status-lost: var(--ha-danger);

  /* Queue-row states (rgba of existing base channels). */
  --ha-row-hover: rgba(20, 60, 85, 0.04);     /* navy base at 4% */
  --ha-row-selected: rgba(45, 133, 255, 0.08); /* accent base at 8% */
  --ha-row-stale: rgba(197, 16, 38, 0.06);     /* danger base at 6% */
  --ha-row-stripe: rgba(20, 60, 85, 0.035);   /* navy base at 3.5% — zebra band */

  /* Reply-state. */
  --ha-reply-substantive: var(--ha-success);
  --ha-reply-awaiting: var(--ha-ink-muted);
  --ha-reply-none: var(--ha-border);

  /* AI-suggestion treatment (accent base at low alpha). */
  --ha-ai-surface: rgba(45, 133, 255, 0.06); /* accent base at 6% */
  --ha-ai-border: rgba(45, 133, 255, 0.30);  /* accent base at 30% */

  /* Soft tints reused by chips/banners (existing base channels). */
  --ha-accent-tint: rgba(45, 133, 255, 0.10);  /* accent base at 10% */
  --ha-success-tint: rgba(13, 150, 152, 0.10); /* success base at 10% */
  --ha-success-edge: rgba(13, 150, 152, 0.25); /* success base at 25% */

  /* Focus ring (accent base at 25%). */
  --ha-focus-ring: 0 0 0 2px rgba(45, 133, 255, 0.25);

  /* Chrome: a cooler second neutral layer for the panes. */
  --ha-pane-bg: var(--ha-surface-subtle);

  /* Next-action band (rgba of the navy base channels — quiet emphasis ground). */
  --ha-na-band: rgba(20, 60, 85, 0.05);  /* navy base at 5% — next-action band */
  --ha-na-edge: rgba(20, 60, 85, 0.12);  /* navy base at 12% — next-action edge */

  /* ============================================================
     Worklist + SLA stuck-timer extensions  (REVIEW BEFORE GO-LIVE)
     ------------------------------------------------------------
     SLA aging colors carry meaning ON TEXT, so each must clear AA on
     white. They are DERIVED from existing base tokens (no raw hex):
       neutral = --ha-ink-muted        (the existing muted text token)
       amber   = gold base darkened toward primary ink via color-mix
                 (gold ramp alone is too light to pass AA as text)
       red     = --ha-danger           (AA-safe danger base)
     The worklist row/bucket surfaces reuse the existing rgba-of-base
     tints already defined above.
     ============================================================ */
  --ha-sla-neutral: var(--ha-ink-muted);
  --ha-sla-amber: color-mix(in srgb, var(--ha-gold-base) 52%,
                            var(--ha-blue-primary) 48%); /* AA amber/bronze */
  --ha-sla-red: var(--ha-danger);

  /* Worklist surfaces (reuse existing base-channel tints). */
  --ha-worklist-row-hover: var(--ha-row-hover);          /* navy base at 4% */
  --ha-worklist-bucket-bg: var(--ha-surface);
  --ha-worklist-past-bg: var(--ha-danger-bg);            /* danger-bg-muted */

  /* ============================================================
     Settings / template-management extensions  (FLAGGED)
     ------------------------------------------------------------
     The message-class badges are the guardrail made VISIBLE; color
     is ALWAYS paired with the label word in markup, never hue alone.
     Every value references an existing base token or an rgba() of an
     existing base color's own channels at lower alpha -- no new raw
     hex is introduced.
       autosend  -> border-strong fill + navy-soft text (a quiet,
                    settled neutral: this copy "just goes")
                    navy-soft 27,82,136 = --ha-blue-primary-soft
       draft     -> accent base 45,133,255 at 10% fill + AA blue text
                    (the live, attention-worthy "a human gates this")
       version   -> success base 13,150,152 for the active marker;
                    ink-muted for historical rows
       diff      -> AI draft on the neutral subtle surface; the sent
                    text on the success base at 6% (it shipped)
     ============================================================ */
  --ha-class-autosend-bg: var(--ha-border-strong);        /* settled neutral fill */
  --ha-class-autosend-fg: var(--ha-blue-primary-soft);    /* navy-soft text */
  --ha-class-draft-bg: var(--ha-accent-tint);             /* accent base at 10% */
  --ha-class-draft-fg: var(--ha-blue-text);               /* AA-safe accent text */

  --ha-version-active-bg: var(--ha-success-tint);         /* success base at 10% */
  --ha-version-active-fg: var(--ha-success);              /* success base */
  --ha-version-inactive-fg: var(--ha-ink-muted);          /* historical rows */

  --ha-diff-draft-bg: var(--ha-surface-subtle);           /* neutral subtle */
  --ha-diff-sent-bg: rgba(13, 150, 152, 0.06);            /* success base at 6% */

  /* ============================================================
     Multi-job split + uncertain-attribution extensions  (FLAGGED)
     ------------------------------------------------------------
     The split flag reuses the existing AI-suggestion treatment
     (ha-ai-surface/-border). The uncertain-attribution highlight
     is the gold base at low alpha -- a quiet "needs a glance"
     ground, paired ALWAYS with the "(best guess)" label in markup,
     never hue alone. No new raw hex is introduced.
       gold base 255,185,89 = --ha-gold-base (#FFB959)
     ============================================================ */
  --ha-uncertain-bg: rgba(255, 185, 89, 0.12);   /* gold base at 12% */
  --ha-uncertain-edge: rgba(255, 185, 89, 0.45); /* gold base at 45% */

  /* ============================================================
     Quotes-panel "needs your reply" attention tint  (FLAGGED)
     ------------------------------------------------------------
     A provider whose last message is an unanswered inbound gets a
     quiet full-card tint + a firmer border, ALWAYS alongside the
     labeled "Needs your reply" marker (color is never hue alone).
     Both are the accent base at low alpha -- no new raw hex:
       accent base 45,133,255 = --ha-blue-accent (#2D85FF)
     ============================================================ */
  --ha-attn-bg: rgba(45, 133, 255, 0.045);   /* accent base at 4.5% — card tint */
  --ha-attn-edge: rgba(45, 133, 255, 0.38);  /* accent base at 38% — firmer border */
}

/* Honor reduced-motion: neutralize every transition/animation (including the
   queue chevron rotate) for users who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
