﻿/* Header */
@media only screen and (max-width: 720px) {
    #header-userinfo {
        display: none;
    }
}



/* Blazor server reconnect dialog */
#components-reconnect-modal {
    color: black;
}

iframe {
    background-color: white;
}

.order-item.backorder {
    color: red;
    font-weight: bolder
}

/* PDF viewer */
.pdf-viewer .pdf-viewer-header {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    align-self: flex-start;
}

.pdf-viewer .pdf-viewer-object {
    width: 100%;
    flex-grow: 1;
    min-height: 0;
}
/* /PDF viewer */

/* HTML Editor */
.html-editor-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.html-editor {
    position: relative;
    flex-grow: 1;
    display: flex;
    height: 300px;
    width: 100%;
}

    .html-editor .menu-toggle-anchor {
        position: absolute;
        z-index: 99;
        right: 8px;
        top: 8px;
    }
    /* /HTML Editor */


    /* Syncfusion RTE overrides */
    .html-editor.rounded .e-rte-container,
    .html-editor.rounded .e-richtexteditor,
    .html-editor.rounded .e-richtexteditor .e-content,
    .html-editor.rounded .e-richtexteditor .e-rte-content {
        border-radius: 20px !important;
    }

.e-richtexteditor .e-toolbar .e-toolbar-item {
    min-height: 20px !important;
}

    .e-richtexteditor .e-toolbar .e-toolbar-item:not(.e-separator):not(.e-spacer) {
        min-width: 20px !important;
    }

.e-richtexteditor .e-content,
.e-richtexteditor .e-rte-placeholder {
    padding: 8px !important;
    padding-bottom: 0px !important;
}

.e-richtexteditor .e-rte-toolbar .e-toolbar-item .e-tbar-btn.e-btn {
    min-height: 20px !important;
    min-width: 20px !important;
}

.e-richtexteditor .e-rte-toolbar .e-toolbar-item .e-rte-dropdown-menu {
    min-height: 20px !important;
}

.e-richtexteditor .e-toolbar .e-toolbar-item:not(.e-separator):not(.e-spacer) {
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}

.e-richtexteditor .e-rte-toolbar .e-hor-nav.e-expended-nav {
    min-height: 20px !important;
    height: 30px !important;
}

.e-richtexteditor .e-toolbar .e-toolbar-item.e-separator {
    margin: 0px !important;
}

.e-split-btn-wrapper .e-split-btn.e-icon-btn {
    padding: 4px !important;
}

.e-richtexteditor .e-rte-toolbar .e-btn .e-btn-icon.e-icon-left {
    width: 1em !important;
}

.e-richtexteditor .e-rte-dropdown-btn-text-wrapper {
    font-size: 12.5px;
}

.e-richtexteditor .e-rte-toolbar .e-toolbar-item .e-rte-dropdown-menu {
    padding: 4px !important;
}

    .e-richtexteditor .e-rte-toolbar .e-toolbar-item .e-rte-dropdown-menu .e-rte-dropdown-btn-text-wrapper {
        width: unset !important;
    }
/*.e-richtexteditor .e-rte-toolbar .e-toolbar-item .e-rte-dropdown-menu .e-rte-dropdown-btn-text {
    padding: 0px !important;
}*/
/* /Syncfusion RTE overrides*/


/* Preview */
.image-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-in;
    background-color: #000;
}

    .image-container img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        transition: transform 0.3s ease;
    }

    .image-container.zoomed {
        cursor: zoom-out;
        overflow: auto;
    }

        .image-container.zoomed img {
            max-width: none;
            max-height: none;
            width: auto;
            height: auto;
        }



/* Comments */
/* One node row: gutter + content */
.comment-component-shell-expanded {
    position: fixed;
    top: 5vh;
    left: 5vw;
    width: 90vw;
    height: 85vh;
    z-index: 1300;
    background: #22252b;
    color: rgba(255,255,255,0.87);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.55);
    padding: 16px;
    overflow: auto;
}

.comment-container {
    /*border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;*/
}

.comment-component-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 1299;
}

.comment-node {
    width: 100%;
    margin: 4px 0;
    position: relative;
}

.comment-add-container {
    position: relative;
}

.comment-submit-container {
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 9;
}

.comment-row-summary {
    margin-left: 9px;
}

.comment-row-avatar {
    margin-top: 7px;
    margin-left: 8px;
}

.comment-row-content-wrapper {
    width: 100%;
    padding: 4px 0px;
}

.comment-row-content {
    background-color: var(--mud-palette-black);
    border-radius: 12px;
    padding: 4px 8px;
}

.comment-content {
    position: relative;
}

.comment-row-container-wrapper {
    width: 100%;
}

.comment-row-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 4px;
}


/* Children indentation */
.comment-children {
    margin-left: 20px; /* indent for nesting */
}

.comment-children-spine {
    position: relative;
    padding-left: 20px;
}

/* The actual spine line */
.comment-children-spine-line {
    position: absolute;
    left: -2px;
    top: -16px;
    bottom: 0; /* default full height */
    width: 2px;
    background: rgba(255,255,255,.18);
    border-radius: 2px;
}

/* Draw the elbow ONLY when we're inside a children spine container */
.comment-children-spine .comment-node .comment-content::before {
    content: "";
    position: absolute;
    left: -20px; /* reaches back into the spine padding area */
    top: 18px; /* align to avatar/bubble center */
    width: 20px;
    height: 2px;
    background: rgba(255,255,255,.18);
    border-radius: 2px;
}

/* Now the "stop" only needs to cover inside this container */
.comment-node.is-last::after {
    content: "";
    position: absolute;
    left: -23px; /* relative to comment-content, tweak as needed */
    top: 20px;
    height: calc(100% - 18px); /* ONLY within this node */
    width: 4px;
    background: var(--mud-palette-surface, #2f3036);
}

.comment-children-spine > .comment-node {
    position: relative;
    z-index: 1;
}

/* Reactions */
.comment-node .reaction {
    cursor: pointer;
}

    .comment-node .reaction.is-mine {
        padding: 1px 6px;
        border-radius: 999px;
        background: rgba(255,255,255,.2);
    }

.comment-node .reaction-like-wrap {
    position: relative;
    display: inline-block;
}

.comment-node .reaction-like-btn {
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.comment-body-preview img {
    cursor: zoom-in;
    max-width: 100%;
    height: auto;
}

#comment-image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.comment-image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.comment-image-lightbox-image {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

.reaction-picker {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 6px;
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 999px;
    background: var(--mud-palette-surface, #2f3036);
    border: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    z-index: 1000;
}

.reaction-picker-item {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 8px;
}

    .reaction-picker-item:hover {
        background: rgba(255,255,255,.08);
    }
/* /Reactions */

/* /Comments */


/* Notes */
.note-content-wrapper .note-content-card {
    width: 100%;
    padding: 4px 8px;
    background-color: var(--mud-palette-black);
}

.note-content-wrapper .note-content {
    overflow: auto;
    width: 100%;
    height: 100%;
}
/* /Notes */
/* Planner */
:root {
    --planner-subelement-margin-left: 2em;
    --planner-item-height: 30px;
}

.planner-item-row {
    position: relative;
    min-width: max-content;
}
/* Planner insert zone */
/* Absolutely-positioned overlay that sits across the gap under the row */
.insert-overlay {
    position: absolute;
    left: 20%;
    right: 80%;
    bottom: -14px; /* negative pushes it into the gap/over next row top */
    height: 20px; /* thin hover zone; tweak to taste */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* hidden by default */
    pointer-events: none; /* don't block when hidden */
    z-index: 5; /* float above neighboring rows */
    transition: opacity .12s ease-in-out;
}

    /* Show overlay on row hover OR when overlay itself is hovered */
    .planner-item-container:hover > .insert-overlay,
    .insert-overlay:hover {
        opacity: 1;
        pointer-events: auto; /* clickable only when visible */
    }

/* The dashed guide line */
.insert-line {
    position: absolute;
    top: 50%;
    left: 8px;
    right: 8px;
    /*transform: translateY(-50%);
    border-top: 1px dashed var(--mud-palette-lines-default);*/
    pointer-events: none;
}

/* Centered add button, floating over the line */
/**/ .insert-btn {
    position: relative;
    z-index: 1;
    background: var(--mud-palette-surface); /* “pill” background over the line */
    border-radius: 999px;
    box-shadow: var(--mud-elevation-3);
}

*/
/* Larger, always-visible touch target on coarse pointers (optional) */
@media (pointer: coarse) {
    .insert-overlay {
        opacity: 1;
        pointer-events: auto;
        height: 36px;
        bottom: -18px;
    }
}

/* /Planner insert zone */


.planner-attachment-icon {
    width: 100%;
    max-width: 1.5rem;
    max-height: 1.5rem;
    margin: 0.5em;
    object-fit: scale-down;
}

.planner-header-sticky {
    position: sticky !important;
    top: 0;
    background-color: inherit;
    z-index: 1;
}

.planner-item-container {
    position: relative;
}

    .planner-item-container.selected {
        background-color: rgba(255, 255, 255, 0.2);
        color: var(--mab-datagrid-selected-foreground);
    }

    .planner-item-container.subelement {
        /*margin-top: 4px;*/
        /*margin-left: var(--planner-subelement-margin-left);*/
        background-color: rgba(66, 165, 245, 0.1);
    }

.planner-list-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: var(--planner-item-height);
    gap: 2px;
    overflow-y: hidden;
    min-width: max-content;
}

.planner-list-item-status .mud-input-slot.mud-input-root.mud-input-root-outlined.mud-input-root-margin-dense.mud-select-input {
    padding: 0px !important;
    height: 100%;
}

.planner-list-item-status .mud-select-input {
    height: var(--planner-item-height) !important;
}
/*.planner-list-item-status .mud-input-control.mud-input-control-margin-dense {
    margin: 0px !important;
}*/

.planner-list-item:hover {
    /*background-color: rgba(0, 0, 0, 0.2);*/
    background-color: var(--mab-primary-hover);
}

.add-new-planner-item-row {
    margin-left: var(--planner-subelement-margin-left);
}

.planner-list-item-expand {
    min-width: 20px;
}

    .planner-list-item-expand.haschildren button {
        color: currentColor;
        visibility: visible !important;
    }

    .planner-list-item-expand button {
        visibility: hidden !important;
        /*color: var(--mud-palette-gray-dark);*/
    }

/*.planner-list-item-expand button:has(:hover) {
    color: white !important;
    visibility: visible !important;
}*/

.planner-list-item-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    height: 20px;
    margin-right: -24px; /* Expand/contract icon */
    font-size: 12px;
    /*position: sticky;
    top: 48px;
    z-index: 9;
    background-color: var(--mud-palette-surface);*/
}
/* To show the sticky status header */
/*.planner .mud-collapse-wrapper {
    overflow: visible !important;
}*/


.planner-list-item.sidebar {
    min-width: 8px;
}

.planner-list-item-leftmenu {
    min-width: 24px;
    opacity: 0;
    /*pointer-events: none;*/
    transition: opacity 120ms ease;
    text-align: center
}
    /*.planner-list-item:hover .planner-list-item-leftmenu*/
    .planner-list-item-leftmenu:hover {
        opacity: 1;
        pointer-events: auto;
        cursor: pointer;
    }

.planner-list-item-icon {
    min-width: 20px;
    cursor: pointer;
    height: 20px;
}

    .planner-list-item-icon .mud-icon-root.mud-svg-icon {
        fill: var(--mud-palette-gray-dark);
    }

    .planner-list-item-icon:hover .mud-icon-root.mud-svg-icon {
        fill: white !important;
    }

.planner-list-item-work,
.planner-list-item-comment {
    cursor: pointer;
    min-width: 32px;
}

.planner-list-item-type {
    min-width: 32px;
}

.planner-list-item-name {
    min-width: 200px;
    flex-grow: 1;
}

.planner-list-item-reference {
    width: 125px;
    text-align: start;
}

.planner-list-item-info {
    width: 125px;
    text-align: start;
}

.planner-list-item-assignedto {
    width: 180px;
    text-align: start;
}

    .planner-list-item-assignedto .inherited .mud-input {
        color: dimgrey !important;
    }

    .planner-list-item-assignedto .assignedtome {
        background-color: #524d85C0 !important;
    }
/*.planner-list-item-assignedto .inherited.assignedtome {
    background-color: #524d8540 !important;
}
.planner-list-item-assignedto .assignedtome:not(.inherited) {
    background-color: #524d85C0 !important;
}*/
.planner-list-item-status {
    width: 180px;
    text-align: center;
}

.planner-list-item-menu {
    min-width: 30px;
}

.planner-list-item-deadline {
    width: 150px;
    text-align: start;
}

/* Drag-drop */
.drag-drop-item {
    cursor: grab;
}
/* /Drag-drop */

/* Multi search */
.multi-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .multi-search > .multi-search-panel {
        order: 2;
    }

        .multi-search > .multi-search-panel.loading {
            order: 1;
        }

        .multi-search > .multi-search-panel.has-results {
            order: 0;
        }
/* /Multi search */


/* HTML preview */
.html-preview-container {
    margin-top: 0.1em;
    border: none;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 0.5rem;
    height: 100px;
    overflow: auto;
}

    .html-preview-container.shadow {
        background-color: #ffffff;
        color: #000000;
        line-height: initial;
    }

    .html-preview-container.outlined {
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-radius: 5px;
    }

/* Email client */
.template-variable {
    display: inline-block;
    padding: 2px 6px;
    margin: 1px 2px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 500;
    background-color: #e0f2f1; /* Light teal */
    border: 1px solid #26a69a; /* Teal border */
    color: #00695c; /* Teal text */
    cursor: default;
    user-select: none;
    white-space: nowrap;
}

.email-address-box {
    background-color: rgba(173, 173, 177, 0.06);
    display: flex;
    gap: 8px;
    border-radius: 4px;
    width: 100%;
    margin-bottom: 2px;
}
    /* Evil hack */
    .email-address-box .mud-select button.mud-icon-button {
        padding-right: 16px !important;
    }

.email-address-field {
    margin: 0px !important;
}

    .email-address-field .mud-input-slot {
        padding: 0px !important;
    }

.email-preview-headers-panel {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 1em;
}

.email-preview-headers {
    display: flex;
    flex-direction: column;
    width: 100%;
}

    .email-preview-headers .email-preview-table {
        width: 100%;
        table-layout: fixed;
    }

        /* First column: label */
        .email-preview-headers .email-preview-table td:first-child {
            width: 100px;
            white-space: nowrap;
        }

        /* Second column: ellipsis */
        .email-preview-headers .email-preview-table td:nth-child(2) {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

            /* Because MudTooltip/MudMenu wrap the text, apply to inner span too */
            .email-preview-headers .email-preview-table td:nth-child(2) span {
                display: inline-block;
                max-width: 100%;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

.email-attachment-container {
    display: flex;
    flex-direction: row;
    gap: 0.5em;
    padding: 0em 1em;
    min-height: 65px;
    overflow: auto;
    flex-wrap: wrap;
}

.email-attachment-info-container {
    display: flex;
    flex-direction: row;
    border-radius: 5px;
    border: 1px solid var(--mab-datagrid-selected-background);
}

.email-attachment-icon {
    width: 100%;
    max-width: 1.5rem;
    max-height: 1.5rem;
    margin: 0.5em;
    object-fit: scale-down;
}

.email-folderstructure-folder {
    display: flex;
    width: 100%;
    align-items: center;
}

.email-attachment {
    display: flex;
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    flex: 0 0 auto;
    white-space: nowrap;
}

.email-folder-unread-endtext {
    font-weight: bold;
    margin-right: 8px;
}

.email-attachment-text-container {
    display: flex;
    flex-direction: column;
    padding-right: 0.75em;
    max-width: 200px;
}

    .email-attachment-text-container p {
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

.email-preview-body {
    margin-top: 0.1em;
    border: none;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

    .email-preview-body iframe {
        min-height: 100px;
        flex-grow: 1;
    }

.email-preview-container {
    display: flex;
    flex-direction: column;
    width: 100px;
    flex-grow: 1;
    height: 100%;
}

.email-list-item {
    display: flex;
    flex-direction: row;
    height: 60px;
    padding-top: 4px;
    padding-bottom: 4px;
}

    .email-list-item p {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

.email-list-item-header-line {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.email-list-item.unread .email-list-item-header-line {
    color: white;
    font-weight: bold;
}

.email-list-item.unread .email-list-item-subject-line {
    color: var(--mud-palette-primary);
    font-weight: bold;
}

.email-list-item.selected {
    background-color: var(--mud-palette-black);
    color: white;
}


.email-list-item-subject-line {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 0.8rem;
}

    .email-list-item-subject-line p:last-child {
        min-width: 75px;
    }


.email-list-item.unread-bar {
    width: 6px;
    min-width: 3px;
}

    .email-list-item.unread-bar.unread {
        background-color: #03A9F4;
    }

.email-list-item-content {
    margin-left: 0.5em;
    margin-right: 0.5em;
    justify-content: space-between;
    flex-grow: 1;
    flex-direction: column;
    width: 100%;
    min-width: 50px;
}


.email-list-item-content-header {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}


/* Notifications */
.notification-icon .mud-badge {
    inset: auto auto calc(100% - 19px) calc(100% - 12px) !important; /* Slight hack because the toolbar is slimmer than original */
}

.notification-container {
    display: flex;
    flex-direction: column;
    min-width: 100px;
    padding: 0.5em 0.5em;
    height: 100%;
    width: 100%;
}

.notification-item-container {
    max-height: 70vh;
    height: 100%;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 1em;
    align-items: center;
    flex-direction: row;
    padding: 0.5em;
    cursor: pointer;
    border-bottom: 1px solid var(--mud-palette-grey-light);
    /*max-height: 100px;*/
    height: 50px;
}

.notification-item-menu {
    display: none;
}

    .notification-item:hover .notification-item-menu,
    .notification-item-menu.active {
        display: unset;
    }

/* Call center */
@media only screen and (max-width: 720px) {
    .call-center-call-card {
        display: none;
    }
}

.call-center-call-card {
    width: 325px;
    margin-bottom: 1em;
    position: absolute;
}


/* Support case */
.support-case.active {
    background-color: #FFEE58 !important;
    color: #424242 !important;
}

.support-case.completed {
    background-color: #00E676 !important;
    color: #424242 !important;
}

/* Service claim*/
.service-claim.rejected,
.service-claim.finalrejected {
    background-color: #D50000 !important;
}

.service-claim.finalrejected,
.service-claim.deleted {
    text-decoration: line-through !important;
}

.service-claim.approved {
    background-color: #00C853 !important;
}

.service-claim.deleted {
    background-color: #9E9E9E !important;
}

.service-claim.senttoaccounting,
.service-claim.paid {
    background-color: #03A9F4 !important;
}


/* Document center */
.document-center-folder {
    display: inline-flex;
    width: 90px;
    padding: 5px;
    overflow: clip;
    max-height: 120px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
}

.document-center-list-header {
    display: flex;
    align-items: center;
    gap: 2px;
    border-bottom: 1px solid #808080;
}

.document-center-list-item {
    display: flex;
    cursor: pointer;
    align-items: center;
    flex-grow: 1;
    gap: 2px;
    /*word-break: break-all;*/
}

.document-center-list .mud-list-item {
    padding-right: 2px !important;
    padding-left: 2px !important;
}

.document-center-list-item div {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

    .document-center-list-item div.mud-tooltip-root {
        overflow: unset; /* Needed for progress bars on uploading files */
    }

.document-center-list .mud-list-item.mud-list-item-dense {
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}

.document-center-list .mud-list-item-text {
    margin: 0px !important;
}

.document-center-icon {
    width: 100%;
    max-width: 1.25rem;
    max-height: 1.25rem;
    margin-right: 0.5em;
    object-fit: scale-down;
}

    .document-center-icon.large {
        max-width: 3rem;
        max-height: 3rem;
    }

.document-center-favorite-item,
.email-favorite-item {
    cursor: pointer;
    padding: 2px 4px;
    align-items: center;
    display: flex;
}

    .document-center-favorite-item svg {
        font-size: 20px !important;
    }

.document-center-folderstructure-item {
    width: 100%;
}

    .document-center-folderstructure-item a {
        align-content: center;
    }

    .document-center-folderstructure-item.selected,
    .document-center-folderstructure-item.selected a {
        color: var(--mud-palette-tertiary);
        background-color: var(--mud-palette-tertiary-hover);
        text-decoration: underline;
    }

    .document-center-favorite-item.contextmenu,
    .document-center-folderstructure-item.contextmenu {
        border: 1px solid white;
    }

.document-center-folderstructure-dropzone {
    width: 100%;
    display: flex;
    gap: 4px;
}

    .document-center-folderstructure-dropzone.home:hover {
        background-color: var(--mud-palette-action-default-hover);
    }

.document-center-list-item.selected {
    background-color: var(--mud-palette-primary);
}

.document-center-list-item.highlighted {
    animation: documenthighlighted-fade 8s ease-out forwards;
    border: 1px solid rgba(129, 199, 132, 0.35);
}

@keyframes documenthighlighted-fade {
    0% {
        background-color: rgba(129, 199, 132, 0.22);
        box-shadow: 0 0 0 1px rgba(129, 199, 132, 0.25);
    }

    100% {
        background-color: transparent;
        box-shadow: none;
    }
}
