/* Edit/delete/add/calendar icons (every page) and patient/bill tab link colours, loaded by ThemeAssets.ascx for every user (themed or not).
   Moved from ThemeLegacyBridge.css, which only loads for themed specialties. html:not(.pi-x) keeps the
   same weight the old html.theme-on prefix had. Colours use the theme tokens with the eMed defaults as fallback. */

/* Patient tab pages (Insurances, Appointments, ...): grid links keep their legacy colour,
   same as the bill screens. Toolbar action links (patient-action-link outside a grid) keep the theme.
   Grid rows also tag some links patient-action-link (Insurances Verify/Plan, Encounters Visit Summary
   Notes); those GridViews render table id="gv...", and their links use the legacy brown too. */
html:not(.pi-x):is(.patient-workspace-uniform, .patient-record-tab, .patient-appointments-chrome, .patient-letters-chrome) table a:not(.patient-action-link):is([style*="color:#A52A2A" i], [style*="color: #A52A2A" i], [style*="color:brown" i], [style*="color: brown" i]),
html:not(.pi-x):is(.patient-workspace-uniform, .patient-record-tab, .patient-appointments-chrome, .patient-letters-chrome) table[id^="gv" i] td a.patient-action-link {
    color: #A52A2A !important;
}
html:not(.pi-x):is(.patient-workspace-uniform, .patient-record-tab, .patient-appointments-chrome, .patient-letters-chrome) table a:not(.patient-action-link):is([style*="color:maroon" i], [style*="color: maroon" i]) {
    color: #800000 !important;
}
/* Patient tab text links that use the legacy link colour instead of the theme:
   Insurances "View Benefits" (grid and Add/Edit Insurance popup), "Prepayment plans", "Cost Estimator", "Move Next", Auth/Referrals header links,
   Appointments print links (Summary page links: PatientOverviewTheme.css), Followup "Schedule" (PatientFollowup.js sets an inline blue). */
html:not(.pi-x).patient-insurance-uniform :is(a.cssViewSpecialtyBenefits, a.lbtnViewBenifitsCss, #lnkPaymentPlans, #lnkbtnPatientEstimator, #btnNext),
html:not(.pi-x).patient-workspace-uniform :is(#lnkAddReceivedReferral, #lbtnNew.lnkCreatedNewReferral, #lnkViewRecentArchiveList),
html:not(.pi-x).patient-appointments-chrome #tblAppsGrid :is(#lnkDeletedAppPdf, #lnkfuterAppPdf, #lnkSelectedPatAppPdf),
html:not(.pi-x).patient-followup-tab table a:is([style*="color: blue" i], [style*="color:blue" i], [style*="rgb(0, 0, 255)"]) {
    color: #A52A2A !important;
}

/* Edit/delete icons on every page (patient tabs, bill screens and all other modules): the legacy raster images (edit_M.png, edit.gif, trash.png, delete.gif,
   delete_red.png, deletered.png) are drawn as SVG icons — edit-square.svg in the theme colour, trash.svg in
   the delete red (same red as the Confirm Delete button). The element stays the same <img>/<input type=image>,
   so clicks, tooltips and postbacks are unchanged: the padding pushes the bitmap out of the 16px box and
   the masked background colour paints the icon. */
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/edit_M.png" i], [src$="/edit.gif" i], [src$="/trash.png" i], [src$="/delete.gif" i], [src$="/delete_red.png" i], [src$="/deletered.png" i]) {
    box-sizing: border-box !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    padding: 16px 0 0 16px !important;
    border: 0 !important;
    overflow: hidden;
    vertical-align: middle;
    background-image: none !important;
    -webkit-mask: var(--patient-icon) center / contain no-repeat;
    mask: var(--patient-icon) center / contain no-repeat;
    cursor: pointer;
}
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/edit_M.png" i], [src$="/edit.gif" i]) {
    --patient-icon: url("../images/Dental/edit-square.svg");
    background-color: var(--brand, #0f6496) !important;
}
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/trash.png" i], [src$="/delete.gif" i], [src$="/delete_red.png" i], [src$="/deletered.png" i]) {
    --patient-icon: url("../images/Dental/trash.svg");
    background-color: #d00505 !important;
}
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/edit_M.png" i], [src$="/edit.gif" i], [src$="/trash.png" i], [src$="/delete.gif" i], [src$="/delete_red.png" i], [src$="/deletered.png" i]):is(:hover, :focus-visible) {
    opacity: .75;
}
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/edit_M.png" i], [src$="/edit.gif" i], [src$="/trash.png" i], [src$="/delete.gif" i], [src$="/delete_red.png" i], [src$="/deletered.png" i]):is([disabled], .aspNetDisabled) {
    background-color: #b5b5b5 !important;
    cursor: default;
    opacity: 1;
}
/* "Add" icons on every page (addNew.jpg, AddNew.png, addInbox.png; plus.png when its title/alt says add/new, and always on patient tabs: plus.png is also the expand toggle next to minus.png elsewhere) — e.g. Add New Patient, Create New Task,
   New Appointment/Encounter, Add Received Referral, Add Attorney/Employer, Add Diagnosis, Search Referring/PCP
   provider) are drawn as plus_circle.svg in the theme colour, the same icon as Patient Search "Add New Patient". */
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/addNew.jpg" i], [src$="/AddNew.png" i], [src$="/addInbox.png" i], [src$="/plus.png" i]:is([title*="add" i], [alt*="add" i], [title*="new" i], [alt*="new" i])),
html:not(.pi-x):is(.patient-workspace-uniform, .patient-record-tab, .patient-appointments-chrome, .patient-letters-chrome) :is(img, input[type="image"])[src$="/plus.png" i] {
    box-sizing: border-box !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    padding: 16px 0 0 16px !important;
    border: 0 !important;
    overflow: hidden;
    vertical-align: middle;
    background-image: none !important;
    background-color: var(--brand-dark, #0c517a) !important;
    filter: none !important;
    -webkit-mask: url("../images/Dental/plus_circle.svg") center / contain no-repeat;
    mask: url("../images/Dental/plus_circle.svg") center / contain no-repeat;
    cursor: pointer;
}
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/addNew.jpg" i], [src$="/AddNew.png" i], [src$="/addInbox.png" i], [src$="/plus.png" i]:is([title*="add" i], [alt*="add" i], [title*="new" i], [alt*="new" i])):is(:hover, :focus-visible),
html:not(.pi-x):is(.patient-workspace-uniform, .patient-record-tab, .patient-appointments-chrome, .patient-letters-chrome) :is(img, input[type="image"])[src$="/plus.png" i]:is(:hover, :focus-visible) {
    background-color: var(--brand, #015c7d) !important;
}
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/addNew.jpg" i], [src$="/AddNew.png" i], [src$="/addInbox.png" i], [src$="/plus.png" i]:is([title*="add" i], [alt*="add" i], [title*="new" i], [alt*="new" i])):is([disabled], .aspNetDisabled),
html:not(.pi-x):is(.patient-workspace-uniform, .patient-record-tab, .patient-appointments-chrome, .patient-letters-chrome) :is(img, input[type="image"])[src$="/plus.png" i]:is([disabled], .aspNetDisabled) {
    background-color: #b5b5b5 !important;
    cursor: default;
}
/* Same icons for grid "Edit" / "Delete" text controls tagged patient-grid-icon (Contacts, Tasks, CareTeam,
   Communications, Summary documents grid).
   The link text stays in the DOM for screen readers (font-size 0) and the tooltip says what it does. */
html:not(.pi-x) body .patient-grid-icon.patient-grid-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    text-decoration: none !important;
    vertical-align: middle;
    cursor: pointer;
}
html:not(.pi-x) body .patient-grid-icon.patient-grid-icon::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    -webkit-mask: var(--patient-icon) center / contain no-repeat;
    mask: var(--patient-icon) center / contain no-repeat;
}
html:not(.pi-x) body .patient-grid-icon-edit.patient-grid-icon::before {
    --patient-icon: url("../images/Dental/edit-square.svg");
    background-color: var(--brand, #0f6496);
}
html:not(.pi-x) body .patient-grid-icon-delete.patient-grid-icon::before {
    --patient-icon: url("../images/Dental/trash.svg");
    background-color: #d00505;
}
html:not(.pi-x) body .patient-grid-icon.patient-grid-icon:is(:hover, :focus-visible)::before { opacity: .75; }
html:not(.pi-x) body .patient-grid-icon.patient-grid-icon:focus-visible { outline: 2px solid var(--brand-dark, #0c517a); outline-offset: 1px; }
html:not(.pi-x) body .patient-grid-icon.patient-grid-icon:is(.aspNetDisabled, .is-disabled) { cursor: default; }
html:not(.pi-x) body .patient-grid-icon.patient-grid-icon:is(.aspNetDisabled, .is-disabled)::before { background-color: #b5b5b5; opacity: 1; }

/* Date-picker icons on every page (images/cal.jpg, hover cal_rollover.jpg) are drawn as calendar-days.svg,
   the same 20px calendar as the bill screens (BillingTabsAPI/superbill.aspx), in the theme colour.
   The <img> stays the jQuery UI datepicker trigger, so clicking it still opens the calendar. */
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/cal.jpg" i], [src$="/cal_rollover.jpg" i]) {
    box-sizing: border-box !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    padding: 20px 0 0 20px !important;
    border: 0 !important;
    overflow: hidden;
    vertical-align: middle;
    background-image: none !important;
    background-color: var(--brand, #0f6496) !important;
    filter: none !important;
    -webkit-mask: url("../images/calendar-days.svg") center / contain no-repeat;
    mask: url("../images/calendar-days.svg") center / contain no-repeat;
    cursor: pointer;
}
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/cal.jpg" i], [src$="/cal_rollover.jpg" i]):hover {
    background-color: var(--brand-dark, #0c517a) !important;
}
html:not(.pi-x):not(.pi-y) :is(img, input[type="image"]):is([src$="/cal.jpg" i], [src$="/cal_rollover.jpg" i]):is([disabled], .aspNetDisabled) {
    background-color: #b5b5b5 !important;
    cursor: default;
}
