﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

* {
    box-sizing: border-box;
}
:root {
    --global-size: 16px;
    --vdm-surface-app: #f3f4f6;
    --vdm-surface-card: #ffffff;
    --vdm-surface-card-muted: #f8fafc;
    --vdm-surface-card-elevated: #ffffff;
    --vdm-border-card: #d9dde2;
    --vdm-radius-card: 5px;
    --vdm-shadow-card: 0 1px 2px rgba(17, 24, 39, 0.06), 0 4px 10px rgba(17, 24, 39, 0.04);
    --vdm-text-strong: #30343a;
    --vdm-text-muted: #606873;
    --vdm-accent-green: #1f9d45;
    --vdm-accent-green-hover: #18873a;
    --vdm-icon-muted: #4b5563;
    --vdm-icon-soft: #64748b;

}

.vdm-theme-light,
[data-vdm-theme="light"] {
    color-scheme: light;
    --vdm-surface-app: #f3f4f6;
    --vdm-surface-card: #ffffff;
    --vdm-surface-card-muted: #f8fafc;
    --vdm-surface-card-elevated: #ffffff;
    --vdm-border-card: #d9dde2;
    --vdm-shadow-card: 0 1px 2px rgba(17, 24, 39, 0.06), 0 4px 10px rgba(17, 24, 39, 0.04);
    --vdm-text-strong: #30343a;
    --vdm-text-muted: #606873;
    --vdm-icon-muted: #4b5563;
    --vdm-icon-soft: #64748b;
}

.vdm-theme-dark,
[data-vdm-theme="dark"] {
    color-scheme: dark;
    --vdm-surface-app: #141618;
    --vdm-surface-card: var(--dxds-color-surface-neutral-default-rest, var(--bs-body-bg, #202124));
    --vdm-surface-card-muted: rgba(255, 255, 255, 0.055);
    --vdm-surface-card-elevated: rgba(255, 255, 255, 0.075);
    --vdm-border-card: var(--dxds-color-border-neutral-default-rest, rgba(255, 255, 255, 0.18));
    --vdm-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.34), 0 8px 18px rgba(0, 0, 0, 0.24);
    --vdm-text-strong: var(--dxds-color-content-neutral-default-rest, #f3f4f6);
    --vdm-text-muted: var(--dxds-color-content-neutral-subtle-rest, #b8bec7);
    --vdm-icon-muted: #d1d5db;
    --vdm-icon-soft: #a7b0bd;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-size: var(--global-size);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.button-link {
    text-decoration: unset;
}

#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;
    }

.title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.625rem;
}

    .title.title-secondary {
        padding-top: 0.313rem;
        padding-bottom: 0;
        color: var(--bs-secondary-color, var(--dxds-color-content-neutral-default-rest));
    }

.title-header-text {
    font-size: 2.5rem;
    line-height: 3rem;
    font-weight: 600;
    letter-spacing: 0rem;
    padding: 0.3125rem 0;
}

.title-content-text {
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 2.5rem;
    letter-spacing: 0rem;
}

.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.block-content {
    width: 31.25rem;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 100%;

}

.icon {
    width: var(--icon-width, 1rem);
    height: var(--icon-height, 1rem);
    background-color: currentcolor;
    mask-position: center center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-image: var(--icon-mask-image);
    mask-image: var(--icon-mask-image);
    mask-size: cover;
}
/* Theme-aware bootstrap form controls (works across DevExpress themes) */
.form-control,
.form-select,
.form-check-input,
.input-group-text {
    background-color: var(--dxds-color-surface-neutral-default-rest, var(--bs-body-bg, #fff));
    color: var(--dxds-color-content-neutral-default-rest, var(--bs-body-color, #212529));
    border-color: var(--dxds-color-border-neutral-default-rest, var(--bs-border-color, #dee2e6));
}

.form-control::placeholder {
    color: var(--dxds-color-content-neutral-default-rest, var(--bs-secondary-color, #6c757d));
    opacity: 0.7;
}

.form-select:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
    border-color: var(--bs-primary, #0d6efd);
}

/* Custom facility dropdown (Portionen) */
.facility-select-button {
    background-color: var(--dxds-color-surface-neutral-default-rest, var(--bs-body-bg, #fff));
    color: var(--dxds-color-content-neutral-default-rest, var(--bs-body-color, #212529));
    border-color: var(--dxds-color-border-neutral-default-rest, var(--bs-border-color, #dee2e6));
}

.facility-select-panel {
    background-color: var(--dxds-color-surface-neutral-default-rest, var(--bs-body-bg, #fff));
    border: 1px solid var(--dxds-color-border-neutral-default-rest, var(--bs-border-color, #dee2e6));
    border-radius: 0.5rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, 0.15);
}

.facility-select-search {
    background-color: var(--dxds-color-surface-neutral-default-rest, var(--bs-body-bg, #fff));
    color: var(--dxds-color-content-neutral-default-rest, var(--bs-body-color, #212529));
    border-color: var(--dxds-color-border-neutral-default-rest, var(--bs-border-color, #dee2e6));
}

.facility-select-item {
    padding: 0.375rem 0.75rem;
    color: var(--dxds-color-content-neutral-default-rest, var(--bs-body-color, #212529));
}

.facility-select-item:hover {
    background-color: var(--dxds-color-surface-neutral-default-hovered, var(--bs-tertiary-bg, #f1f3f5));
}

.facility-select-empty {
    padding: 0.5rem 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
}



/* Ensure icon mask variables are set globally (drawer/menu may render outside scoped CSS). */
.icon-back { --icon-mask-image: var(--icon-back-mask-image); }
.icon-close { --icon-mask-image: var(--icon-close-mask-image); }
.icon-menu { --icon-mask-image: var(--icon-menu-mask-image); }
.icon-logout { --icon-mask-image: var(--icon-logout-mask-image); }
.icon-login { --icon-mask-image: var(--icon-login-mask-image); }
.icon-dashboard { --icon-mask-image: var(--icon-dashboard-mask-image); }
.icon-portionen { --icon-mask-image: var(--icon-portionen-mask-image); }
.icon-teilnehmer { --icon-mask-image: var(--icon-teilnehmer-mask-image); }
.icon-abrechnung { --icon-mask-image: var(--icon-abrechnung-mask-image); }
.icon-nachrichten { --icon-mask-image: var(--icon-nachrichten-mask-image); }
.icon-hilfe { --icon-mask-image: var(--icon-hilfe-mask-image); }
.icon-traffic { --icon-mask-image: var(--icon-traffic-mask-image); }
.icon-benutzer { --icon-mask-image: var(--icon-benutzer-mask-image); }

/* Bootstrap Icons sizing in menus */
.dxbl-menu .bi,
.dxbl-menu-item-icon .bi {
    font-size: 1rem;
    line-height: 1;
    display: inline-block;
}

.dashboard-grid-wrap {
    overflow-y: auto;
    max-height: calc(100vh - 320px);
}

.top-menu-host .search-menu-item .dxbl-menu-item-tmpl,
.top-menu-host .size-menu-item .dxbl-menu-item-tmpl {
    display: flex;
    align-items: center;
    height: 100%;
}

.top-menu-host .search-menu-item .dxbl-text-edit,
.top-menu-host .size-menu-item .dxbl-btn {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

@media (max-width: 768px) {
    .dxbl-grid .col-hide-sm {
        display: none !important;

    }
}

/* Global toolbar/flyout icon mapping (used across multiple Razor isolated components). */
.tb-icon,
.detail-icon {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex: 0 0 16px !important;
    display: inline-block !important;
    color: var(--vdm-icon-muted, #4b5563);
    background-color: currentColor !important;
    background-image: none !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    -webkit-mask-image: var(--vdm-icon-mask);
    mask-image: var(--vdm-icon-mask);
    -webkit-mask-position: center center;
    mask-position: center center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.tb-icon-add {
    --vdm-icon-mask: url("/images/add.svg");
}

.tb-icon-columns {
    --vdm-icon-mask: url("/images/Action_ColumnChooser.svg");
}

.tb-icon-refresh {    
    --vdm-icon-mask: url("/images/Action_Refresh.svg");    
}

.tb-icon-calendar {
    --vdm-icon-mask: url("/images/calendar.svg");
}

.tb-icon-more {
    --vdm-icon-mask: url("/images/Action_More.svg");
}

.tb-icon-clear {
    --vdm-icon-mask: url("/images/Action_Clear.svg");
}

.tb-icon-filter {
    --vdm-icon-mask: url("/images/filter.svg");
}

.tb-icon-export {
    --vdm-icon-mask: url("/images/Action_Export.svg");
}

.tb-icon-edit {
    --vdm-icon-mask: url("/images/Action_Edit.svg");
}

.tb-icon-delete {
    --vdm-icon-mask: url("/images/Action_Delete.svg");
}

.tb-icon-details {
    --vdm-icon-mask: url("/images/info.svg");
}

.tb-icon-route {
    --vdm-icon-mask: url("/images/Action_Navigation_Next_Object.svg");
}

.tb-icon-map {
    --vdm-icon-mask: url("/images/address.svg");
}

.tb-icon-dashboard {
    --vdm-icon-mask: url("/images/Action_Dashboard_Viewer.svg");
}

.tb-icon-facility {
    --vdm-icon-mask: url("/images/home.svg");
}

.tb-icon-form {
    --vdm-icon-mask: url("/images/list-bullets.svg");
}

.tb-icon-kst {
    --vdm-icon-mask: url("/images/insert-page-number.svg");
}

.tb-icon-person {
    --vdm-icon-mask: url("/images/BO_User.svg");
}

.tb-icon-location {
    --vdm-icon-mask: url("/images/address.svg");
}

.tb-icon-visit {
    --vdm-icon-mask: url("/images/car.svg");
}

.tb-icon-phone {
    --vdm-icon-mask: url("/images/BO_Phone.svg");
}

.tb-icon-mail {
    --vdm-icon-mask: url("/images/mail.svg");
}

.tb-icon-warning {
    --vdm-icon-mask: url("/images/State_Validation_Warning.svg");
}

.tb-icon-check {
    --vdm-icon-mask: url("/images/Action_MarkCompleted.svg");
}

.tb-icon-note {
    --vdm-icon-mask: url("/images/BO_Note.svg");
}

.detail-icon-close {
    --vdm-icon-mask: url("/images/Action_Close.svg");
}

.detail-icon-pin {
    --vdm-icon-mask: url("/images/pin-column.svg");
}

.detail-icon-unpin {
    --vdm-icon-mask: url("/images/unfix-column.svg");
}

.toolbar-icon-btn .dxbl-btn-text,
.detail-header-btn .dxbl-btn-text {
    display: none !important;
}

/* Force DevExpress icon spans to stay visible (overrides theme/CSS-order conflicts). */
.dxbl-btn-icon.tb-icon,
.dxbl-btn-icon.detail-icon,
.dxbl-btn .tb-icon,
.dxbl-btn .detail-icon {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    display: inline-block !important;
    background-color: currentColor !important;
    background-image: none !important;
    -webkit-mask-image: var(--vdm-icon-mask);
    mask-image: var(--vdm-icon-mask);
    -webkit-mask-position: center center;
    mask-position: center center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.dxbl-btn.vdm-btn-primary .tb-icon,
.dxbl-btn.vdm-btn-primary .detail-icon,
.dxbl-btn.dxbl-btn-primary .tb-icon,
.dxbl-btn.dxbl-btn-primary .detail-icon {
    color: #fff;
    filter: none;
}

.dxbl-btn.vdm-btn-primary:not(:disabled):not(.dxbl-disabled) {
    background-color: var(--vdm-accent-green, #1f9d45) !important;
    border-color: var(--vdm-accent-green, #1f9d45) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(31, 157, 69, 0.24);
}

.dxbl-btn.vdm-btn-primary:not(:disabled):not(.dxbl-disabled):hover {
    background-color: var(--vdm-accent-green-hover, #18873a) !important;
    border-color: var(--vdm-accent-green-hover, #18873a) !important;
}

/* DevExpress Fluent core adds drawer-body padding in core.min.css.
   Remove it specifically for our Einrichtung detail drawer. */
.entity-detail-drawer.dxbl-drawer > .dxbl-drawer-panel > .dxbl-drawer-body {
    padding: 0 !important;
}

/* Besuchsprotokoll-Popup im Dark Mode:
   DevExpress rendert das Popup teils ausserhalb des normalen Shell-Containers.
   Deshalb liegen die finalen Dark-Mode-Overrides global auf `.protocol-editor-popup`. */
[data-vdm-theme="dark"] .protocol-editor-popup .dxbl-popup-content,
[data-vdm-theme="dark"] .protocol-editor-popup .dxbl-popup-body {
    background:
        linear-gradient(180deg, rgba(20, 24, 28, 0.98), rgba(16, 18, 21, 0.98)),
        #181b1f !important;
    color: #f3f6f9 !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-editor-shell {
    background:
        linear-gradient(180deg, rgba(20, 24, 28, 0.98), rgba(16, 18, 21, 0.98)),
        #181b1f !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-editor-main {
    background: #25282d !important;
    color: #f3f6f9 !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-editor-side {
    background:
        radial-gradient(circle at 0% 12%, rgba(34, 197, 94, 0.14), transparent 26%),
        linear-gradient(180deg, rgba(20, 24, 28, 0.96), rgba(16, 18, 21, 0.98)),
        #202326 !important;
    background-color: #202326 !important;
    border-left-color: rgba(255, 255, 255, 0.1) !important;
    color: #f3f6f9 !important;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.04);
}

html[data-vdm-theme="dark"] body .protocol-editor-popup .protocol-editor-side,
html[data-vdm-theme="dark"] body .protocol-editor-popup aside.protocol-editor-side {
    background:
        radial-gradient(circle at 0% 12%, rgba(34, 197, 94, 0.14), transparent 26%),
        linear-gradient(180deg, rgba(20, 24, 28, 0.98), rgba(16, 18, 21, 1)),
        #202326 !important;
    background-color: #202326 !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-card {
    background: transparent !important;
    color: #f3f6f9 !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-editor-toolbar {
    background:
        radial-gradient(circle at 9% -15%, rgba(34, 197, 94, 0.46), transparent 38%),
        linear-gradient(160deg, rgba(15, 118, 110, 0.74) 0%, rgba(30, 64, 96, 0.9) 45%, rgba(15, 23, 42, 0.96) 100%) !important;
    border-color: rgba(255, 255, 255, 0.13) !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-editor-toolbar strong,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-card-header strong,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-item strong,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-link-placeholder strong {
    color: #f3f6f9 !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-editor-subtitle,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-editor-field label,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-card-header span,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-empty span,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-item small,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-link-placeholder {
    color: #c2c9d1 !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-card-header {
    padding: 0.1rem 0.1rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-scheduler,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-link-placeholder,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-item {
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-scheduler {
    background: rgba(255, 255, 255, 0.04) !important;
    background-color: #1d2126 !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-link-placeholder {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-item {
    background: rgba(255, 255, 255, 0.045) !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-item.protocol-status-geplant {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(15, 23, 42, 0.94) 58%),
        rgba(255, 255, 255, 0.045) !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-item.protocol-status-durchgefuehrt {
    background:
        linear-gradient(135deg, rgba(22, 163, 74, 0.32), rgba(15, 23, 42, 0.94) 58%),
        rgba(255, 255, 255, 0.045) !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-item.protocol-status-abgesagt,
[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-item.protocol-status-nicht_erfolgt {
    background:
        linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(15, 23, 42, 0.94) 58%),
        rgba(255, 255, 255, 0.045) !important;
}

[data-vdm-theme="dark"] .protocol-editor-popup .protocol-day-item.protocol-status-offen {
    background:
        linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(15, 23, 42, 0.94) 58%),
        rgba(255, 255, 255, 0.045) !important;
}

/* Fallback ohne Popup-Wrapper:
   Diese Klassen sind aktuell spezifisch fuer das Besuchsprotokoll-Popup.
   DevExpress kann Popups ausserhalb des erwarteten Wrappers rendern; deshalb
   ziehen wir die relevanten Dark-Mode-Flaechen hier nochmal direkt global. */
html[data-vdm-theme="dark"] .protocol-editor-side,
body[data-vdm-theme="dark"] .protocol-editor-side,
[data-vdm-theme="dark"] .protocol-editor-side {
    background:
        radial-gradient(circle at 0% 12%, rgba(34, 197, 94, 0.14), transparent 26%),
        linear-gradient(180deg, rgba(20, 24, 28, 0.98), rgba(16, 18, 21, 1)),
        #202326 !important;
    background-color: #202326 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f3f6f9 !important;
}

html[data-vdm-theme="dark"] .protocol-day-card,
[data-vdm-theme="dark"] .protocol-day-card {
    background: transparent !important;
    color: #f3f6f9 !important;
}

html[data-vdm-theme="dark"] .protocol-day-card-header,
[data-vdm-theme="dark"] .protocol-day-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-vdm-theme="dark"] .protocol-day-scheduler,
[data-vdm-theme="dark"] .protocol-day-scheduler {
    background: #1d2126 !important;
    background-color: #1d2126 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}

html[data-vdm-theme="dark"] .protocol-editor-toolbar,
[data-vdm-theme="dark"] .protocol-editor-toolbar {
    background:
        radial-gradient(circle at 9% -15%, rgba(34, 197, 94, 0.46), transparent 38%),
        linear-gradient(160deg, rgba(15, 118, 110, 0.74) 0%, rgba(30, 64, 96, 0.9) 45%, rgba(15, 23, 42, 0.96) 100%) !important;
    border-color: rgba(255, 255, 255, 0.13) !important;
}

html[data-vdm-theme="dark"] .protocol-editor-toolbar strong,
html[data-vdm-theme="dark"] .protocol-day-card-header strong,
html[data-vdm-theme="dark"] .protocol-link-placeholder strong,
[data-vdm-theme="dark"] .protocol-editor-toolbar strong,
[data-vdm-theme="dark"] .protocol-day-card-header strong,
[data-vdm-theme="dark"] .protocol-link-placeholder strong {
    color: #f3f6f9 !important;
}

html[data-vdm-theme="dark"] .protocol-editor-subtitle,
html[data-vdm-theme="dark"] .protocol-day-card-header span,
html[data-vdm-theme="dark"] .protocol-day-item small,
html[data-vdm-theme="dark"] .protocol-link-placeholder,
[data-vdm-theme="dark"] .protocol-editor-subtitle,
[data-vdm-theme="dark"] .protocol-day-card-header span,
[data-vdm-theme="dark"] .protocol-day-item small,
[data-vdm-theme="dark"] .protocol-link-placeholder {
    color: #c2c9d1 !important;
}

html[data-vdm-theme="dark"] .protocol-link-placeholder,
[data-vdm-theme="dark"] .protocol-link-placeholder {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}
