﻿.portal_page_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.portal_page_title {
    margin: 0;
    font-size: 1.5rem;
}

.portal_toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.appointment_tasks_toolbar {
    width: 100%;
}

.appointment_tasks_toolbar_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.portal_page_header .portal_toolbar {
    margin-bottom: 0;
}

.portal_form_grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

/* List/consult page filters: flow by content width (no fixed 4 columns). */
.portal_filter_bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.portal_filter_bar > div {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.portal_filter_bar > div > label {
    display: block;
    line-height: 1.25rem;
    min-height: 1.25rem;
    margin-bottom: 0.35rem;
}

.portal_filter_bar .e-date-wrapper,
.portal_filter_bar .e-datepicker,
.portal_filter_bar .e-control-wrapper.e-date-wrapper {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    box-sizing: border-box;
}

/* Multiselect / dropdown: fixed at twice the date filter width */
.portal_filter_bar > div > .e-ddl,
.portal_filter_bar > div > .e-multiselect,
.portal_filter_bar > div > .e-input-group.e-control-wrapper:not(.e-date-wrapper):not(.e-numeric) {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    box-sizing: border-box;
}

.portal_filter_tags {
    display: grid;
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.portal_filter_bar > .portal_filter_tags {
    display: grid;
    flex: 1 1 0;
    width: 0;
    min-width: 280px;
    margin-bottom: 0;
}

.portal_filter_tags > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal_filter_tags > div > label {
    display: block;
    font-size: 12px;
    line-height: 1.25rem;
    min-height: 1.25rem;
    margin-bottom: 0.35rem;
}

.portal_filter_bar .e-multiselect .e-delim-view,
.portal_filter_bar .e-multiselect .e-delim-values {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal_form_grid > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal_form_grid > div > label {
    display: block;
    font-size: 12px;
    line-height: 1.25rem;
    min-height: 1.25rem;
    margin-bottom: 0.35rem;
}

/* Label + icon button (e.g. quick-add client): same band height as plain labels. */
.portal_form_grid .portal_section_title_with_icon {
    margin: 0 0 0.35rem 0;
    min-height: 1.25rem;
    line-height: 1.25rem;
    gap: 0.2rem;
}

.portal_form_grid .portal_section_title_with_icon > label {
    display: block;
    font-size: 12px;
    line-height: 1.25rem;
    min-height: 1.25rem;
    margin: 0;
}

.portal_form_grid .portal_section_title_with_icon .portal_info_icon_btn.e-btn {
    min-width: 1rem;
    width: 1rem;
    height: 1rem;
    font-size: 0.7rem;
}

a.portal_info_icon_btn {
    text-decoration: none;
}

/* Checkbox / button cells without a label: fake label height, then align control in the control band. */
.portal_form_grid > div:has(> .e-checkbox-wrapper):not(:has(> label))::before,
.portal_form_grid > div:has(> .e-btn):not(:has(> label))::before {
    content: "";
    display: block;
    flex: 0 0 auto;
    height: 1.25rem;
    margin-bottom: 0.35rem;
    pointer-events: none;
}

.portal_form_grid > div:has(> .e-checkbox-wrapper):not(:has(> label)) > .e-checkbox-wrapper,
.portal_form_grid > div:has(> .e-btn):not(:has(> label)) > .e-btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 2rem;
}

.portal_form_full_width {
    grid-column: 1 / -1;
}

/* Multiline memos: at least 6 lines; grow with the text when the browser supports field-sizing. */
.e-input-group.e-multi-line,
.e-control-wrapper.e-multi-line {
    height: auto !important;
    align-items: stretch;
}

.e-input-group textarea,
.e-control-wrapper textarea,
textarea.e-input {
    min-height: calc(1.375em * 6 + 0.75rem);
    max-height: 28em;
    field-sizing: content;
    resize: vertical;
    overflow-y: auto;
    box-sizing: border-box;
}

.portal_form_half_width {
    grid-column: span 2;
}

/* Higher specificity than .portal_form_grid > div so display:grid is not overridden by flex. */
.portal_form_grid > div.portal_form_pair_row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
    flex-direction: unset;
}

.portal_form_grid > div.portal_form_pair_row > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal_form_grid > div.portal_form_pair_row > div > label {
    display: block;
    line-height: 1.25rem;
    min-height: 1.25rem;
    margin-bottom: 0.35rem;
}

.portal_form_section {
    margin-top: 1.5rem;
}

.portal_form_section_title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}

/* Email template edit: grow the rich text editor to the bottom of the viewport. */
.portal_email_template_edit {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 50px - 2.5rem);
    box-sizing: border-box;
}

.portal_email_template_body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
}

.portal_email_template_body .portal_email_template_rte.e-richtexteditor,
.portal_email_template_body .e-richtexteditor.portal_email_template_rte {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100% !important;
}

.portal_email_template_body .portal_email_template_rte .e-rte-container,
.portal_email_template_body .e-richtexteditor.portal_email_template_rte .e-rte-container {
    height: 100%;
}

/* Date and numeric controls stay compact. */
.portal_form_grid .e-date-wrapper,
.portal_form_grid .e-datepicker,
.portal_form_grid .e-control-wrapper.e-date-wrapper,
.portal_form_grid .e-control-wrapper.e-numeric,
.portal_form_grid .e-numeric {
    width: 200px;
    max-width: 100%;
}

.portal_guest_root {
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #777777;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
}

.portal_guest_card {
    width: 100%;
    max-width: 24rem;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.08);
}

.portal_guest_title {
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.portal_guest_title img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.portal_guest_field {
    margin-bottom: 1rem;
}

.portal_password_field {
    position: relative;
}

.portal_password_field .password_toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 5;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal_password_field .password_toggle img {
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0.65;
}

.portal_password_field .password_toggle:hover img {
    opacity: 1;
}

.portal_password_field .e-input-group .e-input,
.portal_password_field input.e-input {
    padding-right: 2.25rem;
}

.portal_password_field:not(.portal_password_visible) .e-input-group .e-input,
.portal_password_field:not(.portal_password_visible) input.e-input {
    -webkit-text-security: disc;
}

.portal_password_field input::-ms-reveal,
.portal_password_field input::-ms-clear {
    display: none;
}

.portal_guest_remember label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.portal_guest_remember input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.portal_guest_error {
    color: #dc3545;
    margin-bottom: 1rem;
}

.portal_link_button {
    background: none;
    border: none;
    color: var(--portal-brand-primary, #00a7e5);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.portal_modules_grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    align-items: center;
}

.tab_section_separator {
    margin: 20px 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #ededed;
    font-size: 1.125rem;
    font-weight: 600;
    color: #323537;
    width: 100%;
    display: block;
}

.tab_section_separator:first-child {
    margin-top: 5px;
}

@media (max-width: 1200px) {
    .portal_form_grid,
    .portal_modules_grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .portal_form_grid,
    .portal_modules_grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal_form_half_width {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    .portal_form_grid,
    .portal_modules_grid {
        grid-template-columns: 1fr;
    }

    .portal_form_half_width {
        grid-column: 1 / -1;
    }

    .portal_form_grid > div.portal_form_pair_row {
        grid-template-columns: 1fr;
    }

    .portal_hesk_note_compose {
        grid-template-columns: 1fr;
    }

    .portal_filter_bar > div {
        flex: 1 1 100%;
    }

    .portal_filter_bar > div > .e-date-wrapper,
    .portal_filter_bar > div > .e-datepicker,
    .portal_filter_bar > div > .e-control-wrapper.e-date-wrapper,
    .portal_filter_bar > div > .e-ddl,
    .portal_filter_bar > div > .e-multiselect,
    .portal_filter_bar > div > .e-input-group.e-control-wrapper:not(.e-date-wrapper):not(.e-numeric) {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

.portal_placeholder_list {
    margin: 0;
    padding-left: 1.25rem;
}

.portal_section_title_with_icon {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.75rem 0;
}

.portal_section_title_with_icon .portal_form_section_title {
    margin: 0;
}

.portal_info_icon_btn.e-btn {
    min-width: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    color: #888;
}

.portal_info_icon_btn.e-btn:hover {
    color: var(--portal-brand-primary, #00a7e5);
}

.portal_placeholder_dialog.e-dialog {
    max-height: min(70vh, 480px);
}

.portal_placeholder_dialog .e-dlg-content {
    max-height: min(60vh, 400px);
    overflow-y: auto;
}

.portal_placeholder_list_dialog {
    user-select: text;
}

.portal_placeholder_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.3;
}

.portal_placeholder_group_title {
    margin: 0.65rem 0 0.25rem;
}

.portal_placeholder_list_dialog > .portal_placeholder_group_title:first-child {
    margin-top: 0;
}

.portal_placeholder_copy_btn.e-btn {
    min-width: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    color: #999;
    flex-shrink: 0;
    margin-left: 6px;
}

.portal_placeholder_copy_btn.e-btn:hover {
    color: var(--portal-brand-primary, #00a7e5);
    background-color: #f0f0f0;
}

.toolbar_export_icon {
    display: inline-block;
    width: 30px !important;
    height: 30px !important;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    font-size: 0 !important;
    line-height: 0 !important;
}

.toolbar_export_icon::before {
    content: "" !important;
}

.icon_xlsx {
    background-image: url('/images/svg/buttons/botao_xlsx.svg');
}

.icon_pdf {
    background-image: url('/images/svg/buttons/botao_pdf.svg');
}

.toolbar_export_icon.icon_reset_grid {
    width: 20px !important;
    height: 20px !important;
    background-image: url('/images/svg/buttons/botao_repor.svg');
}

.toolbar_export_icon.icon_clear_filters {
    width: 20px !important;
    height: 20px !important;
    background-image: url('/images/svg/buttons/botao_limpar_filtros.svg');
}

.portal_grid_actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.portal_grid_action_icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: none;
    padding: 0;
    cursor: pointer;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    text-decoration: none;
    flex: 0 0 auto;
}

.portal_grid_icon_edit {
    background-image: url('/images/svg/buttons/botao_editar.svg');
}

.portal_grid_icon_search {
    background-image: url('/images/svg/buttons/botao_pesquisar.svg');
}

.portal_grid_icon_copy {
    background-image: url('/images/svg/buttons/botao_copiar_b.svg');
}

.portal_grid_icon_send_welcome {
    background-image: url('/images/svg/buttons/botao_enviar_email.svg');
}

.portal_grid_icon_pdf {
    background-image: url('/images/svg/buttons/botao_pdf.svg');
}

.portal_grid_icon_call {
    background-image: url('/images/svg/buttons/botao_ligar.svg');
}

button.portal_grid_action_icon {
    appearance: none;
    -webkit-appearance: none;
}

button.portal_grid_action_icon:hover,
button.portal_grid_action_icon:focus,
button.portal_grid_action_icon:active {
    background-color: transparent;
    outline: none;
    box-shadow: none;
}

.portal_grid_icon_retry {
    background-image: url('/images/svg/buttons/botao_sincronizar.svg');
}

.portal_grid_icon_delete {
    background-image: url('/images/svg/buttons/botao_eliminar_b.svg');
}

.portal_grid_icon_deploy {
    background-image: url('/images/svg/buttons/botao_sincronizar.svg');
}

.portal_grid_icon_start {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='75' height='75' viewBox='0 0 75 75'%3E%3Cpath fill='%23323537' d='M24 12v51l40-25.5z'/%3E%3C/svg%3E");
}

.portal_grid_icon_stop {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='75' height='75' viewBox='0 0 75 75'%3E%3Cpath fill='%23323537' d='M20 14h12v47H20zM43 14h12v47H43z'/%3E%3C/svg%3E");
}

.portal_grid_icon_restart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='75' height='75' viewBox='0 0 75 75'%3E%3Cpath fill='%23323537' d='M37.5 16V6L25 19l12.5 13V22c9.4 0 17 7.6 17 17s-7.6 17-17 17-17-7.6-17-17H13c0 13.5 11 24.5 24.5 24.5S62 52.5 62 39 51 14.5 37.5 14.5V16z'/%3E%3C/svg%3E");
}

.portal_grid_icon_start_pool {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='75' height='75' viewBox='0 0 75 75'%3E%3Cpath fill='%23323537' d='M6 18h20v10H6zM6 32.5h20v10H6zM6 47h20v10H6zM36 14v47l33-23.5z'/%3E%3C/svg%3E");
}

.portal_grid_icon_stop_pool {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='75' height='75' viewBox='0 0 75 75'%3E%3Cpath fill='%23323537' d='M6 18h18v10H6zM6 32.5h18v10H6zM6 47h18v10H6zM34 14h11v47H34zM52 14h11v47H52z'/%3E%3C/svg%3E");
}

.portal_grid_icon_restart_pool {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='75' height='75' viewBox='0 0 75 75'%3E%3Cpath fill='%23323537' d='M6 18h16v9H6zM6 33h16v9H6zM6 48h16v9H6zM48 22v9L62 18 48 5v8C37.5 13 29 21.5 29 32s8.5 19 19 19 19-8.5 19-19h-7c0 6.6-5.4 12-12 12s-12-5.4-12-12 5.4-12 12-12z'/%3E%3C/svg%3E");
}

.portal_grid_icon_hesk_private {
    background-image: url('/images/svg/buttons/botao_ticket_privado.svg');
}

.portal_grid_icon_hesk_public {
    background-image: url('/images/svg/buttons/botao_ticket_publico.svg');
}

.portal_bool_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.portal_bool_badge_yes {
    background-color: #1f6b3a;
    color: #d4f5a8;
}

.portal_bool_badge_yes::before {
    content: "\2713";
}

.portal_bool_badge_no {
    background-color: #9b2226;
    color: #ffffff;
}

.portal_bool_badge_no::before {
    content: "\2715";
}

.e-grid tr.portal_server_app_online td.e-rowcell,
.e-grid tr.portal_server_app_online td.e-rowcell.e-frozen {
    background-color: rgba(31, 107, 58, 0.5);
}

.e-grid tr.portal_server_app_offline td.e-rowcell,
.e-grid tr.portal_server_app_offline td.e-rowcell.e-frozen {
    background-color: rgba(155, 34, 38, 0.5);
}

.portal_form_grid .portal_bool_badge {
    align-self: center;
    width: auto;
    flex: 0 0 auto;
}

.portal_grid_date_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.5rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.portal_grid_date_badge_ok {
    background-color: #1f6b3a;
    color: #d4f5a8;
}

.portal_grid_date_badge_expired {
    background-color: #9b2226;
    color: #ffffff;
}

.portal_article_image_field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.portal_article_image_field > .e-input-group,
.portal_article_image_field > .e-control-wrapper {
    flex: 1 1 auto;
    min-width: 0;
}

.portal_article_thumb_cell {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.portal_article_thumb {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    object-position: center;
    flex: 0 0 48px;
    background: #ffffff;
    border: 1px solid #d0d4dc;
}

.e-grid .e-rowcell .portal_article_thumb,
.portal_article_image_field .portal_article_thumb {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    object-position: center;
}

.e-grid .e-rowcell:has(.portal_article_thumb_cell):not(:has(.portal_article_with_name)) {
    width: 56px;
    max-width: 56px;
    overflow: hidden;
}

.portal_article_thumb_cell_sm {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    margin: 0;
}

.portal_article_thumb_cell_sm .portal_article_thumb,
.e-grid .e-rowcell .portal_article_thumb_cell_sm .portal_article_thumb,
.portal_article_with_name .portal_article_thumb {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    flex: 0 0 32px;
}

.portal_article_with_name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.portal_article_with_name_label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.e-dropdownbase .e-list-item:has(.portal_article_with_name),
.e-ddl.e-popup .e-list-item:has(.portal_article_with_name) {
    height: auto;
    min-height: 40px;
    line-height: normal;
}

.e-input-group:has(.portal_article_with_name) {
    min-height: 40px;
}

.portal_grid_bool_cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.e-grid .e-headercelldiv {
    font-size: 12px;
}

.account_details_tab {
    margin-top: 0.5rem;
}

/* MultiRow tabs: let the header grow instead of showing scroll arrows. */
.account_details_tab.e-tab > .e-tab-header,
.account_details_tab.e-tab > .e-tab-header .e-toolbar-items {
    height: auto;
}

/* Keep brand names (time.track / access.track / q.track) lowercase — Syncfusion tabs capitalize by default. */
.e-tab .e-tab-header .e-toolbar-item .e-tab-text {
    text-transform: none !important;
}

/* SfTab content wrapper only — not nested SfGrid .e-content (breaks header/body row alignment). */
.account_details_tab > .e-content {
    padding-top: 1rem;
}

.account_contact_dialog .e-dlg-content {
    padding-top: 0.75rem;
}

.account_contact_dialog .portal_form_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account_contact_dialog.portal_appointment_dialog .portal_form_grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal_appointment_dialog .account_details_tab {
    margin-top: 0;
}

.portal_appointment_dialog .account_details_tab > .e-content {
    padding-top: 0.75rem;
}

.portal_toast_host .e-toast-close-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.5rem;
    cursor: pointer;
    opacity: 0.9;
}

.portal_toast_host .e-toast-close-icon::before {
    content: "\00d7";
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}

/* Full-page busy overlay (layout root — blocks sidebar, toolbar and content) */
.portal_loading_overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: all;
}

.portal_loading_container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal_loading_spin {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: portal_loading_spin 0.8s linear infinite;
}

@keyframes portal_loading_spin {
    to { transform: rotate(360deg); }
}

.portal_calendar {
    height: calc(100vh - 14rem);
    min-height: 32rem;
}

.portal_filter_bar > div.portal_calendar_filter {
    flex: 1 1 auto;
    min-width: 280px;
    max-width: 100%;
}

.portal_filter_bar .portal_calendar_filter .e-multiselect,
.portal_filter_bar .portal_calendar_filter .e-input-group.e-control-wrapper:not(.e-date-wrapper):not(.e-numeric) {
    width: 100%;
    min-width: 280px;
    max-width: none;
}

.portal_calendar_color_swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.35rem;
    flex: 0 0 auto;
}

.portal_user_color_swatch {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.18);
    vertical-align: middle;
}

.portal_tag_chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.portal_tag_chip {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.5rem;
    border-radius: 0.25rem;
    line-height: 1.35;
    white-space: nowrap;
    margin: 0.1rem 0.15rem 0.1rem 0;
}

.portal_tag_chip_on_dark {
    color: #ffffff;
}

.portal_tag_chip_on_light {
    color: #1a1a1a;
}

.e-multiselect .e-chips.portal_tag_chip,
.e-multi-select-wrapper .e-chips.portal_tag_chip {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    height: 22px;
    margin: 0 4px 0 0;
    padding: 0 8px;
    line-height: 22px;
}

.e-multiselect .e-chips.portal_tag_chip .e-chipcontent,
.e-multiselect .e-chips.portal_tag_chip .e-chips-close,
.e-multiselect .e-chips.portal_tag_chip .e-chips-close::before {
    color: inherit;
}

.e-multiselect .e-chips.portal_tag_chip_on_dark,
.e-multi-select-wrapper .e-chips.portal_tag_chip_on_dark {
    color: #ffffff;
}

.e-multiselect .e-chips.portal_tag_chip_on_light,
.e-multi-select-wrapper .e-chips.portal_tag_chip_on_light {
    color: #1a1a1a;
}

.portal_calendar_employee_item {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    box-sizing: border-box;
    width: 100%;
    min-height: 1.5rem;
    padding: 0.15rem 0.4rem 0.15rem 0.35rem;
    border-left: 3px solid transparent;
    border-radius: 0 0.25rem 0.25rem 0;
}

/* Filter bar: checkbox cells reserve the same label band as dropdowns. */
.portal_filter_bar > div:has(> .e-checkbox-wrapper):not(:has(> label)) {
    align-self: flex-end;
    justify-content: flex-start;
}

.portal_filter_bar > div:has(> .e-checkbox-wrapper):not(:has(> label))::before {
    content: "";
    display: block;
    flex: 0 0 auto;
    height: 1.25rem;
    margin-bottom: 0.35rem;
    pointer-events: none;
}

.portal_filter_bar > div > .e-checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
}

/* Employee multiselect popup: center checkboxes with the colored row text. */
.e-multi-select-list-wrapper.portal_calendar_employee_ms .e-list-item,
.portal_calendar_employee_ms.e-popup .e-list-item {
    display: flex;
    align-items: center;
}

.e-multi-select-list-wrapper.portal_calendar_employee_ms .e-list-item .e-checkbox-wrapper,
.portal_calendar_employee_ms.e-popup .e-list-item .e-checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    align-self: center;
    margin-top: 0;
}

.portal_calendar_tooltip {
    max-width: 22rem;
    white-space: pre-wrap;
}

/* HESK ticket edit: note compose and conversation balloons. */
.portal_hesk_note_compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
}

.portal_hesk_note_compose .e-btn {
    white-space: nowrap;
}

.portal_hesk_bubble {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.portal_hesk_bubble_customer {
    background-color: #f2f2f2;
}

.portal_hesk_bubble_staff {
    background-color: var(--portal-brand-primary, #00a7e5);
    color: #ffffff;
}

.portal_hesk_bubble_staff .portal_form_section_title,
.portal_hesk_bubble_staff .portal_hesk_bubble_body,
.portal_hesk_bubble_staff .portal_hesk_bubble_body *,
.portal_hesk_bubble_staff a {
    color: #ffffff;
}

.portal_hesk_bubble_staff a {
    text-decoration: underline;
}

.portal_hesk_bubble_compose {
    background-color: transparent;
    border: 1px solid #d0d4dc;
}

.portal_hesk_bubble_body {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portal_hesk_bubble_body img {
    max-width: 100%;
    height: auto;
}

.portal_hesk_bubble_toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.portal_hesk_bubble_toggle > span:first-child {
    min-width: 0;
}

.portal_hesk_bubble_chevron {
    flex: 0 0 auto;
    font-size: 0.85rem;
    color: #888;
}

.portal_hesk_bubble_staff .portal_hesk_bubble_chevron {
    color: #ffffff;
}

.portal_hesk_bubble_collapsed .portal_hesk_bubble_toggle {
    margin-bottom: 0;
}

.portal_hesk_appointment_dates {
    align-self: center;
    flex: 1 1 auto;
    min-width: 0;
}

.portal_hesk_reply_rte.e-richtexteditor,
.e-richtexteditor.portal_hesk_reply_rte {
    min-height: 440px;
    height: auto !important;
}

.portal_hesk_reply_rte .e-rte-container,
.e-richtexteditor.portal_hesk_reply_rte .e-rte-container {
    min-height: 440px;
    height: auto !important;
}

.portal_hesk_reply_rte .e-rte-content,
.e-richtexteditor.portal_hesk_reply_rte .e-rte-content,
.portal_hesk_reply_rte .e-content,
.e-richtexteditor.portal_hesk_reply_rte .e-content {
    min-height: 360px;
    height: auto !important;
    overflow-y: auto;
}

.portal_hesk_calendar_dialog.e-dialog {
    max-width: 96vw;
}

.portal_hesk_calendar_dialog .e-dlg-header .portal_page_header,
.portal_hesk_calendar_dialog .e-dlg-header-content .portal_page_header {
    margin-bottom: 0;
    width: 100%;
}

.portal_hesk_calendar_dialog .e-dlg-header .portal_toolbar,
.portal_hesk_calendar_dialog .e-dlg-header-content .portal_toolbar {
    margin-bottom: 0;
}

.portal_hesk_calendar_dialog .e-dlg-content {
    overflow: auto;
    box-sizing: border-box;
}

.portal_hesk_calendar_dialog .portal_calendar {
    height: calc(92vh - 12rem);
    min-height: 24rem;
}

.portal_intervention_dialog.e-dialog {
    max-width: 96vw;
}

.portal_intervention_dialog .e-dlg-header .portal_page_header,
.portal_intervention_dialog .e-dlg-header-content .portal_page_header {
    margin-bottom: 0;
    width: 100%;
}

.portal_intervention_dialog .e-dlg-content {
    overflow: auto;
    box-sizing: border-box;
}

.portal_intervention_dialog .portal_toolbar {
    margin-bottom: 1rem;
}

.portal_hesk_lookup_drop.e-input-group,
.e-input-group.portal_hesk_lookup_drop,
.e-control-wrapper.portal_hesk_lookup_drop {
    border-width: 1px;
}

.portal_hesk_lookup_drop.portal_hesk_status_0,
.portal_hesk_lookup_item.portal_hesk_status_0 {
    color: #FF0000;
}

.portal_hesk_lookup_drop.portal_hesk_status_1,
.portal_hesk_lookup_item.portal_hesk_status_1 {
    color: #D66404;
}

.portal_hesk_lookup_drop.portal_hesk_status_2,
.portal_hesk_lookup_item.portal_hesk_status_2 {
    color: #0000FF;
}

.portal_hesk_lookup_drop.portal_hesk_status_3,
.portal_hesk_lookup_item.portal_hesk_status_3 {
    color: #008000;
}

.portal_hesk_lookup_drop.portal_hesk_status_4,
.portal_hesk_lookup_item.portal_hesk_status_4 {
    color: #8C55D4;
}

.portal_hesk_lookup_drop.portal_hesk_status_5,
.portal_hesk_lookup_item.portal_hesk_status_5 {
    color: #DC2D89;
}

.portal_hesk_lookup_drop.portal_hesk_status_custom,
.portal_hesk_lookup_item.portal_hesk_status_custom {
    color: var(--portal_hesk_tone, inherit);
}

.portal_hesk_lookup_drop.portal_hesk_priority_0,
.portal_hesk_lookup_item.portal_hesk_priority_0 {
    color: #CC0000;
}

.portal_hesk_lookup_drop.portal_hesk_priority_1,
.portal_hesk_lookup_item.portal_hesk_priority_1 {
    color: #E6A100;
}

.portal_hesk_lookup_drop.portal_hesk_priority_2,
.portal_hesk_lookup_item.portal_hesk_priority_2 {
    color: #2E7D32;
}

.portal_hesk_lookup_drop.portal_hesk_priority_3,
.portal_hesk_lookup_item.portal_hesk_priority_3 {
    color: #29B6F6;
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_status_0,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_status_0 {
    border-color: #FF0000;
    background-color: color-mix(in srgb, #FF0000 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_status_1,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_status_1 {
    border-color: #D66404;
    background-color: color-mix(in srgb, #D66404 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_status_2,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_status_2 {
    border-color: #0000FF;
    background-color: color-mix(in srgb, #0000FF 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_status_3,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_status_3 {
    border-color: #008000;
    background-color: color-mix(in srgb, #008000 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_status_4,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_status_4 {
    border-color: #8C55D4;
    background-color: color-mix(in srgb, #8C55D4 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_status_5,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_status_5 {
    border-color: #DC2D89;
    background-color: color-mix(in srgb, #DC2D89 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_status_custom,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_status_custom {
    border-color: var(--portal_hesk_tone);
    background-color: color-mix(in srgb, var(--portal_hesk_tone) 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_priority_0,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_priority_0 {
    border-color: #CC0000;
    background-color: color-mix(in srgb, #CC0000 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_priority_1,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_priority_1 {
    border-color: #E6A100;
    background-color: color-mix(in srgb, #E6A100 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_priority_2,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_priority_2 {
    border-color: #2E7D32;
    background-color: color-mix(in srgb, #2E7D32 14%, #ffffff);
}

.e-input-group.portal_hesk_lookup_drop.portal_hesk_priority_3,
.e-control-wrapper.portal_hesk_lookup_drop.portal_hesk_priority_3 {
    border-color: #29B6F6;
    background-color: color-mix(in srgb, #29B6F6 14%, #ffffff);
}

.portal_hesk_lookup_drop .e-input,
.portal_hesk_lookup_drop input.e-dropdownlist,
.portal_hesk_lookup_drop .e-input-group-icon,
.portal_hesk_lookup_item {
    color: inherit;
    font-weight: 600;
}

.portal_hesk_lookup_item {
    display: inline-block;
    width: 100%;
}

.portal_appointment_map {
    width: 100%;
    height: 18rem;
    min-height: 18rem;
    border: 1px solid #d7d7d7;
    border-radius: 4px;
    overflow: hidden;
}

.portal_appointment_address_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.portal_appointment_address_results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal_appointment_address_results > li {
    margin: 0;
}

.portal_appointment_map_links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
}
.portal_signature_pad {
    width: 100%;
    max-width: 32rem;
    height: 10rem;
    border: 1px solid var(--portal-border-color, #ced4da);
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

.portal_signature_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.portal_signature_preview {
    max-width: 16rem;
    max-height: 6rem;
    border: 1px solid var(--portal-border-color, #ced4da);
    background: #fff;
}

.opportunity_pipeline_root {
    box-sizing: border-box;
    width: 100%;
    padding-top: 8px;
}

.opportunity_pipeline_board {
    box-sizing: border-box;
    display: flex;
    gap: 12px;
    width: 100%;
    min-height: 420px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.opportunity_pipeline_stage {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    min-height: 360px;
    border: 1px solid #c8c9ca;
    border-radius: 6px;
    background-color: #fafafa;
}

.opportunity_pipeline_stage_header {
    flex-shrink: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #c8c9ca;
    background-color: #f0f1f2;
    font-size: 14px;
    font-weight: 600;
    color: #323537;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opportunity_pipeline_stage_meta {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 400;
    color: #666;
}

.opportunity_pipeline_stage_body {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 120px;
    padding: 8px;
    overflow-y: auto;
}

.opportunity_pipeline_stage_drag_over .opportunity_pipeline_stage_body {
    background-color: #eef0f2;
    outline: 2px dashed #323537;
    outline-offset: -4px;
}

.opportunity_pipeline_stage_drag_over {
    border-color: #323537;
}

.opportunity_pipeline_card {
    box-sizing: border-box;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: grab;
    font-size: 13px;
    color: #323537;
}

.opportunity_pipeline_card:last-child {
    margin-bottom: 0;
}

.opportunity_pipeline_card:active {
    cursor: grabbing;
}

.opportunity_pipeline_card_name {
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
}

.opportunity_pipeline_card_meta {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    word-break: break-word;
}

.opportunity_pipeline_card_actions {
    box-sizing: border-box;
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.crm_timeline_item {
    box-sizing: border-box;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.crm_timeline_title {
    font-weight: 600;
    color: #323537;
    word-break: break-word;
}

.crm_timeline_meta {
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    word-break: break-word;
}

@media (max-width: 900px) {
    .opportunity_pipeline_stage {
        flex: 0 0 180px;
        min-width: 180px;
    }
}

/* POS article management: 96px thumbs, viewport-width detail, compact sections */
.pos_article_management_page .portal_article_thumb_cell:not(.portal_article_thumb_cell_sm) {
    width: 96px;
    height: 96px;
    max-width: 96px;
    max-height: 96px;
}

.pos_article_management_page .portal_article_thumb_cell:not(.portal_article_thumb_cell_sm) .portal_article_thumb,
.pos_article_management_page .e-grid .e-rowcell .portal_article_thumb_cell:not(.portal_article_thumb_cell_sm) .portal_article_thumb {
    width: 96px;
    height: 96px;
    max-width: 96px;
    max-height: 96px;
    flex: 0 0 96px;
}

.pos_article_management_page .e-grid .e-rowcell:has(.portal_article_thumb_cell):not(:has(.portal_article_with_name)) {
    width: 104px;
    max-width: 104px;
}

.pos_article_management_page #cloud_pos_article_management_grid_v2 .e-gridcontent,
.pos_article_management_page #cloud_pos_article_management_grid_v2 .e-content {
    container-type: inline-size;
    container-name: pos-article-grid;
}

.pos_article_management_page #cloud_pos_article_management_grid_v2 .e-detailcell {
    overflow: hidden;
}

.pos_article_management_detail {
    position: sticky;
    left: 0;
    width: 100cqw;
    max-width: 100cqw;
    box-sizing: border-box;
    overflow-x: auto;
}

@supports not (width: 100cqw) {
    .pos_article_management_detail {
        width: calc(100vw - 280px);
        max-width: calc(100vw - 280px);
    }
}

.pos_article_management_detail .portal_form_section {
    margin-top: 0.5rem;
}

.pos_article_management_detail > .portal_form_section:first-child {
    margin-top: 0;
}

.pos_article_management_detail .portal_page_header {
    margin-bottom: 0.25rem;
}

.pos_article_management_detail .portal_form_section_title {
    margin-bottom: 0;
}
