﻿.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;
    margin-bottom: 1rem;
}

.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 > div > .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 > div > .portal_section_title_with_icon > label {
    display: block;
    font-size: 12px;
    line-height: 1.25rem;
    min-height: 1.25rem;
    margin: 0;
}

.portal_form_grid > div > .portal_section_title_with_icon .portal_info_icon_btn.e-btn {
    min-width: 1rem;
    width: 1rem;
    height: 1rem;
    font-size: 0.7rem;
}

/* 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_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_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_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');
}

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_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";
}

.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_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;
}

/* 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.35);
    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;
}

