﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

article {
    height: calc(100vh - 70px);
}

/* The app reads the instance of the visitor before its first page renders, which is a round trip to the
   database, so the placeholder stands in for the page and is centered like it. */
.app-starting {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: #a5a5ad;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.dx-blazor-reporting-container {
    height: calc(100vh - 130px) !important;
    width: 100% !important;
}

/* Inside the tabbed prompt page the report designer fills the surface of its tab: the window height it
   is given on the pages that host it alone is taller than that surface, which cut off the input of its
   AI Assistant panel. */
.report-surface {
    position: relative;
}

.report-surface .dx-blazor-reporting-container {
    position: absolute;
    inset: 0;
    height: auto !important;
}

/* The toolbar of the report viewer is sticky and has no background of its own, so in the continuous
   preview the pages of the report would scroll under it. */
.dxbrv-toolbar {
    background-color: var(--app-page-background, #ffffff);
}

/* The instance of the visitor, above the prompt of the page: what the instance keeps, how long it is
   kept and when it was last used, with the button that starts a new one. It stays readable in the dark
   theme by using the page background it is drawn on and a translucent border. */
.sandbox-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(127, 127, 127, 0.35);
    border-radius: 0.35rem;
    background-color: rgba(127, 127, 127, 0.08);
}

.sandbox-bar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

/* Saving the instance sits next to starting a new one, because both are what the visitor does with the
   instance as a whole rather than with the report. */
.sandbox-bar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* The message that reports the result of saving the report as a .repx file: the report designer is a
   control of DevExpress and has no place of its own for it, so it is a notice over the page. */
.prompt-to-report-notice {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 2000;
    max-width: 30rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.35rem;
    background-color: #2b2b31;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-size: 0.9rem;
}

.prompt-to-report-notice-error {
    background-color: #7f1d1d;
}

/* The AI Assistant panel of the report designer: its text is set by the DevExtreme chat widget in the
   widget's fallback font list at 14px (and its prompt editor in the 11px size the designer gives the
   inputs of its properties panel), which reads small next to the rest of the page. The panel is a
   reading surface, so its text is enlarged a little and set in the system UI face the pages use. The
   selectors name the chain of ancestors of the panel, so they win over the widget rules that set the
   sizes; the font family is only set on the panel itself, so the icon glyphs keep the family of their
   own rules. */
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
}

/* Every widget of the chat (buttons, the message list, the prompt editor) carries the 14px size and the
   font list of the widget base class, so it is named as well; the icon glyphs are not widgets and keep
   the icon font of their own rules. */
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-widget {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
}

.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagebubble-content,
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagelist-empty-prompt,
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-tool-call-view {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
}

/* The prompt editor of the chat is an editor of the designer, so it keeps the 11px size of the
   properties panel without a rule of the chat widget to enlarge it. */
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-texteditor .dx-texteditor-input {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.35;
}

/* The small print of the chat (author and time of a message, day headers, captions) is 12px. */
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagegroup-author-name,
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagegroup-time,
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-message-edited,
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagelist-day-header,
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-typingindicator-text,
.dx-blazor-reporting .dxrd-designer-wrapper .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-editing-preview-caption {
    font-size: 13px;
}

/* The AI Assistant in the preview of the report designer: the tab of the assistant in the sidebar of the preview
   shows the chat of the design surface in a column beside the pages (see showPreviewAssistant in
   prompt-to-report.js), so the report stays on screen while the visitor writes what to change, and the panel is the
   panel of the designer, drawn the way the Design tool draws it. */
.designer-surface.dx-assistant-docked {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* The designer is the first column: as a flex item it would be measured by its content, so it is given the rest
   of the width. */
.designer-surface.dx-assistant-docked > .dx-blazor-reporting,
.designer-surface.dx-assistant-docked .dx-blazor-reporting-container {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    width: auto !important;
    height: 100% !important;
    min-width: 0;
}

.dxrd-assistant-dock {
    display: flex;
    flex-direction: column;
    /* The width of the panel of the design surface of the designer, so the chat is drawn in the column the way it is
       drawn there. */
    flex: 0 0 24.75rem;
    max-width: 45%;
    min-height: 0;
    overflow: hidden;
    border-left: 1px solid #d5d5d5;
    /* The designer is light-only, so the chat keeps the colors of its own light palette inside the dark page. */
    color: #333333;
    background-color: #ffffff;
}

/* The column is only drawn while the assistant is open. */
.dxrd-assistant-dock[hidden] {
    display: none;
}

/* The pull-down hint of the message list is an artifact of the scroll view of the chat that stays visible once
   the chat is drawn outside of the designer wrapper, so it is hidden here. */
.dxrd-assistant-dock .dx-scrollview-pull-down {
    display: none;
}

/* The column the assistant is drawn in, and the chain of the designer the chat is put into so it keeps the styles of
   the widget: the chat is a pane of the right panel of the designer, so its markup is drawn inside the same chain of
   elements the designer uses - only without the designer around it. */
.dxrd-assistant-dock > .p2r-assistant-scope {
    position: static !important;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.dxrd-assistant-dock .dxrd-designer-wrapper,
.dxrd-assistant-dock .dxrd-right-panel {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0;
    overflow: hidden;
}

/* The chat is a pane of that panel, positioned and sized by the rules of the panel; in the column it fills the
   column instead, with its prompt box at the bottom. */
.dxrd-assistant-dock .dxrd-ai-chat-tab {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    border: 0 !important;
    visibility: visible !important;
}

.dxrd-assistant-dock .dxrd-ai-chat-tab > .dxrd-properties-sub-wrapper,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat-container,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.dxrd-assistant-dock .dxrd-ai-chat-tab .dx-chat-messagelist {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* The chat leaves the designer wrapper when it is drawn in the column, so the enlarged typography it has inside the
   designer is given for the column as well: the panel is a reading surface wherever it is drawn. */
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-widget,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagebubble-content,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagelist-empty-prompt,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-tool-call-view,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-texteditor .dx-texteditor-input {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
}

.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagegroup-author-name,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagegroup-time,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-message-edited,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-messagelist-day-header,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-typingindicator-text,
.dxrd-assistant-dock .dxrd-ai-chat-tab .dxrd-ai-chat.dx-chat .dx-chat-editing-preview-caption {
    font-size: 13px;
}

/* The preview of the report: the viewer lays the pages of a multi-page report out next to each other
   (as many in a row as the window holds), which is its side by side preview. A continuous document
   stacks the pages instead: the surface of the viewer becomes a column of pages, each one centered.
   The margins of the pages are the ones of the viewer, only their auto value is set here, so a page
   that is wider than the window still starts at the left edge where it can be scrolled into view.
   The rules of the viewer name the ancestors of the surface and of a page, so the same chain is named
   here; a shorter selector would lose against them. */
.report-preview-continuous .dxbrv-wrapper .dxbrv-viewbox .dxbrv-surface-wrapper .dxbrv-document-surface {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.report-preview-continuous .dxbrv-wrapper .dxbrv-viewbox .dxbrv-surface-wrapper .dxbrv-document-surface .dxbrv-report-preview-content-flex-item {
    margin-left: auto;
    margin-right: auto;
}

/* The side-by-side preview is the wrapping row of pages of the viewer, made explicit so it does not depend on
   the way a browser breaks the line of inline-blocks. The pages are scaled by the factor of the variable:
   two pages and the gap between them are wider than the surface on every window that is not very wide, so the
   script measures the pane and fits the pages to it - which also takes out the few pixels by which Firefox
   and Chrome measure the line differently. The surface itself keeps the width the pane gives it, which is
   what the flex row wraps in; only the pages are scaled, so a page that is simply wide is fitted as well. */
.report-preview-side-by-side .dxbrv-wrapper .dxbrv-viewbox .dxbrv-surface-wrapper .dxbrv-document-surface {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
}

.report-preview-side-by-side .dxbrv-wrapper .dxbrv-viewbox .dxbrv-surface-wrapper .dxbrv-document-surface .dxbrv-report-preview-content-flex-item {
    flex: 0 0 auto;
    zoom: var(--p2r-side-by-side-zoom, 1);
}

/* The preview pane of the report designer has the same three previews as the Report tab, and the class is
   put on the designer by the View mode item of its toolbar. The multi-page preview of the designer lays its
   pages out next to each other, so a continuous document is made of its holder the same way the viewer's is:
   the pages become a column, each one centered in the pane. The margins of the pages are the ones of the
   designer, only their auto value is set here, so a page that is wider than the pane still starts at the
   left edge where it can be scrolled into view. */
.dxrd-designer-preview.dxrd-preview-continuous .dxrd-report-preview-holder {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.dxrd-designer-preview.dxrd-preview-continuous .dxrd-report-preview-holder .dxrd-report-preview {
    /* The designer sets the margins of the page of its multi-page preview from a rule of seven class names
       (".dx-blazor-reporting .dxrd-preview.dxrd-designer-wrapper .dxrd-preview-wrapper .dxrd-preview-surface
       .dxrd-report-preview-holder .dxrd-report-preview-multipage"), which out-specifies this one, so the auto
       margins that center a stacked page are declared important. */
    margin-left: auto !important;
    margin-right: auto !important;
}

/* The side-by-side preview of the designer scales the pages, not their holder: the holder keeps the width of
   the pane, which is what the pages wrap in, while each page is scaled by the factor the script measures.
   Scaling the holder itself would shrink the box the pages wrap in as well, which left them in one column. */
.dxrd-designer-preview.dxrd-preview-side-by-side .dxrd-report-preview-holder .dxrd-report-preview {
    zoom: var(--p2r-designer-side-by-side-zoom, 1);
}

/* The single/multi-page switch of the designer is not drawn: the View mode item of the page stands in its
   place, because the switch only toggles between one page and several and has no menu of the previews. The
   switch stays in the page all the same, because the item switches the preview of the designer with it. The
   declaration is important, because the designer shows and hides the items of its toolbar itself. */
[data-prompt-to-report-designer-toggle] {
    display: none !important;
}

/* The menu of the View mode item of the designer preview: the designer is a light control, so the menu is
   drawn in its colours, and it is a window above the page because the designer has no menu for the controls
   of the page. */
.prompt-to-report-view-menu {
    position: fixed;
    z-index: 2100;
    min-width: 11rem;
    padding: 0.25rem 0;
    border: 1px solid #d5d5d5;
    border-radius: 0.25rem;
    background-color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.prompt-to-report-view-menu-item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0.35rem 0.9rem 0.35rem 1.9rem;
    border: 0;
    background-color: transparent;
    color: #333333;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.prompt-to-report-view-menu-item:hover {
    background-color: #eef1f6;
}

/* The entry of the preview on screen carries the same mark the menu of the viewer uses. */
.prompt-to-report-view-menu-item-current::before {
    content: '✓';
    position: absolute;
    left: 0.7rem;
}

/* The formats field of the email dialog is a drop-down box whose body holds a list box of the four formats.
   A list box is as tall as its own window and scrolls inside it, so the body of this one is made as tall as
   its entries: the four formats are always visible without a scroll bar. The theme of DevExpress is loaded
   after this sheet and sets the height on ".dxbl-list-box", and the body of a drop-down is drawn outside the
   dialog, so the class of the field is paired with the one of the list box instead of with its parent. */
.dxbl-list-box.email-report-formats,
.dxbl-list-box.email-report-formats .dxbl-scroll-viewer {
    height: auto;
}