/* ------------------------------------------------------------------ */
/* Theme UI-kit overrides — colours from design-system tokens (violet,    */
/* indigo, green, yellow, red ramps). Only loaded when the REBRAND        */
/* feature toggle is active for the practice.                             */
/* ------------------------------------------------------------------ */

/* Header brand link (new uikit header) — keep white on the violet bar. */
body.theme-uikit #header > div > div > a,
body.theme-uikit #header > div > div > a:hover,
body.theme-uikit #header > div > div > a:focus,
body.theme-uikit #header > div > div > a:visited {
    color: #ffffff;
}

/* Shield header SVG icons from global rules (e.g. scheme.css `path { stroke: #616161 }`) */
body.theme-uikit #header path,
body.theme-uikit #header line,
body.theme-uikit #header polyline,
body.theme-uikit #header circle,
body.theme-uikit #header rect {
    stroke: inherit;
    fill: inherit;
}

/* Generic anchor link colour override (one step darker than violet-500).
   All exclusions go in one :where() so the rule sits at (0, 2, 2) — same
   spec as the per-component overrides below, which then win on source order. */
body.theme-uikit a:not(.btn):not(:where([class*="_btn"], #header a, #sidebar a)) {
    color: #5e58d0;
}
body.theme-uikit a:not(.btn):not(:where([class*="_btn"], #header a, #sidebar a)):hover,
body.theme-uikit a:not(.btn):not(:where([class*="_btn"], #header a, #sidebar a)):focus {
    color: #4945a3;
}


/* Preserve original colours for component-specific links that the
   blanket a:not(.btn) override would otherwise tint violet. */
body.theme-uikit .tab-nav > li > a {
    color: #7a7a7a;
}
body.theme-uikit .tab-nav > li.active > a {
    color: #000;
}

body.theme-uikit .redactor-toolbar a {
    color: rgba(0, 0, 0, 0.85);
}
body.theme-uikit .redactor-toolbar a:hover {
    color: rgba(0, 0, 0, 0.85);
    background: #f0effc;
}
/* Active/selected toolbar button (e.g. Bold active) — violet tint so it contrasts
   the default near-white background of rgba(245,245,245,0.95) from redactor.css. */
body.theme-uikit .redactor-toolbar a.redactor-button-active {
    background: #d8d7f5;
    color: rgba(0, 0, 0, 0.85);
}
body.theme-uikit .redactor-dropdown a {
    color: #000;
}
body.theme-uikit .redactor-dropdown a:hover {
    color: #fff !important;
    background-color: #6761e5 !important;
}
body.theme-uikit a.list-group-item {
    color: #555;
}
body.theme-uikit a.list-group-item:hover,
body.theme-uikit a.list-group-item:focus {
    color: #555;
}
body.theme-uikit .main-menu > li > a {
    color: #4C4C4C;
}
body.theme-uikit .main-menu > li > a:hover {
    color: #262626;
}
body.theme-uikit .dropdown-menu > li > a,
body.theme-uikit .dropdown-menu > li > a:hover,
body.theme-uikit .dropdown-menu > li > a:focus {
    color: #333;
}
/* UiKit header overflow-menu (CSS-module hashed classes) */
body.theme-uikit [class*="overflowMenu"] > li > a,
body.theme-uikit [class*="overflowMenu"] > li > a:hover,
body.theme-uikit [class*="overflowMenu"] > li > a:focus,
body.theme-uikit [class*="dropdownMenu"] a,
body.theme-uikit [class*="dropdownMenu"] a:hover,
body.theme-uikit [class*="dropdownMenu"] a:focus {
    color: var(--foreground, #333);
}
body.theme-uikit .table a.sortable,
body.theme-uikit .table a.asc,
body.theme-uikit .table a.desc {
    color: #333;
}

/* Additional Bootstrap component overrides for #2196F3 selectors */
body.theme-uikit .text-primary {
    color: #6761e5 !important;
}
body.theme-uikit .bg-primary {
    background-color: #6761e5;
}
body.theme-uikit .label-primary {
    background-color: #6761e5;
}
body.theme-uikit .panel-primary {
    border-color: #6761e5;
}
body.theme-uikit .panel-primary > .panel-heading {
    background-color: #6761e5;
    border-color: #6761e5;
}
body.theme-uikit .nav-pills > li.active > a,
body.theme-uikit .nav-pills > li.active > a:hover,
body.theme-uikit .nav-pills > li.active > a:focus {
    background-color: #6761e5;
}
body.theme-uikit .progress-bar {
    background-color: #6761e5;
}
body.theme-uikit .list-group-item-info {
    color: #27277a;
}
body.theme-uikit a.list-group-item-info {
    color: #27277a;
}
body.theme-uikit a.list-group-item-info:hover,
body.theme-uikit a.list-group-item-info:focus {
    color: #27277a;
}

body.theme-uikit .btn-primary {
    background: #6761e5;
}
body.theme-uikit .btn-primary:hover,
body.theme-uikit .btn-primary:focus,
body.theme-uikit .btn-primary:active,
body.theme-uikit .open > .dropdown-toggle.btn-primary {
    background: #5e58d0;
}

body.theme-uikit .btn-secondary {
    background-color: transparent;
    border: 1px solid #6761e5;
    color: #6761e5;
}
body.theme-uikit .btn-secondary:hover,
body.theme-uikit .btn-secondary:focus,
body.theme-uikit .btn-secondary:active,
body.theme-uikit .open > .dropdown-toggle.btn-secondary {
    background-color: #6761e5;
    border-color: #6761e5;
    color: #fff;
}

body.theme-uikit .alert {
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-block-end: var(--spacing-md);
    box-shadow: none;
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}
/* All buttons inside alerts adopt the DS chrome — same radius as the
   alert (rounded surface) and DS sans type stack. Bootstrap `.btn`
   would otherwise render at 4px radius + legacy Roboto, which clashes
   with the redesigned alert surface. */
body.theme-uikit .alert .btn {
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}
body.theme-uikit .alert-warning {
    background-color: #fff9eb;
    background-color: color-mix(in srgb, var(--warning) 10%, white);
    border-color: var(--warning);
    color: var(--warning-foreground);
}
body.theme-uikit .alert-danger {
    background-color: #ffecef;
    background-color: color-mix(in srgb, var(--error) 10%, white);
    border-color: var(--error);
    color: var(--error-foreground);
}
body.theme-uikit .alert-success {
    background-color: #eaf7f1;
    background-color: color-mix(in srgb, var(--success) 10%, white);
    border-color: var(--success);
    color: var(--success-foreground);
}
body.theme-uikit .alert-info {
    background-color: #ededfc;
    background-color: color-mix(in srgb, var(--info) 10%, white);
    border-color: var(--info);
    color: var(--info-foreground);
}

/* Headings inside alerts inherit the variant text colour and adopt
   the DS title-item type scale. Trailing-margin reset lets the alert's
   own padding control bottom spacing. */
body.theme-uikit .alert > h1,
body.theme-uikit .alert > h2,
body.theme-uikit .alert > h3,
body.theme-uikit .alert > h4,
body.theme-uikit .alert > h5,
body.theme-uikit .alert > h6 {
    color: inherit;
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.3;
    margin-block-start: 0;
}
body.theme-uikit .alert > h1:last-child,
body.theme-uikit .alert > h2:last-child,
body.theme-uikit .alert > h3:last-child,
body.theme-uikit .alert > h4:last-child,
body.theme-uikit .alert > h5:last-child,
body.theme-uikit .alert > h6:last-child {
    margin-block-end: 0;
}
body.theme-uikit .alert > h1:not(:last-child),
body.theme-uikit .alert > h2:not(:last-child),
body.theme-uikit .alert > h3:not(:last-child),
body.theme-uikit .alert > h4:not(:last-child),
body.theme-uikit .alert > h5:not(:last-child),
body.theme-uikit .alert > h6:not(:last-child) {
    margin-block-end: var(--spacing-sm);
}

/* Bootstrap `.close` dismiss button inside an alert: inherit variant
   colour, mute opacity at rest, drop the legacy text-shadow. Reset
   the Bootstrap `position: relative; top: -2px; right: -21px;` that
   pushes the X outside the alert frame — with our redesigned chrome
   (rounded corners, new padding) those offsets cause the close button
   to float beyond the visible border. `position: static` lets the
   inherited `float: right` from Bootstrap's `.close` place it cleanly
   in the top-right of the alert's content box. */
body.theme-uikit .alert .close {
    color: inherit;
    opacity: 0.7;
    text-shadow: none;
    position: static;
    top: auto;
    right: auto;
}
body.theme-uikit .alert .close:hover,
body.theme-uikit .alert .close:focus {
    color: inherit;
    opacity: 1;
}

/* Leading FA icons inside alerts pick up the variant text colour.
   Size and spacing stay on the icon class itself — colour only. */
body.theme-uikit .alert > i,
body.theme-uikit .alert > i.fa,
body.theme-uikit .alert > i.far,
body.theme-uikit .alert > i.fas,
body.theme-uikit .alert > i.fab,
body.theme-uikit .alert > i.fal {
    color: inherit;
}

/* Bootstrap `.bg-*` / `.text-*` utility classes used INSIDE an alert
   pick up the variant tone via DS tokens. Pinned by `.alert .bg-…`
   so the same utilities elsewhere (tables, badges, chips) keep their
   existing colours. `!important` on `.text-*` matches the existing
   app-wide rules earlier in this file — needed to win the cascade
   even with higher specificity. */
body.theme-uikit .alert .bg-warning {
    background-color: #fff9eb;
    background-color: color-mix(in srgb, var(--warning) 10%, white);
    color: var(--warning-foreground);
}
body.theme-uikit .alert .bg-danger {
    background-color: #ffecef;
    background-color: color-mix(in srgb, var(--error) 10%, white);
    color: var(--error-foreground);
}
body.theme-uikit .alert .bg-success {
    background-color: #eaf7f1;
    background-color: color-mix(in srgb, var(--success) 10%, white);
    color: var(--success-foreground);
}
body.theme-uikit .alert .bg-info {
    background-color: #ededfc;
    background-color: color-mix(in srgb, var(--info) 10%, white);
    color: var(--info-foreground);
}
body.theme-uikit .alert .text-warning {
    color: var(--warning-foreground) !important;
}
body.theme-uikit .alert .text-danger {
    color: var(--error-foreground) !important;
}
body.theme-uikit .alert .text-success {
    color: var(--success-foreground) !important;
}
body.theme-uikit .alert .text-info {
    color: var(--info-foreground) !important;
}

/* Variant-aware action buttons inside alerts. Surface = variant's
   foreground tone (always AA-compliant against white text); text =
   page background. Mirrors the DS WarningStack alert-action pattern.
   Specificity (0,3,1) beats `body.theme-uikit .btn-primary` (0,2,1)
   so source order isn't load-bearing. */
body.theme-uikit .alert-warning .btn-primary {
    background: var(--warning-foreground);
    border-color: var(--warning-foreground);
    color: var(--background);
}
body.theme-uikit .alert-danger .btn-primary {
    background: var(--error-foreground);
    border-color: var(--error-foreground);
    color: var(--background);
}
body.theme-uikit .alert-success .btn-primary {
    background: var(--success-foreground);
    border-color: var(--success-foreground);
    color: var(--background);
}
body.theme-uikit .alert-info .btn-primary {
    background: var(--info-foreground);
    border-color: var(--info-foreground);
    color: var(--background);
}

/* `.btn-default` inside an alert → outline button tinted to match the
   variant. Transparent surface, foreground-tone border + text. Reads
   as the secondary CTA against the primary (filled) button. */
body.theme-uikit .alert-warning .btn-default {
    background: transparent;
    border-color: var(--warning-foreground);
    color: var(--warning-foreground);
}
body.theme-uikit .alert-danger .btn-default {
    background: transparent;
    border-color: var(--error-foreground);
    color: var(--error-foreground);
}
body.theme-uikit .alert-success .btn-default {
    background: transparent;
    border-color: var(--success-foreground);
    color: var(--success-foreground);
}
body.theme-uikit .alert-info .btn-default {
    background: transparent;
    border-color: var(--info-foreground);
    color: var(--info-foreground);
}

/* `.btn-link` (text-only CTA) inside an alert inherits the variant
   text colour. Underline + transparent surface stay on Bootstrap's
   defaults. */
body.theme-uikit .alert-warning .btn-link {
    color: var(--warning-foreground);
}
body.theme-uikit .alert-danger .btn-link {
    color: var(--error-foreground);
}
body.theme-uikit .alert-success .btn-link {
    color: var(--success-foreground);
}
body.theme-uikit .alert-info .btn-link {
    color: var(--info-foreground);
}

/* Depressed-state visual feedback for in-alert buttons.
   `color-mix(... 85%, black)` darkens the resting tone by ~15%
   (passes AA against white text on filled variants). */
body.theme-uikit .alert-warning .btn-primary:hover,
body.theme-uikit .alert-warning .btn-primary:focus,
body.theme-uikit .alert-warning .btn-primary:active {
    background: color-mix(in srgb, var(--warning-foreground) 85%, black);
    border-color: color-mix(in srgb, var(--warning-foreground) 85%, black);
}
body.theme-uikit .alert-danger .btn-primary:hover,
body.theme-uikit .alert-danger .btn-primary:focus,
body.theme-uikit .alert-danger .btn-primary:active {
    background: color-mix(in srgb, var(--error-foreground) 85%, black);
    border-color: color-mix(in srgb, var(--error-foreground) 85%, black);
}
body.theme-uikit .alert-success .btn-primary:hover,
body.theme-uikit .alert-success .btn-primary:focus,
body.theme-uikit .alert-success .btn-primary:active {
    background: color-mix(in srgb, var(--success-foreground) 85%, black);
    border-color: color-mix(in srgb, var(--success-foreground) 85%, black);
}
body.theme-uikit .alert-info .btn-primary:hover,
body.theme-uikit .alert-info .btn-primary:focus,
body.theme-uikit .alert-info .btn-primary:active {
    background: color-mix(in srgb, var(--info-foreground) 85%, black);
    border-color: color-mix(in srgb, var(--info-foreground) 85%, black);
}

/* `.btn-default` depressed → fill with variant fg, flip text to bg. */
body.theme-uikit .alert-warning .btn-default:hover,
body.theme-uikit .alert-warning .btn-default:focus,
body.theme-uikit .alert-warning .btn-default:active {
    background: var(--warning-foreground);
    border-color: var(--warning-foreground);
    color: var(--background);
}
body.theme-uikit .alert-danger .btn-default:hover,
body.theme-uikit .alert-danger .btn-default:focus,
body.theme-uikit .alert-danger .btn-default:active {
    background: var(--error-foreground);
    border-color: var(--error-foreground);
    color: var(--background);
}
body.theme-uikit .alert-success .btn-default:hover,
body.theme-uikit .alert-success .btn-default:focus,
body.theme-uikit .alert-success .btn-default:active {
    background: var(--success-foreground);
    border-color: var(--success-foreground);
    color: var(--background);
}
body.theme-uikit .alert-info .btn-default:hover,
body.theme-uikit .alert-info .btn-default:focus,
body.theme-uikit .alert-info .btn-default:active {
    background: var(--info-foreground);
    border-color: var(--info-foreground);
    color: var(--background);
}

/* `.btn-link` depressed → darker variant text. Underline is kept
   from Bootstrap's `.btn-link:hover` default. */
body.theme-uikit .alert-warning .btn-link:hover,
body.theme-uikit .alert-warning .btn-link:focus,
body.theme-uikit .alert-warning .btn-link:active {
    color: color-mix(in srgb, var(--warning-foreground) 85%, black);
}
body.theme-uikit .alert-danger .btn-link:hover,
body.theme-uikit .alert-danger .btn-link:focus,
body.theme-uikit .alert-danger .btn-link:active {
    color: color-mix(in srgb, var(--error-foreground) 85%, black);
}
body.theme-uikit .alert-success .btn-link:hover,
body.theme-uikit .alert-success .btn-link:focus,
body.theme-uikit .alert-success .btn-link:active {
    color: color-mix(in srgb, var(--success-foreground) 85%, black);
}
body.theme-uikit .alert-info .btn-link:hover,
body.theme-uikit .alert-info .btn-link:focus,
body.theme-uikit .alert-info .btn-link:active {
    color: color-mix(in srgb, var(--info-foreground) 85%, black);
}

/* Keyboard-focus ring on buttons inside alerts. `:focus-visible`
   matches keyboard navigation only — mouse clicks don't fire it.
   Outline colour is the variant fg so it contrasts both the alert
   surface and the button surface. */
body.theme-uikit .alert-warning .btn:focus-visible {
    outline: var(--focus-ring-width) solid var(--warning-foreground);
    outline-offset: var(--focus-ring-offset);
}
body.theme-uikit .alert-danger .btn:focus-visible {
    outline: var(--focus-ring-width) solid var(--error-foreground);
    outline-offset: var(--focus-ring-offset);
}
body.theme-uikit .alert-success .btn:focus-visible {
    outline: var(--focus-ring-width) solid var(--success-foreground);
    outline-offset: var(--focus-ring-offset);
}
body.theme-uikit .alert-info .btn:focus-visible {
    outline: var(--focus-ring-width) solid var(--info-foreground);
    outline-offset: var(--focus-ring-offset);
}

body.theme-uikit .bg-warning {
    background-color: #fff9eb;
    color: #ea7700;
}
body.theme-uikit .bg-danger {
    background-color: #ffecef;
    color: #b22d41;
}
body.theme-uikit .bg-success {
    background-color: #eaf7f1;
    color: #1b623f;
}
body.theme-uikit .bg-info {
    background-color: #ededfc;
    color: #27277a;
}

body.theme-uikit .text-warning {
    color: #ea7700 !important;
}
body.theme-uikit .table > tfoot > tr > td.text-warning {
    color: #ea7700;
}
body.theme-uikit .text-danger {
    color: #b22d41 !important;
}
body.theme-uikit .table > tfoot > tr > td.text-danger {
    color: #b22d41;
}
body.theme-uikit .text-success {
    color: #1b623f;
}
body.theme-uikit .table > tfoot > tr > td.text-success {
    color: #1b623f;
}
body.theme-uikit .text-info {
    color: #27277a !important;
}
body.theme-uikit .table > tfoot > tr > td.text-info {
    color: #27277a;
}

/* Blog post header */
body.theme-uikit .blog-post .bp-header .bp-title {
    background: #5e58d0;
}

/* Table hover background */
body.theme-uikit .table-hover tbody tr:hover td,
body.theme-uikit .table-hover tbody tr:hover th {
    background-color: #f0effc;
}

/* Form field underline */
body.theme-uikit .fg-line:not([class*=has-]):not(.percentage):after {
    background: #6761e5;
}

/* Insert-placeholder button overrides */
body.theme-uikit button.btn.btn-primary.insert-placeholder-btn,
body.theme-uikit button.btn.btn-primary.insert-placeholder-btn:not(:disabled):not(.disabled) {
    background-color: #6761e5 !important;
    border-color: #6761e5 !important;
}
body.theme-uikit button.btn.btn-primary.insert-placeholder-btn:hover,
body.theme-uikit button.btn.btn-primary.insert-placeholder-btn:focus,
body.theme-uikit button.btn.btn-primary.insert-placeholder-btn:active,
body.theme-uikit button.btn.btn-primary.insert-placeholder-btn:active:focus,
body.theme-uikit button.btn.btn-primary.insert-placeholder-btn:not(:disabled):not(.disabled):hover,
body.theme-uikit button.btn.btn-primary.insert-placeholder-btn:not(:disabled):not(.disabled):focus,
body.theme-uikit button.btn.btn-primary.insert-placeholder-btn:not(:disabled):not(.disabled):active {
    background-color: #5e58d0 !important;
    border-color: #5e58d0 !important;
}

/* Card cyan background */
body.theme-uikit .ad-card-cyan {
    background-color: #6761e5;
}

/* Top search bar */
body.theme-uikit #top-search-wrap {
    background: #5e58d0;
}

/* List-view item icons */
body.theme-uikit .lv-item i.fa {
    color: #6761e5;
}
body.theme-uikit .lv-item i.far,
body.theme-uikit .lv-item i.fas,
body.theme-uikit .lv-item i.fab,
body.theme-uikit .lv-item i.fal {
    color: #6761e5;
}
body.theme-uikit a.lv-item {
    color: var(--foreground, #333);
}
body.theme-uikit a.lv-item:hover {
    color: #5e58d0;
}
body.theme-uikit a.lv-item.new:hover,
body.theme-uikit a.contact.new:hover {
    background-color: #f0effc;
}

/* Testimonial card icon */
body.theme-uikit .ad-card-testimonial i.fa {
    color: #6761e5;
}

/* Carousel indicators */
body.theme-uikit .carousel .carousel-indicators li:not(.active) {
    background: #6761e5;
}

/* Cyan-700 text utility */
body.theme-uikit .text-cyan-700 {
    color: #5e58d0 !important;
}

/* Teal and blue colour utilities */
body.theme-uikit .color-teal {
    color: #6761e5;
}
body.theme-uikit .color-blue {
    color: #6761e5;
}

/* Infoscreen dot hover */
body.theme-uikit .ad-feature-infoscreen-dot:hover {
    background-color: #39357e;
}

/* Lockscreen background */
body.theme-uikit #lockscreen-container {
    background-color: #39357e;
}

/* Public-facing link colours. Mirrors the spec-shape of the generic rule. */
body.theme-uikit .alfa-body-public a:not(.btn):not(:where([class*="_btn"], #header a, #sidebar a)),
body.theme-uikit .alfa-body-public a:not(.btn):not(:where([class*="_btn"], #header a, #sidebar a)):focus,
body.theme-uikit .alfa-body-public a:not(.btn):not(:where([class*="_btn"], #header a, #sidebar a)):visited {
    color: #6761e5;
}
body.theme-uikit .alfa-body-public a:not(.btn):not(:where([class*="_btn"], #header a, #sidebar a)):hover,
body.theme-uikit .alfa-body-public a:not(.btn):not(:where([class*="_btn"], #header a, #sidebar a)):active {
    color: #5e58d0;
}

/* Circular progress bar */
body.theme-uikit .CircularProgressbar .CircularProgressbar-text {
    fill: #6761e5 !important;
}
body.theme-uikit .CircularProgressbar .CircularProgressbar-path {
    stroke: #6761e5 !important;
}
body.theme-uikit .CircularProgressbar .CircularProgressbar-trail {
    stroke: #e0dbd8 !important;
}

/* Section heading border */
body.theme-uikit .section-header {
    border-left-color: #6761e5;
}

/* Pagination — keep original text colors */
body.theme-uikit .pagination > li > a {
    color: #333;
}

/* Pagination active state (from app.min.1.css) */
body.theme-uikit .pagination > .active > a,
body.theme-uikit .pagination > .active > span,
body.theme-uikit .pagination > .active > a:hover,
body.theme-uikit .pagination > .active > span:hover,
body.theme-uikit .pagination > .active > a:focus,
body.theme-uikit .pagination > .active > span:focus {
    background-color: #6761e5;
    border-color: #6761e5;
    color: #fff;
}

/* AI Patient Summary sidebar (patient-ai-sidebar.scss uses #00BCD4/#0097A7) */
body.theme-uikit .ad-ai-sidebar-collapsed {
    background: #6761e5;
}
body.theme-uikit .ad-ai-sidebar-collapsed:hover {
    background: #5e58d0;
}
body.theme-uikit .ad-ai-sidebar-expanded .ad-ai-sidebar-header-actions a:hover {
    color: #6761e5;
}
body.theme-uikit .ad-ai-sidebar-expanded .ad-ai-sidebar-patient-banner a {
    color: #5e58d0;
}
body.theme-uikit .ad-ai-sidebar-section .ad-ai-sidebar-section-icon {
    color: #6761e5;
}
body.theme-uikit .ad-ai-sidebar-list > li::before {
    color: #6761e5;
}

/* Tab-nav cyan underline — remap to violet */
body.theme-uikit .tab-nav[data-tab-color="cyan"] > li > a:after {
    background: #6761e5;
}

/* Card-header action icons — keep original gray */
body.theme-uikit .actions > li > a > i,
body.theme-uikit .actions > a > i {
    color: #adadad;
}
body.theme-uikit .actions > li > a:hover > i,
body.theme-uikit .actions > a:hover > i {
    color: #000;
}

/* Tooth scheme selection — remap blue to violet */
body.theme-uikit g.element.selected .background {
    fill: #6761e5 !important;
}
body.theme-uikit .tooth-element.selected {
    background: #6761e5;
}
body.theme-uikit .sextant.selected {
    background: #6761e5;
}
body.theme-uikit .tooth.selected .icon,
body.theme-uikit .tooth.selected .number,
body.theme-uikit .tooth.selected .element,
body.theme-uikit .tooth.selected .surface,
body.theme-uikit .abstract-element.selected .icon,
body.theme-uikit .abstract-element.selected .number,
body.theme-uikit .abstract-element.selected .element,
body.theme-uikit .abstract-element.selected .surface,
body.theme-uikit .tooth-element-new.selected .icon,
body.theme-uikit .tooth-element-new.selected .number,
body.theme-uikit .tooth-element-new.selected .element,
body.theme-uikit .tooth-element-new.selected .surface {
    background: #6761e5;
}

/* Panel-collapse cyan accent — remap to violet */
body.theme-uikit .panel-group[data-collapse-color="cyan"] .panel-collapse .panel-heading.active .panel-title > a::after {
    background: #6761e5;
}

/* Radio button selection — remap teal to violet */
body.theme-uikit .radio .input-helper:after {
    background: #6761e5;
}

/* Checkbox tick — remap teal to violet */
body.theme-uikit .checkbox .input-helper:after {
    border-bottom-color: #6761e5;
    border-left-color: #6761e5;
}

/* Toggle switch — remap teal to violet */
body.theme-uikit .toggle-switch:not([data-ts-color]) input:not(:disabled):checked + .ts-helper:before {
    background: #6761e5;
}

/* Funnel objective status colours — remap Material Design to brand palette */
body.theme-uikit .funnel-objective--not-reached {
    color: #b22d41;
}
body.theme-uikit .funnel-objective--almost-reached {
    color: #ea7700;
}
body.theme-uikit .funnel-objective--reached {
    color: #1b623f;
}

/* Folder icon — hide the legacy <img> and paint the SVG as a background on the
   parent. Avoids `content: url()` on <img>, which is Chromium-only and
   silently fails on Safari/mobile WebKit. :has() is supported in all
   browsers we target in 2026 (Chrome 105+, Safari 15.4+, Firefox 121+). */
body.theme-uikit img[src*="ad-folder-icon"] {
    visibility: hidden;
}
body.theme-uikit .ad-card-document .card-header:has(> img[src*="ad-folder-icon"]) {
    background: url(/images/alfadocs/ad-folder-icon.svg) no-repeat center / contain;
    min-height: 180px;
}
body.theme-uikit td:has(> img[src*="ad-folder-icon"]) {
    background: url(/images/alfadocs/ad-folder-icon.svg) no-repeat center / contain;
}

/* Care-plan pinned icon — remap legacy cyan to brand violet */
body.theme-uikit .care-plan-pinned-icon {
    color: var(--primary, #6761e5) !important;
}

/* Floating action button — brand accent (magenta-700 from the design-system
   accent token, AA on white). magenta-800 for hover/focus/active. */
body.theme-uikit .btn-float {
    background-color: #9f2db2;
}
body.theme-uikit .btn-float:hover,
body.theme-uikit .btn-float:focus,
body.theme-uikit .btn-float:active {
    background-color: #7b238a;
}

/* Checkbox focused state — remap cyan to violet */
body.theme-uikit input[type="checkbox"] + .input-helper.focused:before {
    border-color: #6761e5;
}

/* Redactor focus border — remap cyan to violet */
body.theme-uikit .redactor-focus.redactor-styles-on,
body.theme-uikit .redactor-focus:focus.redactor-styles-on {
    border-color: #6761e5 !important;
}

/* Billing details card header — remap cyan to violet */
body.theme-uikit .card-header[style*="00bcd4"] {
    background-color: #6761e5 !important;
}

/* AI Summary (Sintesi IA) panel header icon — recolour to brand violet */
body.theme-uikit .ai-summary-icon {
    color: #6761e5;
}

/* Patient AI Sidebar (Sintesi IA beta) — doctor icons are inline-styled
   cyan #00BCD4 in the React component; recolour to brand violet. */
body.theme-uikit .ad-ai-sidebar-expanded .fa-user-md {
    color: #6761e5 !important;
}

/* Patient AI Sidebar — insufficient-data info icon is inline-styled
   legacy orange #FF9800; recolour to the rebrand warning orange. */
body.theme-uikit .ad-ai-sidebar-error .fa-info-circle {
    color: #ea7700 !important;
}

/* Patient AI Sidebar — remap legacy cyan $ai-sidebar-primary (#00BCD4) and
   primary-dark (#0097A7) accents from patient-ai-sidebar.scss to brand
   violet / violet-dark. Covers the collapsed-strip background, the close-
   button hover, the patient-name link, section icons, and list bullets. */
body.theme-uikit .ad-ai-sidebar-collapsed {
    background: #6761e5;
}
body.theme-uikit .ad-ai-sidebar-collapsed:hover {
    background: #5e58d0;
}
body.theme-uikit .ad-ai-sidebar-header .ad-ai-sidebar-header-actions a:hover {
    color: #6761e5;
}
body.theme-uikit .ad-ai-sidebar-patient-banner a {
    color: #5e58d0;
}
body.theme-uikit .ad-ai-sidebar-section .ad-ai-sidebar-section-icon {
    color: #6761e5;
}
body.theme-uikit .ad-ai-sidebar-list > li::before {
    color: #6761e5;
}

/* Suppress Bootstrap's `.table-responsive { overflow-x: auto }` when content
   fits. layout.js sets data-overflow via a ResizeObserver; default scroll
   behaviour returns when content genuinely overflows. */
body.theme-uikit .table-responsive[data-overflow="false"] {
    overflow-x: visible;
}
/* Tighten action-button padding so the compact transaction list (Edit +
   Delete column) fits the bill sidebar at narrow widths. */
body.theme-uikit .table-responsive .ad-buttons-inline .btn {
    padding-left: 8px;
    padding-right: 8px;
    margin-right: 2px;
}

/* HTP-4881 — Tooth scheme: replacement-tooth fill (legacy Material teal-700 #009688)
   and pin marker fill (legacy Material cyan-500 #00bcd4). The legacy fills come
   from web/css/frontend.css and from inline SVG attributes in web/js/scheme.js;
   CSS wins over SVG presentation attributes. */
body.theme-uikit g.element.replacement path.replacement {
    fill: var(--success, #237f52);
}
body.theme-uikit g.element.pin rect.pin {
    fill: var(--primary, #6761e5);
}

/* HTP-4881 — Periodontal scheme depth polyline. Rendered with
   id="topElementPolyline" + inline fill/stroke by SvgLines.js, and styled via
   polyline.variable-depth from periodontal-scheme.scss. */
body.theme-uikit #topElementPolyline,
body.theme-uikit polyline.variable-depth {
    fill: var(--color-green-100, #bfe7d4);
    stroke: var(--success, #237f52);
}
