/*
 * Colourful action icons (site-wide).
 * Every icon-only action — row actions in tables / action columns, and the
 * icon-only buttons main.js makes in page headers and toolbars (.ic-only,
 * [data-tip]) — gets a colour by meaning: view blue, edit indigo, clone
 * violet, mail sky, add/approve green, files teal, hide amber, delete red …
 * Icon-only header buttons also get a soft chip tint in the same colour
 * (main.js copies the icon's colour to the button as --ai-c).
 * Filled/primary buttons (white text on a coloured background) are skipped.
 */

/* ── Meaning → colour. Only sets a variable, so it is harmless elsewhere. ── */
/* View / preview / analytics — blue */
i:is(.fa-eye, .fa-magnifying-glass, .fa-search, .fa-arrow-up-right-from-square, .fa-external-link-alt, .fa-external-link, .fa-up-right-from-square, .fa-chart-bar, .fa-chart-line, .fa-chart-pie, .fa-chart-simple, .fa-list, .fa-list-ul, .fa-table-list, .fa-table, .fa-grip, .fa-th-large, .fa-columns, .fa-expand, .fa-maximize) { --ai-c: #3b82f6; }
/* Hide / pause / time — amber */
i:is(.fa-eye-slash, .fa-user-tag, .fa-pause, .fa-lock, .fa-clock, .fa-history, .fa-clock-rotate-left, .fa-hourglass, .fa-hourglass-half, .fa-star, .fa-bookmark, .fa-flag, .fa-triangle-exclamation, .fa-exclamation-triangle, .fa-lightbulb) { --ai-c: #f59e0b; }
/* Edit / settings / filters — indigo */
i:is(.fa-pen, .fa-pencil, .fa-pencil-alt, .fa-pen-to-square, .fa-edit, .fa-sliders, .fa-sliders-h, .fa-gear, .fa-cog, .fa-gears, .fa-cogs, .fa-filter, .fa-sort, .fa-arrow-down-wide-short, .fa-arrow-up-wide-short, .fa-wrench, .fa-screwdriver-wrench) { --ai-c: #6366f1; }
/* Clone / copy / link / AI — violet */
i:is(.fa-copy, .fa-clone, .fa-link, .fa-paperclip, .fa-magic, .fa-wand-magic-sparkles, .fa-robot, .fa-brain, .fa-layer-group, .fa-diagram-project, .fa-sitemap) { --ai-c: #8b5cf6; }
/* Mail / message / send / campaigns — sky */
i:is(.fa-envelope, .fa-envelope-open, .fa-envelope-open-text, .fa-paper-plane, .fa-bell, .fa-comment, .fa-comments, .fa-comment-dots, .fa-message, .fa-video, .fa-phone, .fa-bullhorn, .fa-share, .fa-share-nodes, .fa-share-alt, .fa-at, .fa-inbox) { --ai-c: #0ea5e9; }
/* Brands */
i.fa-whatsapp { --ai-c: #22c55e; }
i:is(.fa-linkedin, .fa-linkedin-in) { --ai-c: #0a66c2; }
i:is(.fa-google, .fa-file-pdf) { --ai-c: #ea4335; }
i:is(.fa-file-excel, .fa-file-csv) { --ai-c: #16a34a; }
i.fa-file-word { --ai-c: #2563eb; }
/* Add / approve / activate / save / refresh — green */
i:is(.fa-right-to-bracket, .fa-sign-in, .fa-sign-in-alt, .fa-power-off, .fa-play, .fa-check, .fa-check-double, .fa-circle-check, .fa-check-circle, .fa-user-check, .fa-user-shield, .fa-user-plus, .fa-trash-restore, .fa-trash-arrow-up, .fa-rotate-left, .fa-undo, .fa-redo, .fa-rotate, .fa-rotate-right, .fa-arrows-rotate, .fa-sync, .fa-sync-alt, .fa-plus, .fa-circle-plus, .fa-plus-circle, .fa-square-plus, .fa-save, .fa-floppy-disk, .fa-thumbs-up, .fa-handshake) { --ai-c: #16a34a; }
/* Download / upload / files / print — teal */
i:is(.fa-download, .fa-upload, .fa-cloud-arrow-down, .fa-cloud-arrow-up, .fa-file-arrow-down, .fa-file-arrow-up, .fa-file-export, .fa-file-import, .fa-file-lines, .fa-file-alt, .fa-file, .fa-file-signature, .fa-file-invoice, .fa-folder, .fa-folder-open, .fa-print, .fa-qrcode, .fa-calendar, .fa-calendar-alt, .fa-calendar-days, .fa-calendar-check, .fa-calendar-plus) { --ai-c: #0d9488; }
/* People / profiles — pink */
i:is(.fa-user, .fa-users, .fa-user-graduate, .fa-id-card, .fa-id-badge, .fa-address-card, .fa-user-tie, .fa-building, .fa-briefcase) { --ai-c: #db2777; }
/* Delete / remove / sign out — red */
i:is(.fa-trash, .fa-trash-can, .fa-trash-alt, .fa-times, .fa-xmark, .fa-ban, .fa-user-slash, .fa-user-xmark, .fa-user-minus, .fa-circle-xmark, .fa-times-circle, .fa-right-from-bracket, .fa-sign-out-alt, .fa-minus-circle, .fa-circle-minus, .fa-eraser, .fa-thumbs-down) { --ai-c: #ef4444; }

/* ── Where the colour applies ─────────────────────────────────────────── */
:is(
  :is(td, .ac-actions, .row-actions, [data-actions]) :is(a, button),
  .crm-main :is(a, button):is(.ic-only, [data-tip])
):not(.btn-crm):not(.btn-primary):not(.text-white):not([style*="background"]):not([class*="bg-primary"]):not([class*="bg-accent"]) > i {
  color: var(--ai-c, currentColor);
  transition: color .15s, transform .15s;
}
:is(
  :is(td, .ac-actions, .row-actions, [data-actions]) :is(a, button),
  .crm-main :is(a, button):is(.ic-only, [data-tip])
):not(.btn-crm):not(.btn-primary):not(.text-white):not([style*="background"]):not([class*="bg-primary"]):not([class*="bg-accent"]):hover > i {
  transform: scale(1.12);
}

/* Icon-only header / toolbar buttons: a soft chip in the icon's colour. */
.crm-main :is(a, button).ic-tint {
  background-color: color-mix(in srgb, var(--ai-c) 9%, transparent) !important;
  border-color: color-mix(in srgb, var(--ai-c) 28%, transparent) !important;
}
.crm-main :is(a, button).ic-tint:hover {
  background-color: color-mix(in srgb, var(--ai-c) 16%, transparent) !important;
}

/* Slightly lighter shades on dark backgrounds for contrast */
html.dark :is(
  :is(td, .ac-actions, .row-actions, [data-actions]) :is(a, button),
  .crm-main :is(a, button):is(.ic-only, [data-tip])
):not(.btn-crm):not(.btn-primary):not(.text-white):not([style*="background"]) > i { filter: brightness(1.2); }
