/* Inter (variable font, weights 100-900), bundled with the application: no request to the internet. License: fonts/Inter-LICENSE.txt (SIL Open Font License 1.1). */
/* inter-cyrillic-ext-wght-normal */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-cyrillic-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

/* inter-cyrillic-wght-normal */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

/* inter-greek-ext-wght-normal */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-greek-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+1F00-1FFF;
}

/* inter-greek-wght-normal */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-greek-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

/* inter-vietnamese-wght-normal */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-vietnamese-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

/* inter-latin-ext-wght-normal */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* inter-latin-wght-normal */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* =====================================================================
   AtomOne layout
   ===================================================================== */
:root {
    --app-topbar-height: 49px;           /* 48px bar + 1px border */
    --app-sidebar-collapsed: 48px;
    --app-sidebar-expanded: 276px; /* wide enough for the longest view name in the selector */

    --app-link: #1D5FD6;
    --app-link-hover: #1747A6;
    --app-link-underline: rgba(29, 95, 214, .35);
}

/* Set on <MudLayout> by MainLayout when dark mode is on. Also for everything outside the layout (tooltips and other
   popovers are rendered by MudBlazor next to it, e.g. the links in the tooltip of an entity link). */
.app-dark,
body:has(.app-dark) {
    --app-link: #8AB4F8;
    --app-link-hover: #AECBFA;
    --app-link-underline: rgba(138, 180, 248, .4);
}

body {
    font-feature-settings: "cv11", "ss01";   /* Inter: cleaner digits/letters */
    -webkit-font-smoothing: antialiased;
}

/* ---------- Top bar ---------- */
.topbar.mud-appbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    display: block;
    width: 32px;
    height: 32px;
}

.brand-name {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--mud-palette-text-primary);
}

.user-activator {
    cursor: pointer;
    padding: 4px 6px 4px 10px;
    border-radius: 4px;
}

.user-activator:hover {
    background: var(--mud-palette-action-default-hover);
}

.user-name {
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--mud-palette-text-primary);
}

.user-role {
    font-size: .75rem;
    line-height: 1.2;
    color: var(--mud-palette-text-secondary);
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 600;
    background: var(--mud-palette-background-gray);
    color: var(--mud-palette-text-secondary);
    border: 1px solid var(--mud-palette-lines-default);
}

.user-caret {
    color: var(--mud-palette-text-secondary);
}

/* ---------- Body: sidebar + content ---------- */
.app-main {
    padding-top: var(--app-topbar-height);
}

.app-body {
    display: flex;
    min-height: calc(100vh - var(--app-topbar-height));
}

/* Sidebar: always visible. Collapsed = only the expand button; expanded = button + menu. */
.sidebar {
    position: sticky;
    top: var(--app-topbar-height);
    height: calc(100vh - var(--app-topbar-height));
    flex: 0 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--mud-palette-drawer-background);
    border-right: 1px solid var(--mud-palette-lines-default);
    transition: width .15s ease;
}

.sidebar.collapsed {
    width: var(--app-sidebar-collapsed);
}

.sidebar.expanded {
    width: var(--app-sidebar-expanded);
}

.sidebar-toggle {
    display: flex;
    justify-content: center;
    padding: 8px;
}

.sidebar.expanded .sidebar-toggle {
    justify-content: flex-end;
}

.sidebar-toggle-btn.mud-icon-button {
    color: var(--mud-palette-text-secondary);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    padding: 3px;
}

.sidebar-toggle-btn.mud-icon-button:hover {
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-action-default-hover);
}

.menu-section {
    display: block;
    padding: 14px 16px 4px 16px;
    color: var(--mud-palette-text-secondary);
}

/* Menu items: compact, neutral; active item gets a thin accent bar. */
.sidebar .mud-nav-link {
    align-items: center;
    line-height: 1.5;
    padding: 6px 16px 6px 13px;
    margin: 1px 0;
    border-left: 3px solid transparent;
    font-size: .875rem;
    color: var(--mud-palette-drawer-text);
}

.sidebar .mud-nav-link .mud-nav-link-icon {
    font-size: 1.15rem;
    color: var(--mud-palette-drawer-icon);
}

.sidebar .mud-nav-link:hover:not(.active) {
    background: var(--mud-palette-action-default-hover);
}

.sidebar .mud-nav-link.active:not(.mud-nav-link-disabled) {
    border-left-color: var(--mud-palette-primary);
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-primary);
    font-weight: 600;
}

.sidebar .mud-nav-link.active .mud-nav-link-icon {
    color: var(--mud-palette-primary);
}

.content {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- General component tuning ---------- */
.mud-paper:not(.mud-popover) {
    box-shadow: none;
    border: 1px solid var(--mud-palette-lines-default);
}
/* =====================================================================
   List / detail pages (e.g. CRM): list panel next to the menu + detail area
   ===================================================================== */
.list-detail {
    display: flex;
    height: calc(100vh - var(--app-topbar-height));
}

.list-pane {
    flex: 0 0 320px;
    width: 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--mud-palette-surface);
    border-right: 1px solid var(--mud-palette-lines-default);
}

.list-pane-header {
    padding: 12px 12px 4px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.list-pane-header .mud-input-control {
    margin-top: 12px !important;
}

.list-pane-header .mud-input {
    font-size: .875rem;
}

.list-count {
    padding: 8px 2px 4px 2px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* Segmented switch (Organizations | Persons) */
.segmented {
    display: flex;
    padding: 3px;
    border-radius: 6px;
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-lines-default);
}

.segmented a {
    flex: 1 1 0;
    text-align: center;
    text-decoration: none;
    padding: 5px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font: inherit;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

.segmented a:hover:not(.active) {
    color: var(--mud-palette-text-primary);
}

.segmented a.active {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}

/* Entries */
.list-items {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 4px 0;
}

.list-item {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 8px 12px 8px 9px;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.list-item:hover {
    background: var(--mud-palette-action-default-hover);
}

.list-item.selected {
    background: var(--mud-palette-action-default-hover);
    border-left-color: var(--mud-palette-primary);
}

.list-item-avatar {
    flex: 0 0 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-text-secondary);
}

.list-item-avatar.round {
    border-radius: 50%;
}

.list-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.list-item-title,
.list-item-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-title {
    font-size: .875rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

.list-item-sub {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.list-empty {
    padding: 24px 12px;
    font-size: .8125rem;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

/* Detail area */
.detail-pane {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    padding: 20px 24px;
}

.detail-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--mud-palette-text-secondary);
}

/* Country flag (4:3) */
.flag {
    width: 16px;
    height: 12px;
    margin-right: 6px;
    vertical-align: -1px;
    border-radius: 1px;
    /* fine edge drawn INSIDE the image, so the flag lines up exactly with text and borders */
    outline: 1px solid rgba(15, 23, 42, .12);
    outline-offset: -1px;
    object-fit: cover;
}

/* Module title at the top of a list panel (visible even with the menu collapsed) */
.module-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;                    /* 30px "+" button + 14px padding: same height with and without a button */
    box-sizing: border-box;
    padding: 2px 2px 12px 2px;
    color: var(--mud-palette-text-primary);
}

.module-title .mud-icon-root {
    color: var(--mud-palette-primary);
}

.module-title h1 {
    margin: 0;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.3;
}

/* Tabs in the detail area: white card on the grey content background */
.tab-card {
    margin-top: 16px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 0 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.tabs button {
    padding: 8px 12px;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    font: inherit;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

.tabs button:hover:not(.active) {
    color: var(--mud-palette-text-primary);
}

.tabs button.active {
    color: var(--mud-palette-primary);
    border-bottom-color: var(--mud-palette-primary);
}

.tab-content {
    padding: 16px;
}

.tab-empty {
    padding: 16px 0;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

/* Read-only field list: label column + value column */
.fields {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px 16px;
    margin: 0;
    max-width: 720px;
    font-size: .875rem;
}

.fields dt {
    color: var(--mud-palette-text-secondary);
}

/* Settings → Customization: the fields on the page (read-only until Edit), one below the other */
.customization-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 480px;
}

/* Read-only fields (not editing): frame kept, no arrow, a light grey fill, normal cursor; in Edit they become normal
   outlined dropdowns, so the difference is obvious. */
.customization-fields.read-only .mud-input.mud-input-outlined {
    background: color-mix(in srgb, var(--mud-palette-background-gray) 50%, var(--mud-palette-surface));
    border-radius: var(--mud-default-borderradius);
}

.customization-fields.read-only .mud-input-adornment-end {
    display: none;
}

.customization-fields.read-only .mud-input,
.customization-fields.read-only .mud-input * {
    cursor: default !important;
}

.customization-intro {
    margin: 0;
    color: var(--mud-palette-text-secondary);
}

.fields dd {
    margin: 0;
    color: var(--mud-palette-text-primary);
}

/* Simple list inside a tab */
.simple-list {
    max-width: 720px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
}

.simple-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.simple-list-item + .simple-list-item {
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* Tables inside a card: no own border, compact header and toolbar */
.table-flat.mud-paper {
    border: 0;
    background: transparent;
}

.table-flat .mud-toolbar {
    padding: 0 0 12px 0;
    height: auto;
    min-height: 0;
}

.table-search {
    max-width: 320px;
}

.table-search .mud-input {
    font-size: .875rem;
}

.table-count {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.table-flat .table-head .mud-table-cell {
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background);
}

.table-flat .mud-table-cell {
    font-size: .875rem;
}

.table-flat .mud-table-pagination {
    border-top: 1px solid var(--mud-palette-table-lines);
}

/* Links: clearly recognizable blue with a subtle underline that firms up on hover */
.table-link {
    color: var(--app-link);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--app-link-underline);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color .1s ease, text-decoration-color .1s ease;
}

.table-link:hover {
    color: var(--app-link-hover);
    text-decoration-color: currentColor;
}

.table-link:focus-visible {
    outline: 2px solid var(--app-link);
    outline-offset: 2px;
    border-radius: 2px;
}
/* Fixed column widths (set via <ColGroup>): columns don't jump when data changes */
.table-flat table {
    table-layout: fixed;
    width: 100%;
}

.table-flat .mud-table-body .mud-table-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* =====================================================================
   Full-height detail area: title (natural height) + tab card filling the rest.
   Inside a .table-fill table, only the rows scroll; toolbar, column headers
   and pager stay in place.
   ===================================================================== */
.detail-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.detail-empty {
    flex: 1 1 auto;
    height: auto;
}

.tab-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tab-card .tabs {
    flex: 0 0 auto;
}

.tab-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.table-fill.mud-table {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.table-fill .mud-toolbar,
.table-fill .mud-table-pagination {
    flex: 0 0 auto;
}

.table-fill .mud-table-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.table-fill.mud-table .mud-table-head .mud-table-cell {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--mud-palette-background);
}
/* Back / Forward buttons in the top bar, separated from the brand by a thin divider */
.history-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 20px;
    padding-left: 12px;
    border-left: 1px solid var(--mud-palette-lines-default);
    height: 24px;
}

.history-buttons .mud-icon-button {
    color: var(--mud-palette-text-secondary);
}

.history-buttons .mud-icon-button:hover:not(.mud-disabled) {
    color: var(--mud-palette-text-primary);
}
/* =====================================================================
   Info groups (e.g. OVERVIEW tab): titled sections, always full width
   ===================================================================== */
.info-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-group {
    width: 100%;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-surface);
}

.info-group-header {
    padding: 8px 14px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px 4px 0 0;
}

.info-group-body {
    padding: 14px;
}

.info-group .fields {
    max-width: none;
}

.group-empty {
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

/* Field list in edit mode: labels vertically centred on the inputs */
.fields.editing {
    align-items: center;
}

.fields.editing dd {
    max-width: 480px;
}

.fields.editing .mud-input-control {
    margin: 0;
}

.fields.editing .mud-input {
    font-size: .875rem;
}

.field-short {
    max-width: 180px;
}
/* Small neutral label (e.g. tag type); .badge-accent = tinted with the primary colour */
.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-lines-default);
}

.badge-accent {
    color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), .08);
    border-color: rgba(var(--mud-palette-primary-rgb), .25);
}

/* Centered table columns (e.g. yes/no) */
.table-flat .mud-table-cell.cell-center {
    text-align: center;
}

.yes-icon {
    color: var(--mud-palette-primary);
    vertical-align: middle;
}

.no-dash {
    color: var(--mud-palette-text-disabled);
}

.tag-name {
    font-weight: 500;
}
/* Row action buttons (edit / delete) */
.table-flat .mud-table-body .mud-table-cell.cell-actions {
    text-align: right;
    overflow: visible;
    padding-top: 0;
    padding-bottom: 0;
}

.cell-actions .mud-icon-button {
    color: var(--mud-palette-text-secondary);
}

.cell-actions .mud-icon-button:hover {
    color: var(--mud-palette-text-primary);
}

.cell-actions .action-danger:hover {
    color: var(--mud-palette-error);
}

/* the "more actions" menu (⋮) sits in line with the other row buttons; an invisible one keeps them in place where it has no items */
.cell-actions .row-menu {
    display: inline-flex;
    vertical-align: middle;
}

.cell-actions .action-placeholder {
    visibility: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Dialogs */
.app-dialog .mud-dialog-title {
    font-size: 1.0625rem;
    font-weight: 600;
    padding-bottom: 4px;
}

.dialog-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 4px;
}

.dialog-form .mud-input {
    font-size: .875rem;
}

/* Dialogs with tabs: as tall as their first tab, whichever tab is shown - switching tabs does not change the height.
   The first tab stays in the layout (invisible while another one is shown); the other tabs lie on top of it, fill its
   height and scroll inside it if they need more. */
.tab-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

    .tab-panels > * {
        grid-area: 1 / 1;
    }

    .tab-panels > .tab-panel-inactive {
        visibility: hidden;
    }

    .tab-panels > :not(.tab-panel-main) {
        contain: size;
        overflow-y: auto;
    }

    /* (in a stretched column the inputs of MudBlazor would grow and spread the fields apart: they keep their height) */
    .tab-panels > :not(.tab-panel-main) > * {
        flex-grow: 0;
    }

    /* the event's AUDIT LOG fills the height (its list scrolls) */
    .tab-panels > .event-dialog-audit {
        height: auto;
    }

.dialog-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 2px;
}

.dialog-error {
    font-size: .75rem;
    color: var(--mud-palette-error);
    margin-top: 2px;
}

/* a warning in a dialog (e.g. the resource is blocked in the planned time) - saving is still possible */
.dialog-warning {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 4px;
    padding: 6px 10px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--mud-palette-warning) 12%, transparent);
    color: var(--mud-palette-text-primary);
    font-size: .8125rem;
    line-height: 1.4;
}

    .dialog-warning .mud-icon-root {
        flex: none;
        margin-top: 1px;
        color: var(--mud-palette-warning-darken);
    }

.app-dialog .mud-dialog-actions {
    padding: 8px 24px 16px 24px;
    gap: 8px;
}
/* Dropdown lists (autocomplete, select, menus): compact rows */
.mud-popover .mud-list-item {
    min-height: 0;
    padding-top: 6px;
    padding-bottom: 6px;
}

.mud-popover .mud-list-item .mud-typography,
.mud-popover .mud-list-item-text {
    font-size: .875rem;
    line-height: 1.4;
    margin-top: 0;
    margin-bottom: 0;
}

.mud-popover .mud-list {
    padding-top: 4px;
    padding-bottom: 4px;
}
/* Checkbox and radio labels: same size as input text */
.mud-checkbox .mud-typography,
.mud-radio .mud-typography {
    font-size: .875rem;
}
/* Text in outlined input fields WITH a label sits 2px lower (same field height: +2px top, -2px bottom).
   Fields without a label (e.g. search) keep the text exactly centered. */
.mud-input.mud-input-outlined.mud-input-outlined-with-label > input.mud-input-root-outlined.mud-input-root-margin-dense,
.mud-input.mud-input-outlined.mud-input-outlined-with-label > textarea.mud-input-root-outlined.mud-input-root-margin-dense {
    padding-top: 12.5px;
    padding-bottom: 8.5px;
}
/* Labels of outlined fields: 14px inside the empty field (= input text size, aligned with
   the text position above), 12px when floating on the border (14px * 0.857). */
.mud-input-label-outlined.mud-input-label-margin-dense {
    transform: translate(14px, 10.2px) scale(1); /* label line (18.4px) centred in the 37.6px field */
}

/* MudBlazor sets the label size via the subtitle1 typography (16px) with a long selector */
.mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol.mud-input-label-outlined.mud-input-label-margin-dense {
    font-size: .875rem;
}
/* (only compact fields: the label of normal-size fields keeps MudBlazor's size, which matches the gap in the border) */

.mud-input-control .mud-shrink ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined.mud-input-label-margin-dense,
.mud-input-control .mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined.mud-input-label-margin-dense,
.mud-input-control .mud-input:has(:-webkit-autofill) ~ label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined.mud-input-label-margin-dense {
    transform: translate(14px, -7px) scale(0.857);
    max-width: calc((100% - 14px) / .857);
}
/* Audit: action labels and details dialog */
.badge.audit-add {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .3);
}

.badge.audit-edit {
    color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), .08);
    border-color: rgba(var(--mud-palette-primary-rgb), .25);
}

.badge.audit-delete {
    color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), .07);
    border-color: rgba(var(--mud-palette-error-rgb), .3);
}

.badge.audit-add,
.badge.audit-edit,
.badge.audit-delete {
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .04em;
}

.audit-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.audit-meta-name {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.audit-meta-sep {
    color: var(--mud-palette-text-disabled);
}

.audit-changes {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    border: 1px solid var(--mud-palette-lines-default);
}

.audit-changes th {
    text-align: left;
    padding: 6px 12px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.audit-changes td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    vertical-align: middle;
}

.audit-changes tr:last-child td {
    border-bottom: 0;
}

.audit-field {
    width: 38%;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

.audit-old {
    color: var(--mud-palette-text-secondary);
    text-decoration: line-through;
    text-decoration-color: rgba(var(--mud-palette-error-rgb), .5);
}

.audit-new {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.audit-arrow {
    width: 28px;
    padding-left: 0 !important;
    padding-right: 0 !important;
    color: var(--mud-palette-text-disabled);
}
/* =====================================================================
   Filter panel (e.g. Auditing): grouped filters in the list pane
   ===================================================================== */
.filter-pane {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 4px 12px 16px 12px;
}

.filter-group {
    padding: 12px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.filter-group:last-of-type {
    border-bottom: 0;
}

.filter-label {
    margin-bottom: 8px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

/* a filter group's heading that folds the group away (FilterGroup) */
.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* buttons centre their content by default */
    gap: 2px;
    width: 100%;
    margin-left: -4px;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

    .filter-toggle:hover {
        color: var(--mud-palette-text-primary);
    }

    .filter-toggle:focus-visible {
        outline: 2px solid var(--mud-palette-primary);
        outline-offset: 2px;
        border-radius: 2px;
    }

    .filter-toggle .filter-hint {
        margin-left: 4px;
    }

.filter-toggle-icon.mud-icon-root {
    font-size: 1.125rem;
}

.filter-group-collapsed .filter-toggle {
    margin-bottom: 0;
}

.filter-hint {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--mud-palette-text-disabled);
}

.filter-presets {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.filter-presets button {
    flex: 1 1 0;
    padding: 4px 6px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-surface);
    font: inherit;
    font-size: .75rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

.filter-presets button:hover:not(.active) {
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-action-default-hover);
}

.filter-presets button.active {
    color: var(--mud-palette-primary);
    border-color: rgba(var(--mud-palette-primary-rgb), .45);
    background: rgba(var(--mud-palette-primary-rgb), .07);
    font-weight: 600;
}

.filter-dates {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-dates .mud-input {
    font-size: .875rem;
}

.filter-check {
    display: flex;
    width: 100%;
    margin: 0;
}

.filter-check .mud-checkbox {
    width: 100%;
}

.filter-check label,
.filter-check .mud-typography {
    flex: 1 1 auto;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    font-size: .875rem;
}

.filter-option .mud-icon-root {
    color: var(--mud-palette-text-secondary);
}

.filter-count {
    margin-left: auto;
    padding-left: 8px;
    font-size: .75rem;
    color: var(--mud-palette-text-disabled);
}

.filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--app-link);
    cursor: pointer;
}

.filter-reset:hover {
    color: var(--app-link-hover);
    text-decoration: underline;
}

/* Record type with icon (audit tables) */
.type-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.type-label .mud-icon-root {
    color: var(--mud-palette-text-secondary);
}
/* Date picker header: compact (MudBlazor default: 100px high, date at 34px) */
.mud-picker .mud-picker-toolbar.mud-picker-datepicker-toolbar {
    height: auto;
    padding: 10px 16px;
}

.mud-picker .mud-picker-datepicker-toolbar .mud-button-year {
    font-size: .8125rem;
    line-height: 1.4;
    opacity: .85;
}

.mud-picker .mud-picker-datepicker-toolbar .mud-button-date {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Type icon in tables: same line height as the other cells */
.type-label {
    vertical-align: middle;
    line-height: 1.2;
}

.type-label .mud-icon-root {
    font-size: 1.05rem;
}

/* Tables always span the full width, also without rows. MudBlazor's "no records" row is one cell with colspan=1000:
   with the fixed layout that makes 1000 columns, and the invisible ones eat the width of the flexible column, so the
   header ends early. Empty tables therefore use the automatic layout, in which unused columns shrink to nothing. */
.table-flat .mud-table-container > table {
    width: 100%;
    min-width: 100%;
}

.table-flat .mud-table-container > table:has(> tbody > tr > [colspan="1000"]) {
    table-layout: auto;
}

/* Segmented switch with <button>s (same look as the <a> variant above) */
.segmented button {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font: inherit;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

.segmented button .mud-icon-root {
    font-size: 1rem;
}

.segmented button:hover:not(.active) {
    color: var(--mud-palette-text-primary);
}

.segmented button.active {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}

/* Profile menu (top right) */
.profile-menu {
    width: 248px;
    padding: 8px 12px 10px 12px;
}

.profile-section + .profile-section {
    margin-top: 12px;
}

.profile-label {
    margin-bottom: 6px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.profile-hint {
    margin-top: 6px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* User menu trigger is a <button>: reset native button styling */
button.user-activator {
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: right;
}

button.user-activator:focus-visible {
    outline: 2px solid var(--app-link);
    outline-offset: 2px;
}

/* Two fields side by side in a dialog (e.g. postal code + city) */
.dialog-row {
    display: flex;
    gap: 12px;
}

.dialog-row > * {
    flex: 1 1 0;
    min-width: 0;
}

.dialog-row > .dialog-col-short {
    flex: 0 0 140px;
}

/* Button in the module title row (e.g. "New Organization") */
.module-title .mud-button-root {
    font-size: .8125rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Icons inside buttons in the module title keep the button's text colour (not the navy module icon colour) */
.module-title .mud-button-root .mud-icon-root {
    color: inherit;
}

/* Date/time cells: equal-width digits so all times have the same width and line up */
.cell-time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Read-only field (e.g. preset organization): muted background, no focus highlight */
.field-readonly .mud-input {
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-secondary);
}

.field-readonly .mud-input input {
    cursor: default;
}

.field-readonly .mud-input-adornment .mud-icon-root {
    font-size: 1.1rem;
    color: var(--mud-palette-text-disabled);
}

.field-readonly .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-width: 1px;
    border-color: var(--mud-palette-lines-inputs);
}

.field-readonly .mud-input:focus-within ~ label.mud-input-label {
    color: var(--mud-palette-text-secondary);
}

/* Info group header with actions on the right */
.info-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.info-group-actions .mud-button-root {
    font-size: .75rem;
    letter-spacing: .02em;
    padding: 2px 8px;
    min-height: 0;
}

/* Category headings inside a dropdown menu */
.menu-group-label {
    padding: 8px 16px 2px 16px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

/* Assigned tags as removable chips */
.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px 2px 10px; /* 1px at the top: the text sits optically centred */
    border-radius: 12px;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-lines-default);
}

.tag-chip-accent {
    color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), .07);
    border-color: rgba(var(--mud-palette-primary-rgb), .25);
}

.tag-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* even sizes (14px circle, 12px icon) so the X sits exactly in the middle of the hover circle */
    width: 14px;
    height: 14px;
    margin-left: 2px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    /* icon and circle together slightly lower than the line centre: optically centred on the text */
    transform: translateY(.5px);
}

.tag-chip-remove .mud-icon-root {
    width: 12px;
    height: 12px;
    font-size: 12px;
}

.tag-chip-remove:hover {
    color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), .1);
}

.tag-chip-remove:focus-visible {
    outline: 2px solid var(--app-link);
}

/* Assign Tags dialog: search + scrollable, grouped list with checkboxes */
.assign-search {
    margin-bottom: 8px;
}

.assign-search .mud-input {
    font-size: .875rem;
}

.assign-list {
    height: 340px;
    overflow-y: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    padding: 4px 0;
}

.assign-group {
    position: sticky;
    top: -4px;
    z-index: 1;
    padding: 8px 12px 4px 12px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-surface);
}

.assign-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    font-size: .875rem;
    cursor: pointer;
}

.assign-item:hover {
    background: var(--mud-palette-action-default-hover);
}

.assign-item.selected {
    background: rgba(var(--mud-palette-primary-rgb), .06);
}

.assign-item input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--mud-palette-primary);
    cursor: pointer;
}

.assign-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assign-empty,
.assign-more {
    padding: 16px 12px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
    text-align: center;
}

.assign-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.assign-clear {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--app-link);
    cursor: pointer;
}

.assign-clear:hover {
    text-decoration: underline;
}

/* Assigned tags grouped by category, collapsible */
.tag-groups {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tag-group-header {
    display: flex;
    justify-content: flex-start; /* buttons centre their content by default */
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 4px 6px 4px 2px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font: inherit;
    text-align: left;
    color: var(--mud-palette-text-primary);
    cursor: pointer;
}

.tag-group-header:hover {
    background: var(--mud-palette-action-default-hover);
}

.tag-group-header:focus-visible {
    outline: 2px solid var(--app-link);
    outline-offset: 1px;
}

.tag-group-arrow.mud-icon-root {
    font-size: 1.125rem;
    color: var(--mud-palette-text-secondary);
}

.tag-group-name {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.tag-group-count {
    min-width: 18px;
    padding: 0 6px;
    border-radius: 9px;
    font-size: .6875rem;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-lines-default);
}


.tag-group-chips {
    padding: 4px 0 8px 26px;
}

/* Page title row of a detail view: title left, actions (Edit / Cancel / Save) right */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 34px;
}

.detail-header .mud-typography-h4 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* Roles: rules (AND) with alternatives (OR) */
.rule-hint {
    margin-bottom: 12px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.rule-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.rule-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-surface);
}

.rule-and {
    margin: 4px 0 4px 12px;
    padding: 1px 8px;
    border-radius: 9px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), .08);
}

.rule-or {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--mud-palette-text-secondary);
}

.rule-empty {
    font-size: .8125rem;
    font-style: italic;
    color: var(--mud-palette-warning);
}

.rule-add-or {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px 2px 4px;
    border: 1px dashed var(--mud-palette-lines-inputs);
    border-radius: 12px;
    background: transparent;
    font: inherit;
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

.rule-add-or .mud-icon-root {
    font-size: .875rem;
}

.rule-add-or:hover {
    color: var(--app-link);
    border-color: var(--app-link);
}

.rule-add-or:focus-visible {
    outline: 2px solid var(--app-link);
    outline-offset: 1px;
}

/* Destructive outlined button (e.g. Delete) */
.button-danger.mud-button-root:hover {
    color: var(--mud-palette-error);
    border-color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), .06);
}

/* Multi-line text in read-only fields (keeps line breaks) */
.multiline {
    white-space: pre-line;
}

.dialog-hint {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

/* "← Back" link above a detail title (e.g. Settings → Roles → one role) */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--app-link);
    text-decoration: none;
}

.back-link .mud-icon-root {
    font-size: 1rem;
}

.back-link:hover {
    text-decoration: underline;
}

.text-muted {
    color: var(--mud-palette-text-secondary);
}

/* Arrow between "Before" and "After": a block element, so the cell centres it vertically */
.audit-arrow .mud-icon-root {
    display: block;
    margin: 0 auto;
    font-size: 1.125rem;
}

/* Roles of a person: green = all required qualifications assigned, red = something missing */
.person-roles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.person-role {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px 2px 8px;
    border-radius: 12px;
    border: 1px solid;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.4;
}

.role-chip-met {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .35);
}

.role-chip-missing {
    color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), .06);
    border-color: rgba(var(--mud-palette-error-rgb), .35);
}

.role-chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.role-chip-toggle:hover {
    text-decoration: underline;
}

.role-chip-toggle:focus-visible {
    outline: 2px solid var(--app-link);
    outline-offset: 1px;
}

.role-chip-state.mud-icon-root {
    font-size: 1.05rem;
}

/* Required qualifications of a role (shown when the role is clicked) */
.role-requirements {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 6px;
    padding: 4px 0 8px 0;
}

.role-requirements .rule-and {
    margin: 0 2px;
}

.role-requirement-rule {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.req-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 12px;
    border: 1px solid;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.4;
}

.req-chip .mud-icon-root {
    font-size: .875rem;
}

.req-met {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .35);
}

.req-missing {
    color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), .06);
    border-color: rgba(var(--mud-palette-error-rgb), .35);
}

/* Two-line entries in selection dialogs (name + details) */
.assign-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.assign-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* Role name inside the chip (hover target for the requirements tooltip) */
.role-chip-name {
    padding: 0 2px;
    border-radius: 10px;
    cursor: default;
}

.role-chip-name:focus-visible {
    outline: 2px solid var(--app-link);
    outline-offset: 1px;
}

/* Requirements tooltip: light card instead of the dark default tooltip */
.mud-tooltip.role-tooltip {
    max-width: 520px;
    padding: 10px 12px;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .14);
    font-size: .8125rem;
}

.mud-tooltip.role-tooltip .role-requirements {
    padding: 0;
    /* (the popover itself does not keep its max-width: the content wraps at this width, so a role with many
       qualifications becomes a few short lines instead of one line across the window) */
    max-width: 480px;
}

.mud-tooltip.role-tooltip.mud-tooltip-arrow::after {
    border-color: var(--mud-palette-lines-default) transparent transparent transparent;
}

/* ---------- Global search (top bar, centered) ---------- */
.global-search {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, 38vw);
    z-index: 1;
}

.global-search-box {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 8px 0 10px;
    gap: 8px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 4px;
    background: var(--mud-palette-background);
    transition: border-color .15s, box-shadow .15s;
}

    .global-search-box:hover {
        border-color: var(--mud-palette-text-secondary);
    }

    .global-search-box:focus-within {
        border-color: var(--mud-palette-primary);
        box-shadow: 0 0 0 1px var(--mud-palette-primary);
    }

.global-search-icon.mud-icon-root {
    font-size: 18px;
    color: var(--mud-palette-text-secondary);
}

.global-search-box input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: .875rem;
    color: var(--mud-palette-text-primary);
}

    .global-search-box input::placeholder {
        color: var(--mud-palette-text-secondary);
        opacity: 1;
    }

    .global-search-box input::-webkit-search-cancel-button {
        display: none;
    }

.global-search-kbd {
    flex: none;
    font: inherit;
    font-size: .6875rem;
    line-height: 1;
    padding: 3px 5px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 3px;
    color: var(--mud-palette-text-secondary);
}

.global-search-box:focus-within .global-search-kbd {
    display: none;
}

.global-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: min(480px, calc(100vh - 80px));
    overflow-y: auto;
    padding: 4px 0;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
}

.global-search-group {
    padding: 8px 12px 4px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.global-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    cursor: pointer;
}

    .global-search-item.active {
        background: var(--mud-palette-action-default-hover);
    }

.global-search-item-icon.mud-icon-root {
    flex: none;
    font-size: 18px;
    color: var(--mud-palette-text-secondary);
}

.global-search-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.global-search-item-title,
.global-search-item-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-item-title {
    font-size: .875rem;
    line-height: 1.3;
}

.global-search-item-sub {
    font-size: .75rem;
    line-height: 1.3;
    color: var(--mud-palette-text-secondary);
}

.global-search-empty {
    padding: 10px 12px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

@media (max-width: 760px) {
    .global-search {
        display: none;
    }
}

/* ---------- Tag sources (hover + dialog) ---------- */
.tag-chip-name {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

    .tag-chip-name:hover {
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .tag-chip-name:focus-visible {
        outline: 2px solid var(--app-link);
        outline-offset: 2px;
        border-radius: 2px;
    }

/* tag without a manual source: no ✕, so the right padding matches the left */
.tag-chip.tag-chip-fixed {
    padding-right: 10px;
}

.tag-source-tip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.tag-source-tip-label {
    font-weight: 600;
}

.tag-source-tip-expiry {
    color: var(--mud-palette-text-secondary);
}

.tag-source-expired {
    color: var(--mud-palette-error);
}

/* sources dialog: dates and names on one line */
.tag-sources td:not(:first-child),
.tag-sources th {
    white-space: nowrap;
}

/* wide enough for long source names (documents, implied tags) next to the dates */
.tag-sources-dialog {
    width: min(800px, calc(100vw - 32px));
}

/* Qualification status: green valid, yellow expires within a month, red expired */
.tag-chip.tag-chip-valid {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .35);
}

.tag-chip.tag-chip-expiring {
    color: var(--mud-palette-warning);
    background: rgba(var(--mud-palette-warning-rgb), .10);
    border-color: rgba(var(--mud-palette-warning-rgb), .45);
}

.tag-chip.tag-chip-expired {
    color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), .06);
    border-color: rgba(var(--mud-palette-error-rgb), .35);
}

.tag-chip-valid .tag-chip-remove,
.tag-chip-expiring .tag-chip-remove,
.tag-chip-expired .tag-chip-remove {
    color: inherit;
}

.tag-source-expiring {
    color: var(--mud-palette-warning);
}

/* Expiration date in the assign dialog */
.assign-expiration {
    max-width: 220px;
    margin-top: 12px;
}

/* Roles / requirements: yellow when a qualification expires within a month */
.role-chip-expiring,
.req-expiring {
    color: var(--mud-palette-warning);
    background: rgba(var(--mud-palette-warning-rgb), .10);
    border-color: rgba(var(--mud-palette-warning-rgb), .45);
}

/* Tag dialog: implied tags */
.implied-chips {
    margin-bottom: 8px;
}

.implied-option-category {
    margin-left: 8px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* Implied tags: small arrow in front of the name */
.tag-chip.tag-chip-implied {
    padding-left: 6px;
}

.tag-chip-implied-icon.mud-icon-root {
    width: 14px;
    height: 14px;
    font-size: 14px;
    margin-right: 1px;
    opacity: .8;
}

/* Document types: fields table */
.doc-fields {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

    .doc-fields th {
        padding: 6px 8px;
        text-align: left;
        font-size: .75rem;
        font-weight: 600;
        color: var(--mud-palette-text-secondary);
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }

    .doc-fields td {
        padding: 2px 8px;
        height: 36px;
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }

    .doc-fields tbody tr:last-child td {
        border-bottom: 0;
    }

    .doc-fields .doc-field-pos {
        width: 40px;
        color: var(--mud-palette-text-secondary);
    }

    .doc-fields .cell-actions {
        width: 150px;
        text-align: right;
        white-space: nowrap;
    }

.validations-field {
    max-width: 200px;
}

.doc-fields .doc-field-options {
    color: var(--mud-palette-text-secondary);
}

/* ---------- Upload document dialog: preview left, form right ---------- */
.upload-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
    gap: 24px;
    height: min(72vh, 760px);
}

.upload-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-background);
}

    .upload-preview.empty {
        border: 2px dashed var(--mud-palette-lines-inputs);
    }

        .upload-preview.empty:hover,
        .upload-preview.empty:focus-within {
            border-color: var(--mud-palette-primary);
        }

/* the file input covers the drop zone (click and drag & drop); hidden once a file is chosen */
.upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-preview:not(.empty) .upload-input {
    display: none;
}

.upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    color: var(--mud-palette-text-secondary);
}

    .upload-drop .mud-icon-root {
        font-size: 40px;
        width: 40px;
        height: 40px;
    }

.upload-drop-title {
    font-size: .9375rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

.upload-drop-hint {
    font-size: .8125rem;
}

.upload-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.upload-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Event dialog → REMARKS: the field fills the height of the tab (the dialog is as tall as OVERVIEW) */
.event-remarks {
    padding-top: 8px;
}

.tab-panels > .event-remarks {
    display: flex;
    flex-direction: column;
}

    .tab-panels > .event-remarks > .event-remarks-field {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .event-remarks-field .mud-input-control-input-container,
    .event-remarks-field .mud-input {
        flex: 1 1 auto;
        min-height: 0;
    }

    .event-remarks-field .mud-input {
        align-items: stretch;
    }

    .event-remarks-field textarea {
        height: 100% !important;
        resize: none;
    }

/* Qualifications field (upload / edit a document): a row per qualification - name, expiration, remove */
.qualifications-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qualification-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 175px auto; /* the date field: room for "31.08.2027" beside its clear and calendar buttons */
    align-items: center;
    gap: 8px;
}

    .qualification-row .mud-input-control {
        margin-top: 0;
    }

.qualification-add.mud-button-root {
    align-self: flex-start;
}

/* the document dialog: the qualifications of a Qualifications field, one per line */
.qualification-list {
    margin: 0;
    padding-left: 18px;
}

.upload-form {
    overflow-y: auto;
    padding-right: 4px;
}

.upload-file {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

.upload-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

.upload-file-size {
    flex: none;
}

.upload-change {
    flex: none;
    margin-left: auto;
    color: var(--app-link);
    cursor: pointer;
}

    .upload-change:hover {
        text-decoration: underline;
    }

@media (max-width: 900px) {
    .upload-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .upload-preview {
        height: 50vh;
    }
}

/* ---------- Documents ---------- */
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    padding-bottom: 0; /* the text sits optically centred without the bottom pixel */
    border-radius: 12px;
    border: 1px solid;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.status-validated {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .35);
}

.status-pending {
    color: var(--mud-palette-warning);
    background: rgba(var(--mud-palette-warning-rgb), .10);
    border-color: rgba(var(--mud-palette-warning-rgb), .45);
}

.status-rejected {
    color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), .06);
    border-color: rgba(var(--mud-palette-error-rgb), .35);
}

/* current state of a resource (resources list), right-aligned */
.resource-state {
    margin-left: auto;
    flex-shrink: 0;
}

.resource-state-ready {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .35);
}

.resource-state-maintenance {
    color: var(--mud-palette-warning);
    background: rgba(var(--mud-palette-warning-rgb), .10);
    border-color: rgba(var(--mud-palette-warning-rgb), .45);
}

.resource-state-inuse {
    color: var(--mud-palette-info);
    background: rgba(var(--mud-palette-info-rgb), .08);
    border-color: rgba(var(--mud-palette-info-rgb), .35);
}

/* a resource block is going on (nothing running): the muted red of the blocks in the calendars */
.resource-state-blocked {
    color: var(--resource-block-color);
    background: color-mix(in srgb, var(--resource-block-color) 10%, transparent);
    border-color: color-mix(in srgb, var(--resource-block-color) 45%, transparent);
}

/* event status (hover card of calendar items) */
.event-status-prebooked {
    color: var(--mud-palette-warning);
    background: rgba(var(--mud-palette-warning-rgb), .10);
    border-color: rgba(var(--mud-palette-warning-rgb), .45);
}

.event-status-confirmed {
    color: var(--mud-palette-info);
    background: rgba(var(--mud-palette-info-rgb), .08);
    border-color: rgba(var(--mud-palette-info-rgb), .35);
}

.event-status-running {
    color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), .08);
    border-color: rgba(var(--mud-palette-primary-rgb), .35);
}

.event-status-completed {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .35);
}

.event-status-canceled,
.event-status-nottaken,
.event-status-aborted {
    color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), .06);
    border-color: rgba(var(--mud-palette-error-rgb), .35);
}


.row-clickable {
    cursor: pointer;
}

.doc-revisions {
    margin-left: 8px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* document dialog */
.doc-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .doc-title h2 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
    }

.doc-subtitle {
    margin-top: 2px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

.doc-section {
    margin-top: 18px;
}

.doc-section-title {
    margin-bottom: 6px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.doc-revisions-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    overflow: hidden;
}

.doc-revision {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    font: inherit;
    font-size: .875rem;
    color: var(--mud-palette-text-primary);
    text-align: left;
    cursor: pointer;
}

    .doc-revision:last-child {
        border-bottom: 0;
    }

    .doc-revision:hover {
        background: var(--mud-palette-action-default-hover);
    }

    .doc-revision.selected {
        background: rgba(var(--mud-palette-primary-rgb), .08);
        box-shadow: inset 3px 0 0 var(--mud-palette-primary);
    }

.doc-revision-date {
    width: 84px;
    font-weight: 500;
}

.doc-revision-current {
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-primary);
}

.doc-revision-uploaded {
    margin-left: auto;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.doc-fields-list {
    margin: 0;
}

.doc-validation {
    font-size: .875rem;
    padding: 2px 0;
}

    .doc-validation.validated {
        color: var(--mud-palette-success);
    }

    .doc-validation.rejected {
        color: var(--mud-palette-error);
    }

/* link-styled button (e.g. document behind a tag source) */
.link-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--app-link);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--app-link-underline);
    text-underline-offset: 2px;
}

    .link-button:hover {
        color: var(--app-link-hover);
    }

.tag-source-via {
    margin-left: 4px;
}

.doc-validation.edited {
    color: var(--mud-palette-text-secondary);
}

/* ---------- Upload: parts ---------- */
.upload-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

    .upload-left .upload-preview {
        flex: 1 1 auto;
        min-height: 0;
    }

/* the stage is a size container: a part rotated by 90° / 270° gets the stage's height as its width */
.part-stage {
    container-type: size;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.part-view {
    width: 100cqw;
    height: 100cqh;
    border: 0;
    object-fit: contain;
    background: #fff;
    flex: none;
    transition: transform .2s;
}

img.part-view {
    background: transparent;
}

    .part-view.rot-90,
    .part-view.rot-270 {
        width: 100cqh;
        height: 100cqw;
    }

.rot-90 { transform: rotate(90deg); }
.rot-180 { transform: rotate(180deg); }
.rot-270 { transform: rotate(270deg); }

.part-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 4px;
    flex: none;
}

.part-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 104px;
    flex: none;
    padding: 6px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-surface);
}

    .part-tile.selected {
        border-color: var(--mud-palette-primary);
        box-shadow: 0 0 0 1px var(--mud-palette-primary);
    }

.part-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    background: var(--mud-palette-background);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    color: var(--mud-palette-text-secondary);
}

    .part-thumb img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        transition: transform .2s;
    }

    .part-thumb .mud-icon-root {
        font-size: 28px;
        width: 28px;
        height: 28px;
    }

.part-number {
    position: absolute;
    top: 2px;
    left: 2px;
    min-width: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: .6875rem;
    font-weight: 600;
    line-height: 16px;
    color: #fff;
    background: var(--mud-palette-primary);
}

.part-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.part-actions {
    display: flex;
    gap: 2px;
}

    .part-actions button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        padding: 0;
        border: 0;
        border-radius: 4px;
        background: transparent;
        color: var(--mud-palette-text-secondary);
        cursor: pointer;
    }

        .part-actions button:hover:not(:disabled) {
            background: var(--mud-palette-action-default-hover);
            color: var(--mud-palette-text-primary);
        }

        .part-actions button:disabled {
            opacity: .35;
            cursor: default;
        }

        .part-actions .mud-icon-root {
            font-size: 16px;
            width: 16px;
            height: 16px;
        }

.part-add {
    justify-content: center;
    cursor: pointer;
    border-style: dashed;
}

    .part-add:hover {
        border-color: var(--mud-palette-primary);
    }

.upload-hint {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

/* Documents table: collapsible groups, documents indented */
.table-documents .doc-group-row {
    cursor: pointer;
}

.table-documents td.doc-group-cell {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    vertical-align: middle;
    border-bottom: 0;
}

    .table-documents td.doc-group-cell .tag-group-header {
        pointer-events: none; /* the row handles the click */
    }

.table-documents td.doc-member-cell {
    padding-left: 44px !important;
}

/* Document view: assigned tags as a vertical list, expiration below the name */
.doc-tag-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tag-chip.doc-tag-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 6px 12px;
    border-radius: 6px;
}

.doc-tag-name {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.doc-tag-expiry {
    font-size: .75rem;
    font-weight: 400;
    opacity: .85;
}

/* Document view: at most 1440px wide; information 380px (30 %, min. 220px, in small windows), the viewer the rest;
   always side by side */
.mud-dialog.document-dialog {
    max-width: min(1440px, calc(100vw - 32px)) !important;
}

.document-dialog .upload-layout {
    grid-template-columns: minmax(0, 1fr) clamp(220px, 30%, 380px);
    height: min(72vh, 760px);
}


/* ---------- PDF viewer (PDF.js, own toolbar) ---------- */
.pdf-viewer {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: var(--mud-palette-background);
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
    height: 40px;
    padding: 0 6px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.pdf-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 6px;
    margin-right: 4px;
    border-right: 1px solid var(--mud-palette-lines-default);
}

    .pdf-toolbar-group:last-of-type {
        border-right: 0;
    }

.pdf-toolbar-spacer {
    flex: 1;
}

.pdf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

    .pdf-button svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
    }

    .pdf-button:hover:not(:disabled) {
        background: var(--mud-palette-action-default-hover);
        color: var(--mud-palette-text-primary);
    }

    .pdf-button.active {
        color: var(--mud-palette-primary);
        background: rgba(var(--mud-palette-primary-rgb), .08);
    }

    .pdf-button:disabled {
        opacity: .35;
        cursor: default;
    }

    .pdf-button:focus-visible {
        outline: 2px solid var(--app-link);
        outline-offset: -2px;
    }

.pdf-page-label,
.pdf-zoom-label {
    min-width: 54px;
    font-size: .8125rem;
    text-align: center;
    color: var(--mud-palette-text-primary);
    font-variant-numeric: tabular-nums;
}

.pdf-area {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    cursor: grab;
    background: color-mix(in srgb, var(--mud-palette-background) 80%, #808080 20%);
    outline: none;
}

    .pdf-area.dragging {
        cursor: grabbing;
        user-select: none;
    }

.pdf-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    width: max-content;
    min-width: 100%;
    box-sizing: border-box;
}

.pdf-page {
    position: relative;
    flex: none;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

    .pdf-page canvas {
        display: block;
    }

.pdf-error {
    padding: 24px;
    color: var(--mud-palette-text-secondary);
    font-size: .875rem;
}

.part-stage .pdf-viewer {
    flex: none;
}

/* Document view: the information column adapts to its own width */
.document-dialog .upload-form {
    container-type: inline-size;
    min-width: 0;
}

.doc-fields-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.doc-revision {
    flex-wrap: wrap;
    row-gap: 2px;
    justify-content: flex-start;
}

@container (max-width: 340px) {
    .doc-fields-list.fields {
        grid-template-columns: 1fr;
        gap: 0;
    }

        .doc-fields-list.fields dt {
            font-size: .75rem;
        }

        .doc-fields-list.fields dd {
            margin-bottom: 8px;
        }

    .doc-title {
        flex-wrap: wrap;
        row-gap: 4px;
    }

        .doc-title h2 {
            font-size: 1.125rem;
        }

    .doc-revision-date {
        width: auto;
    }

    .doc-revision-uploaded {
        flex-basis: 100%;
        margin-left: 0;
    }
}

/* Profile menu: "Sign Out" (a form button, styled like the menu items) */
.profile-signout-form {
    align-self: stretch;
    width: 100%;
    margin: 0;
}

.profile-signout {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 6px 16px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: .875rem;
    color: var(--mud-palette-text-primary);
    text-align: left;
    cursor: pointer;
}

    .profile-signout:hover {
        background: var(--mud-palette-action-default-hover);
    }

    .profile-signout .mud-icon-root {
        width: 24px;
        height: 24px;
        font-size: 1.5rem;
        color: var(--mud-palette-text-secondary);
    }

/* ---------- Login page (plain HTML, no MudBlazor) ---------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
    background: #f3f5f8;
    font-family: Inter, system-ui, sans-serif;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 32px;
    border: 1px solid #e2e6ec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(15, 23, 42, .06);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1b2a41;
}

.login-card h1 {
    margin: 24px 0 16px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1b2a41;
}

.login-form {
    display: flex;
    flex-direction: column;
}

    .login-form label {
        margin: 10px 0 4px;
        font-size: .8125rem;
        font-weight: 500;
        color: #4a5568;
    }

    .login-form input {
        height: 40px;
        padding: 0 12px;
        border: 1px solid #c9d0da;
        border-radius: 4px;
        font: inherit;
        font-size: .9375rem;
        color: #1b2a41;
    }

        .login-form input:focus {
            outline: 0;
            border-color: #1E3A5F;
            box-shadow: 0 0 0 1px #1E3A5F;
        }

    .login-form button {
        height: 40px;
        margin-top: 24px;
        border: 0;
        border-radius: 4px;
        background: #1E3A5F;
        color: #fff;
        font: inherit;
        font-size: .9375rem;
        font-weight: 600;
        cursor: pointer;
    }

        .login-form button:hover {
            background: #172E4B;
        }

    /* invitation page: the username is shown, not entered; hint below the password */
    .login-form input.login-readonly {
        background: #f4f6f9;
        color: #4a5568;
    }

    .login-form .login-hint {
        margin-top: 4px;
        font-size: .75rem;
        color: #5b6b80;
    }

.invitation-error {
    margin-top: 12px;
}

.login-error {
    margin-bottom: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(197, 48, 48, .35);
    border-radius: 4px;
    background: rgba(197, 48, 48, .06);
    color: #c53030;
    font-size: .875rem;
}

.doc-validation-hint {
    margin-top: 4px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

/* Identity roles: inherited permissions (read-only) in muted text */
.permission-table tr.permission-inherited td {
    color: var(--mud-palette-text-secondary);
}

.permission-table .cell-actions {
    width: 90px;
}

.scope-list {
    max-height: 260px;
}

/* ---------- Notifications (top bar) ---------- */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

    .notification-bell:hover {
        background: var(--mud-palette-action-default-hover);
        color: var(--mud-palette-text-primary);
    }

    .notification-bell .mud-icon-root {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }

.notification-count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--mud-palette-error);
    color: #fff;
    font-size: .6875rem;
    font-weight: 600;
    line-height: 17px;
    text-align: center;
}

.notification-panel {
    width: 400px;
    max-width: calc(100vw - 32px);
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px 8px 16px;
    line-height: 1;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.notification-empty {
    padding: 16px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

.notification-list {
    max-height: min(420px, 70vh);
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-text-primary);
    text-decoration: none;
}

    .notification-item:last-child {
        border-bottom: 0;
    }

    .notification-item:hover {
        background: var(--mud-palette-action-default-hover);
    }

.notification-icon.mud-icon-root {
    flex: none;
    margin-top: 2px;
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--priority-color, var(--mud-palette-warning)); /* the color of the priority (red / yellow / blue) */
}

.notification-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.notification-title {
    font-size: .875rem;
    font-weight: 500;
}

.notification-sub {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* when (due / uploaded / starts …): its own line, bold, in the color of the detail line */
.notification-when {
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

/* ---------- Notification priorities: the counter takes the color of the highest one ---------- */
.priority-high { --priority-color: var(--mud-palette-error); }
.priority-medium { --priority-color: var(--mud-palette-warning); }
.priority-low { --priority-color: var(--mud-palette-info); }

.notification-count.priority-high,
.notification-count.priority-medium,
.notification-count.priority-low {
    background: var(--priority-color);
}

.notification-item {
    border-left: 3px solid var(--priority-color, transparent);
    padding-left: 13px;
}

.notification-filter {
    display: inline-flex;
    gap: 4px;
}

.notification-filter-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    background: transparent;
    color: var(--mud-palette-text-disabled);
    font: inherit;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
}

    .notification-filter-option:hover {
        background: var(--mud-palette-action-default-hover);
    }

    .notification-filter-option.active {
        color: var(--mud-palette-text-primary);
        border-color: var(--priority-color);
    }

    .notification-filter-option .notification-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--mud-palette-text-disabled);
    }

    .notification-filter-option.active .notification-dot {
        background: var(--priority-color);
    }

.notification-filter-count {
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ---------- Resources: site filter in the list header (same look as the Auditing filters) ---------- */
.list-pane-header .resource-site-filter {
    max-height: 220px;
    overflow-y: auto;
    padding: 12px 0 4px;
    border-bottom: 0;
}

    .list-pane-header .resource-site-filter .mud-input-control {
        margin-top: 0 !important;
    }

/* ---------- Calendar (own control): week view with time grid ---------- */
/* fills the tab (height of its parent); the 24 hours share that height */
.calendar {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 12px;
}

.calendar-range {
    margin-left: 8px;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.calendar-zone {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.calendar-scroll {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-surface);
}

.calendar-head,
.calendar-body {
    display: grid;
    grid-template-columns: 56px repeat(7, minmax(0, 1fr));
}

.calendar-head {
    position: sticky;
    flex: none;
    top: 0;
    z-index: 4;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.calendar-day-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    border-left: 1px solid var(--mud-palette-lines-default);
    line-height: 1.25;
}

.calendar-weekday {
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.calendar-date {
    font-size: .875rem;
    color: var(--mud-palette-text-primary);
}

.calendar-day-head.today .calendar-weekday,
.calendar-day-head.today .calendar-date {
    color: var(--mud-palette-primary);
    font-weight: 700;
}

/* at least 20 px per hour; below that the calendar scrolls */
.calendar-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 480px;
    overflow-y: clip; /* the dot of the current-time line just before midnight: no scrollbar */
}

.calendar-body > .calendar-gutter {
    position: relative;
}

.calendar-hour {
    position: absolute;
    right: 8px;
    transform: translateY(-50%);
    font-size: .6875rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.calendar-day {
    position: relative;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--mud-palette-lines-default);
}

    .calendar-day.today {
        background: color-mix(in srgb, var(--mud-palette-primary) 4%, transparent);
    }

/* half-hour slots: solid line on the hour, a fainter one on the half hour; click = new event */
.calendar-slot {
    flex: 1 1 0;
    box-sizing: border-box;
    min-height: 0;
    border-top: 1px solid var(--mud-palette-lines-default);
    cursor: pointer;
}

    .calendar-slot:first-child {
        border-top-color: transparent;
    }

    .calendar-slot.half {
        border-top: 1px dotted color-mix(in srgb, var(--mud-palette-lines-default) 70%, transparent);
    }

    .calendar-slot:hover {
        background: var(--mud-palette-action-default-hover);
    }

/* MudTooltip root: positioned in the day column (top / height / column); the button fills it */
.calendar-item-root {
    position: absolute;
    z-index: 1;
    display: block;
}

    .calendar-item-root:hover,
    .calendar-item-root:focus-within {
        z-index: 2;
    }

.calendar-item {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 6px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-left: 3px solid var(--event-color, var(--mud-palette-primary));
    border-radius: 4px;
    background: color-mix(in srgb, var(--event-color, var(--mud-palette-primary)) 16%, var(--mud-palette-surface));
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

    .calendar-item:hover,
    .calendar-item:focus-visible {
        box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
        outline: none;
    }

    .calendar-item.continues-before {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    .calendar-item.continues-after {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

/* inner box fills the button (buttons center their content otherwise) */
.calendar-item-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.calendar-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 2px 6px;
    overflow: hidden;
}

.calendar-item-title,
.calendar-item-time {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.calendar-item-title {
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.3;
}

.calendar-item-time {
    font-size: .6875rem;
    line-height: 1.3;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* briefing / debriefing: hatched bands before and after the event */
.calendar-band {
    display: block;
    flex: none;
    background: repeating-linear-gradient(-45deg,
        color-mix(in srgb, var(--event-color, var(--mud-palette-primary)) 7%, var(--mud-palette-surface)) 0 4px,
        color-mix(in srgb, var(--event-color, var(--mud-palette-primary)) 22%, var(--mud-palette-surface)) 4px 8px);
}

    .calendar-band.before {
        border-bottom: 1px dashed color-mix(in srgb, var(--event-color, var(--mud-palette-primary)) 45%, transparent);
    }

    .calendar-band.after {
        border-top: 1px dashed color-mix(in srgb, var(--event-color, var(--mud-palette-primary)) 45%, transparent);
    }

/* downtimes in an event block (week / day calendar): red stripes at their real time, the event color shows through; a
   thin red line at the start and the end; a running one a bit stronger with a dashed, slowly moving end edge. The block's
   root (absolutely positioned with a fixed top / height / left / width) is a size container - so its size never depends
   on its content and the stripes can be hidden when the block is too small to show them (see below). */
.calendar-item-root {
    container: calendar-item / size;
}

.calendar-downtime {
    position: absolute;
    z-index: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
    pointer-events: none;
    border-top: 1px solid rgb(var(--downtime-rgb));
    border-bottom: 1px solid rgb(var(--downtime-rgb));
    background: repeating-linear-gradient(-45deg, rgba(var(--downtime-rgb), .55) 0 4px, transparent 4px 8px);
}

    .calendar-downtime.running {
        border-bottom: 2px dashed rgb(var(--downtime-rgb));
        background: repeating-linear-gradient(-45deg, rgba(var(--downtime-rgb), .7) 0 4px, rgba(var(--downtime-rgb), .12) 4px 8px);
        background-size: 11.314px 11.314px; /* one stripe period at -45deg: the animation moves by exactly one, seamlessly */
        animation: calendar-downtime-running 3s linear infinite;
    }

@keyframes calendar-downtime-running {
    to { background-position: 11.314px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .calendar-downtime.running { animation: none; }
}

.day-calendar.horizontal .calendar-downtime {
    top: 0;
    bottom: 0;
    border: 0;
    border-left: 1px solid rgb(var(--downtime-rgb));
    border-right: 1px solid rgb(var(--downtime-rgb));
}

    .day-calendar.horizontal .calendar-downtime.running {
        border-right: 2px dashed rgb(var(--downtime-rgb));
    }

/* the text stays above the stripes, on a light background */
.calendar-item.has-downtimes .calendar-main {
    position: relative;
    z-index: 1;
    align-items: flex-start;
}

.calendar-item.has-downtimes .calendar-item-title,
.calendar-item.has-downtimes .calendar-item-time {
    max-width: 100%;
    padding: 0 2px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--mud-palette-surface) 80%, transparent);
}

/* too small for the stripes: hidden (the hover card still lists the downtimes) */
@container calendar-item (max-height: 28px) {
    .day-calendar:not(.horizontal) .calendar-downtime,
    .calendar:not(.day-calendar) .calendar-downtime {
        display: none;
    }
}

@container calendar-item (max-width: 40px) {
    .day-calendar.horizontal .calendar-downtime {
        display: none;
    }
}

/* short blocks (e.g. a week of several resources from top to bottom): one line - the title only, without the hatched
   briefing bands (time and briefings: in the hover card); very short ones: no text at all */
@container calendar-item (max-height: 34px) {
    .calendar-item-time,
    .day-calendar:not(.horizontal) .calendar-band,
    .calendar:not(.day-calendar) .calendar-band {
        display: none;
    }

    .calendar-main {
        justify-content: center;
        padding-top: 0;
        padding-bottom: 0;
    }

    .calendar-item-title {
        font-size: .6875rem;
        line-height: 1.15;
    }
}

@container calendar-item (max-height: 13px) {
    .calendar-main {
        display: none;
    }
}

/* the downtimes in the hover card */
.calendar-card-downtimes {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
}

    .calendar-card-downtimes li::before {
        content: "";
        display: inline-block;
        width: 8px;
        height: 8px;
        margin-right: 6px;
        border-radius: 2px;
        background: repeating-linear-gradient(-45deg, rgba(var(--downtime-rgb), .85) 0 2px, transparent 2px 4px);
        outline: 1px solid rgb(var(--downtime-rgb));
    }

    .calendar-card-downtimes li.running {
        color: rgb(var(--downtime-rgb));
        font-weight: 500;
    }

/* current time */
.calendar-now {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 3;
    height: 2px;
    margin-top: -1px;
    background: var(--mud-palette-error);
    pointer-events: none;
}

    .calendar-now::before {
        content: "";
        position: absolute;
        left: -5px;
        top: -4px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--mud-palette-error);
    }

/* ---------- Event categories: color swatches and the color palette in the dialog ---------- */
.color-swatch {
    display: inline-block;
    flex: none;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

    .color-swatch.large {
        width: 32px;
        height: 32px;
        margin: 0;
        border-radius: 6px;
    }

.color-palette {
    display: grid;
    grid-template-columns: repeat(12, 28px);
    gap: 6px;
    margin-bottom: 12px;
}

.color-option {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

    .color-option:hover {
        transform: scale(1.08);
    }

    .color-option.selected {
        outline: 2px solid var(--mud-palette-text-primary);
        outline-offset: 2px;
    }

.color-custom {
    align-items: center;
}

/* secondary text next to an option (e.g. the category of an event type): vertically centered on the option text */
/* ---------- Calendar: hover card of an event (light card like the role tooltip) ---------- */
.mud-tooltip.calendar-tooltip {
    padding: 0;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .16);
    text-align: left;
}

    .mud-tooltip.calendar-tooltip.mud-tooltip-arrow::after {
        border-color: transparent var(--mud-palette-lines-default) transparent transparent;
    }

.calendar-card {
    min-width: 220px;
    max-width: 320px;
    padding: 10px 12px 10px 12px;
    border-left: 4px solid var(--event-color, var(--mud-palette-primary));
    border-radius: 8px;
    font-size: .8125rem;
    line-height: 1.4;
}

.calendar-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-card-color {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--event-color, var(--mud-palette-primary));
}

.calendar-card-title {
    font-size: .875rem;
    font-weight: 600;
}

.calendar-card-sub {
    margin: 1px 0 0 18px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.calendar-card-fields {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 14px;
    margin: 8px 0 0;
    padding-top: 8px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

    .calendar-card-fields dt {
        font-size: .75rem;
        color: var(--mud-palette-text-secondary);
    }

    .calendar-card-fields dd {
        margin: 0;
        font-variant-numeric: tabular-nums;
    }

.calendar-card-hint {
    margin-left: 4px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap; /* "2 h 5 min" never splits */
}

.calendar-card-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--mud-palette-lines-default);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

    .calendar-card-section .calendar-card-hint {
        margin-left: 2px;
        font-weight: 400;
        letter-spacing: normal;
    }

.calendar-card-fields.people {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
}

/* ---------- Event dialog: attendees ---------- */
.attendee-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
}

.attendee-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

    .attendee-row:first-child {
        border-top: 0;
    }

.attendee-name {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    font-size: .875rem;
    line-height: 1.3;
}

.attendee-org {
    overflow: hidden;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* same width for every role dropdown, whatever the name next to it */
.attendee-role-cell {
    flex: 0 0 170px;
    width: 170px;
}

    .attendee-role-cell .mud-input-control {
        width: 100%;
        margin: 0 !important;
    }

/* secondary text below an option (e.g. the organization of a person), left-aligned with it */
.select-sub {
    font-size: .75rem;
    line-height: 1.3;
    color: var(--mud-palette-text-secondary);
}

/* ---------- Event dialog: OVERVIEW / AUDIT tabs ---------- */
.dialog-tabs {
    margin: -4px 0 16px;
}

/* the audit list scrolls inside a fixed height, so the dialog does not jump when switching tabs */
.event-dialog-audit {
    display: flex;
    flex-direction: column;
    height: 460px;
    min-height: 0;
}

/* event dialog OVERVIEW: event fields left, attendees right (stacked on narrow screens) */
.event-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.event-form-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.event-form-attendees {
    min-width: 0;
}

@media (max-width: 760px) {
    .event-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* built-in records (e.g. the Maintenance event category): cannot be changed or deleted */
.builtin-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.5;
    color: var(--mud-palette-text-secondary);
    vertical-align: middle;
}

    .builtin-badge.large {
        margin-left: 12px;
        font-size: .75rem;
    }

/* ---------- FSTD resources: configurations with their certifications ---------- */
.certification-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.certification {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 1px 8px 1px 1px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
}

.certification-authority {
    padding: 1px 7px;
    border-radius: 11px;
    background: var(--mud-palette-background-gray, rgba(0, 0, 0, .05));
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.certification-row {
    padding: 6px 4px 6px 8px;
}

.certification-authority-cell {
    flex: 0 0 200px;
    width: 200px;
}

    .certification-authority-cell .mud-input-control,
    .certification-row .certification-identifier {
        margin: 0 !important;
    }

.certification-row .certification-identifier {
    flex: 1 1 auto;
}

.add-certification {
    align-self: flex-start;
}

/* ---------- Calendar: resource blocks - hatched over the column (behind the items), a label at the start ---------- */
/* a muted red (not alarming): the hatching, the dashed edges and the label */
:root {
    --resource-block-color: #A0524F;
}

.app-dark,
body:has(.app-dark) {
    --resource-block-color: #C27773;
}

.calendar-block {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 0;
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--resource-block-color) 26%, transparent) 0 2px, transparent 2px 9px),
        color-mix(in srgb, var(--resource-block-color) 5%, transparent);
    border-top: 1px dashed color-mix(in srgb, var(--resource-block-color) 65%, transparent);
    border-bottom: 1px dashed color-mix(in srgb, var(--resource-block-color) 65%, transparent);
    pointer-events: none;
}

.day-calendar.horizontal .calendar-block {
    top: 0;
    bottom: 0;
    right: auto;
    border: 0;
    border-left: 1px dashed color-mix(in srgb, var(--resource-block-color) 65%, transparent);
    border-right: 1px dashed color-mix(in srgb, var(--resource-block-color) 65%, transparent);
}

.calendar-block-label {
    position: absolute;
    display: block;
    text-align: left;
    left: calc(var(--band-width, 0px) + 2px);
    z-index: 3; /* above the events (z-index 1, hovered 2): an event starting soon after the block begins no longer hides it */
    max-width: calc(100% - var(--band-width, 0px) - 4px);
    margin-top: 2px;
    padding: 1px 6px;
    overflow: hidden;
    border: 0;
    border-radius: 3px;
    background: var(--resource-block-color);
    color: #fff;
    font: inherit;
    font-size: .6875rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: default;
}

    .calendar-block-label.clickable {
        cursor: pointer;
    }

        .calendar-block-label.clickable:hover,
        .calendar-block-label.clickable:focus-visible {
            background: color-mix(in srgb, var(--resource-block-color) 80%, #000);
        }

.day-calendar.horizontal .calendar-block-label {
    top: calc(var(--band-width, 0px) + 2px);
    margin-top: 0;
    margin-left: 2px;
    max-width: 40%;
}

/* ---------- Calendar: bands (e.g. simulator configuration) as a vertical bar at the left of each day ---------- */
.calendar.has-bands {
    --band-width: 16px;
}

.calendar-band-bar {
    position: absolute;
    left: 0;
    z-index: 1;
    width: var(--band-width);
    overflow: hidden;
    opacity: .85;
    pointer-events: auto;
}

.calendar-band-bar-label {
    position: absolute;
    top: 4px;
    left: 0;
    width: 100%;
    max-height: calc(100% - 8px);
    overflow: hidden;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: .625rem;
    font-weight: 600;
    line-height: var(--band-width);
    letter-spacing: .03em;
    color: #fff;
}

.calendar-legend {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-right: 16px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.calendar-legend-label {
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--mud-palette-text-primary);
}

.calendar-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* ---------- Calendar: items with a warning (e.g. required configuration not set) ---------- */
.calendar-item.has-warning {
    box-shadow: inset 0 0 0 1px var(--mud-palette-warning), 0 1px 2px rgba(0, 0, 0, .12);
}

.calendar-item-warning.mud-icon-root {
    width: 14px;
    height: 14px;
    margin-right: 3px;
    font-size: 14px;
    vertical-align: -2px;
    color: var(--mud-palette-warning);
}

.calendar-card-warning {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--mud-palette-warning) 14%, var(--mud-palette-surface));
    font-size: .8125rem;
}

    .calendar-card-warning .mud-icon-root {
        flex: none;
        width: 16px;
        height: 16px;
        font-size: 16px;
        color: var(--mud-palette-warning);
    }

/* ---------- Calendar: drag & drop of items ---------- */
.calendar-item {
    touch-action: none; /* touch: dragging moves the item instead of scrolling */
}

.calendar-item-root.calendar-dragging-item {
    z-index: 6;
    opacity: .9;
    filter: drop-shadow(0 6px 12px rgba(15, 23, 42, .25));
}

    .calendar-item-root.calendar-dragging-item .calendar-item {
        cursor: grabbing;
    }

.calendar-drag-label {
    position: absolute;
    left: 0;
    top: -22px;
    z-index: 7;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--mud-palette-text-primary);
    color: var(--mud-palette-surface);
    font-size: .6875rem;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

body.calendar-dragging {
    cursor: grabbing;
    user-select: none;
}

    /* no hover card while dragging */
    body.calendar-dragging .mud-tooltip.calendar-tooltip {
        visibility: hidden !important;
        opacity: 0 !important;
    }

/* ---------- Sidebar: view (decides the menu) next to the collapse button ---------- */
.sidebar.expanded .sidebar-toggle {
    align-items: center;
    gap: 6px;
}

.sidebar-toggle .view-select {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
}

    .sidebar-toggle .view-select .mud-input {
        font-size: .8125rem;
        font-weight: 600;
    }

.view-single {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 8px;
    overflow: hidden;
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--mud-palette-text-primary);
}

.menu-empty {
    padding: 8px 16px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

/* the view selector and the collapse button next to it: the same height (36px) */
.sidebar-toggle .view-select .mud-input {
    height: 36px;
}

.sidebar.expanded .sidebar-toggle .sidebar-toggle-btn.mud-icon-button {
    flex: none;
    width: 36px;
    height: 36px;
}

/* ---------- Applications (after sign-in): Office, My Portal ---------- */
.apps-card {
    max-width: 440px;
}

    .apps-card h1 {
        margin-bottom: 4px;
    }

.apps-user {
    margin-bottom: 20px;
    font-size: .875rem;
    color: #5b6b80;
}

.apps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apps-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #e2e6ec;
    border-radius: 8px;
    color: #1b2a41;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}

    .apps-item:hover,
    .apps-item:focus-visible {
        border-color: #1e3a5f;
        background: #f6f8fb;
        outline: none;
    }

.apps-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #eef2f7;
    color: #1e3a5f;
}

.apps-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.apps-title {
    font-size: 1rem;
    font-weight: 600;
}

.apps-sub {
    font-size: .8125rem;
    color: #5b6b80;
}

.apps-signout {
    margin-top: 20px;
    text-align: right;
}

    .apps-signout button {
        padding: 6px 12px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #5b6b80;
        font: inherit;
        font-size: .875rem;
        cursor: pointer;
    }

        .apps-signout button:hover {
            background: #eef2f7;
            color: #1b2a41;
        }

.apps-placeholder {
    font-size: .875rem;
    color: #5b6b80;
}

.apps-back {
    font-size: .875rem;
    color: #1e3a5f;
}

/* My Portal: the person's data, and the links below */
.portal-fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    margin: 0 0 20px;
    font-size: .875rem;
}

    .portal-fields dt {
        color: #5b6b80;
    }

    .portal-fields dd {
        margin: 0;
        color: #1b2a41;
        overflow-wrap: anywhere;
    }

.portal-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

/* Office top bar: the brand leads back to the applications */
a.brand {
    color: inherit;
    text-decoration: none;
}

.office-denied {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 32px;
    color: var(--mud-palette-text-secondary);
}

/* Course templates: multi-line description, courses based on the template (one per line) */
.text-pre {
    white-space: pre-line;
}

.course-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* links as wide as their text: their tooltip sits centered above the link, not above the whole row */
    gap: 4px;
}

/* ---------- Course template → REVISIONS: revision list left, the selected revision right ---------- */
.revisions {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.revision-list {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    overflow: hidden;
}

.revision-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 8px 4px 12px;
    min-height: 40px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background-gray);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.revision-list-header .mud-button-root {
    white-space: nowrap;
    flex-shrink: 0;
}

.revision-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.revision-item:last-child {
    border-bottom: 0;
}

.revision-item:hover,
.revision-item.selected {
    background: var(--mud-palette-action-default-hover);
}

.revision-item.selected {
    border-left-color: var(--mud-palette-primary);
}

.revision-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    font-weight: 600;
}

.revision-item-sub {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.revision-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;                     /* narrow: the buttons move to a second line instead of wrapping their labels */
    gap: 10px;
    min-height: 40px;
    margin-bottom: 4px;
}

.revision-header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}


.revision-summary {
    margin-bottom: 12px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.revision-empty {
    padding: 24px;
    border: 1px dashed var(--mud-palette-lines-default);
    border-radius: 6px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
    text-align: center;
}

/* a block: header (number, name, totals, actions) and its sessions */
.block-card {
    margin-bottom: 12px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-surface);
    overflow: hidden;
}

.block-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 8px 4px 12px;
    background: var(--mud-palette-background-gray);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.block-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: .75rem;
    font-weight: 600;
}

.block-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.block-name {
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.block-meta {
    white-space: nowrap;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.block-header .mud-button-root {
    white-space: nowrap;
    flex-shrink: 0;
}

.block-empty {
    padding: 14px 16px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

/* fixed layout: every block is its own table, the columns line up across blocks (same widths everywhere) */
.block-sessions {
    table-layout: fixed;
}

/* widths include the padding; name and resource share the rest */
.block-sessions td {
    box-sizing: border-box;
}

.block-sessions .cell-drag {
    width: 28px;
    padding-right: 0;
    color: var(--mud-palette-text-disabled);
}

/* the grab handle: vertically centred in the row (an inline icon would sit on the text baseline) */
.block-sessions .cell-drag .mud-icon-root {
    display: block;
}

.block-sessions .cell-number {
    width: 40px;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.block-sessions .cell-duration {
    width: 104px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.block-sessions .cell-actions {
    width: 110px; /* Edit, Remove, ⋮ */
}

.block-sessions td:first-child {
    padding-left: 12px;
}

/* drag & drop: rows can be grabbed; the drop position is a primary line above the row (or below the last row) */
.session-draggable {
    cursor: grab;
}

.session-draggable:hover .cell-drag {
    color: var(--mud-palette-text-secondary);
}

.session-dragging {
    opacity: .45;
}

.block-sessions tr.drop-before td {
    box-shadow: inset 0 2px 0 var(--mud-palette-primary);
}

.block-drop-end {
    height: 10px;
}

.block-card.drop-end .block-drop-end {
    box-shadow: inset 0 2px 0 var(--mud-palette-primary);
}

.block-card.drop-end .block-empty {
    background: rgba(var(--mud-palette-primary-rgb), .06);
    color: var(--mud-palette-primary);
}

.block-card.drop-end .block-header {
    background: rgba(var(--mud-palette-primary-rgb), .08);
}

/* the resource a session needs: type icon and text (FSTD: model and configuration) */
.block-sessions .cell-resource {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--mud-palette-text-secondary);
}

.session-resource {
    display: inline-flex;
    vertical-align: middle;
    align-items: center;
    gap: 6px;
}

.session-resource .mud-icon-root {
    flex-shrink: 0;
}

.block-sessions .cell-name {
    width: 22%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* FSTD sessions: event type and briefing / debriefing under the resource */
.session-event {
    margin-left: 26px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .75rem;
}

/* FSTD sessions: briefing / debriefing under the duration */
.block-sessions .session-brief-times {
    display: flex;
    justify-content: flex-end; /* right edge on the duration's, also if it is wider than the column */
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

/* An option with an icon / color swatch and texts (select items, selectable lists):
     <span class="select-option">[icon / swatch]<span class="select-option-text">Name<span class="select-secondary">…</span></span></span>
   The icon is centred on the row; the name and the smaller grey text share their baseline (no pixel nudging). */
.select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

    .select-option > .color-swatch {
        margin-right: 0;
    }

.select-option-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

/* secondary text of an option, e.g. the category of an event type */
.select-secondary {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* course page: the status next to the name */
/* course page: the title (name, version, status) stays in one piece; the actions wrap below it when they do not fit */
.detail-header:has(> .detail-title) {
    flex-wrap: wrap;
    row-gap: 8px;
}

.detail-header:has(> .detail-title) > .detail-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}

.detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    max-width: 100%;
}

.detail-title .mud-typography-h4,
.detail-title .course-version {
    white-space: nowrap;
}

.status-hint {
    margin-left: 8px;
    font-size: .8125rem;
}


/* course → STUDENTS & CREWS: toolbar (search, Add Crew), a card for the students without a crew and one per crew */
.course-members-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.course-members-summary {
    flex-shrink: 0;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.course-members-toolbar .student-search {
    flex: 1;
    max-width: 420px;
    margin: 0;
}

.course-members-toolbar .mud-button-root {
    flex-shrink: 0;
    white-space: nowrap;
}

.course-members-hint {
    margin: -4px 0 12px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.crew-card {
    margin-bottom: 12px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-surface);
    overflow: hidden;
}

.crew-card.crew-none {
    border-style: dashed;
}

.crew-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 2px 8px 2px 12px;
    background: var(--mud-palette-background-gray);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.crew-header .mud-icon-root {
    color: var(--mud-palette-primary);
}

.crew-name {
    font-size: .875rem;
    font-weight: 600;
}

.crew-meta {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.crew-empty {
    padding: 12px 16px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

.crew-students {
    table-layout: fixed;
}

.crew-students td {
    box-sizing: border-box;
}

.crew-students td:first-child {
    padding-left: 12px;
}

.crew-students .cell-drag {
    width: 28px;
    padding-right: 0;
    color: var(--mud-palette-text-disabled);
}

.crew-students .cell-drag .mud-icon-root {
    display: block;
}

.crew-students .cell-student {
    width: 40%;
}

.crew-students .cell-organization {
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crew-students .cell-actions {
    width: 48px;
}

/* drag & drop: a student can be grabbed; the card it would land in is highlighted */
.student-draggable {
    cursor: grab;
}

.student-draggable:hover .cell-drag {
    color: var(--mud-palette-text-secondary);
}

.student-dragging {
    opacity: .45;
}

.crew-card.drop-target {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 1px var(--mud-palette-primary);
}

.crew-card.drop-target .crew-header {
    background: rgba(var(--mud-palette-primary-rgb), .08);
}

/* course: version next to the name */
.course-version {
    font-size: .9375rem;
    color: var(--mud-palette-text-secondary);
}

/* course → SESSIONS: generated sessions per template block; same columns in every block */
.course-sessions-summary {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.course-session-list {
    table-layout: fixed;
}

.course-session-list td {
    box-sizing: border-box;
}

.course-session-list td:first-child {
    padding-left: 12px;
}

.course-session-list .cell-number {
    width: 48px;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.course-session-list .cell-name,
.course-session-list .cell-resource,
.course-session-list .cell-attendees,
.course-session-list .cell-planned {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-session-list .cell-resource {
    width: 20%;
    color: var(--mud-palette-text-secondary);
}

.course-session-list .cell-attendees {
    width: 18%;
}

.course-session-list .cell-duration {
    width: 104px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.course-session-list .session-brief-times {
    display: flex;
    justify-content: flex-end;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.session-crew {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
    font-weight: 500;
}

.session-crew .mud-icon-root {
    color: var(--mud-palette-primary);
}

.session-students {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-sessions-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* ---------- Planning mode: full screen (above the menu and the top bar), sessions left, day scheduler right ---------- */
.planning {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-background);
}

.planning-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
    min-height: 56px;
    padding: 6px 16px;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.planning-icon {
    color: var(--mud-palette-primary);
}

.planning-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.planning-name {
    font-size: 1.0625rem;
    font-weight: 600;
}

.planning-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.planning-body {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 16px 16px;
}

.planning-sessions {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-surface);
    overflow: hidden;
}

.planning-sessions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
    min-height: 40px;
    padding: 0 12px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background-gray);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.planning-sessions-count {
    font-weight: 400;
    letter-spacing: 0;
}

.planning-sessions-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.planning-block {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 4px;
}

.planning-block-name {
    font-size: .8125rem;
    font-weight: 600;
}

.planning-session {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* the drag handle of a session (only it starts a drag) */
.planning-drag {
    display: flex;
    align-items: center;
    flex: none;
    color: var(--mud-palette-text-disabled);
    cursor: grab;
}

.planning-drag:hover {
    color: var(--mud-palette-text-secondary);
}

.planning-drag.disabled {
    visibility: hidden;
}

.planning-session-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.planning-session-name {
    font-size: .875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.planning-session-sub {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.planning-session-sub .mud-icon-root {
    font-size: 1rem;
}

.planning-session-duration {
    flex: none;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
}

.planning-scheduler {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* day calendar: one column per resource; the whole day always fits the height; wide calendars scroll sideways */
.day-calendar-scroll {
    overflow: auto;
}

.day-calendar-scroll .calendar-body {
    min-height: 0;
}

.day-calendar-column-head {
    align-items: flex-start;
    padding: 6px 8px;
}

.day-calendar-column-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-calendar-column-title .mud-icon-root {
    font-size: 1rem;
    color: var(--mud-palette-primary);
}

.day-calendar-slot {
    cursor: default;
}

.day-calendar-item {
    cursor: default;
}

.day-calendar-empty {
    padding: 32px;
    border: 1px dashed var(--mud-palette-lines-default);
    border-radius: 6px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
    text-align: center;
}

/* day calendar drag & drop: quarter-hour slots (line every hour, dotted every half hour), the hovered one highlighted;
   columns that do not suit the dragged thing dimmed; items let drops through to the slots below them */
.calendar-slot.quarter {
    border-top-color: transparent;
}

/* drop zones: the columns (resources) that suit the dragged session, in a very light green */
.day-calendar-column.drop-zone {
    background: color-mix(in srgb, var(--mud-palette-success) 7%, transparent);
}

/* the time slot of the dragged session across all columns: darker start and end lines, light in between */
.day-calendar-timeslot {
    position: absolute;
    left: 56px;
    right: 0;
    z-index: 2;
    box-sizing: border-box;
    border-top: 2px solid color-mix(in srgb, var(--mud-palette-primary) 70%, transparent);
    border-bottom: 2px solid color-mix(in srgb, var(--mud-palette-primary) 70%, transparent);
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, transparent);
    pointer-events: none;
}

/* the dragged session at the quarter hour under the cursor: half-transparent, with its real duration */
.calendar-item-root.day-calendar-ghost {
    z-index: 3;
    opacity: .6;
    pointer-events: none;
}

.day-calendar-ghost .day-calendar-item {
    box-shadow: 0 4px 10px rgba(15, 23, 42, .18);
}

.day-calendar-column.drop-disabled {
    background: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--mud-palette-lines-default) 60%, transparent) 6px 7px);
    opacity: .55;
}

.day-calendar.dragging .calendar-item-root {
    pointer-events: none;
}

.calendar-item-root.day-calendar-dragged {
    opacity: .4;
}

/* planned course sessions (not booked yet): dashed, light */
.day-calendar-item.planned {
    border: 1px dashed var(--event-color, var(--mud-palette-primary)); /* the course template's color */
    border-left: 3px solid var(--event-color, var(--mud-palette-primary));
    background: color-mix(in srgb, var(--event-color, var(--mud-palette-primary)) 8%, var(--mud-palette-surface));
}

.day-calendar-item[draggable="true"] {
    cursor: grab;
}

/* planning list: sessions can be dragged into the calendar; planned ones show when / where; dropping a planned session
   on the list unplans it */
.planning-session.planning-dragging {
    opacity: .45;
}

.planning-session-when {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    margin-top: 2px;
    color: var(--mud-palette-primary);
    font-size: .75rem;
}

.planning-session-when .planning-show {
    padding: 2px;
    margin-left: 2px;
}

.planning-session-when .mud-icon-root {
    font-size: .9rem;
}

.course-session-list .cell-planned {
    width: 158px;
}

.session-planned {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.session-planned .mud-icon-root {
    color: var(--mud-palette-primary);
}

/* course sessions: the problems as a short summary (orange); hovering shows them */
.session-issues {
    display: inline-flex;
    gap: 10px;
    margin-top: 2px;
    cursor: help;
}

.session-issue {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.session-issue .mud-icon-root {
    font-size: 1rem;
}

.session-issue,
.session-issues-head {
    color: var(--mud-palette-warning);
}

.session-issues-tooltip {
    max-width: 360px;
    padding: 0 !important;
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .18);
}

.session-issues-card {
    padding: 10px 12px;
    font-size: .8125rem;
    text-align: left;
}

.session-issues-head {
    font-weight: 600;
}

.session-issues-card ul {
    margin: 4px 0 8px;
    padding-left: 18px;
}

.session-issues-card ul:last-child {
    margin-bottom: 0;
}

.course-session-list .session-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* planning: an item shown from the session list - a thick border that fades out in 1.5 seconds */
@keyframes calendar-item-flash {
    from { box-shadow: 0 0 0 4px var(--mud-palette-primary); }
    to { box-shadow: 0 0 0 4px transparent; }
}

.calendar-item-flash {
    animation: calendar-item-flash 1.5s ease-out forwards;
    z-index: 4;
}

.calendar-item-root:has(.calendar-item-flash) {
    z-index: 4;
    overflow: visible;
}

/* planning: events that are not part of the course - half-transparent (clearer when hovered) */
.day-calendar-item.foreign {
    opacity: .35;
    filter: saturate(.4);
    transition: opacity .15s, filter .15s;
}

.day-calendar-item.foreign .calendar-item-title,
.day-calendar-item.foreign .calendar-item-time {
    color: var(--mud-palette-text-secondary);
    font-weight: 400;
}

.day-calendar-item.foreign:hover,
.day-calendar-item.foreign:focus-visible {
    opacity: .8;
    filter: none;
}

.planning-sessions-filter {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.planning-sessions-filter .planning-type-filter {
    flex: 1 1 auto;
    max-width: 160px;
    margin-left: auto;
}

.planning-sessions-filter .mud-switch {
    margin: 0;
}

.planning-sessions-filter .mud-typography {
    font-size: .8125rem;
}

/* ---------- day calendar, horizontal: one row per resource (name left), the day from left to right ---------- */
.hcal {
    --hcal-label: 180px;
}

.hcal-head {
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: var(--hcal-label) minmax(0, 1fr);
    flex: none;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.hcal-label-head {
    border-right: 1px solid var(--mud-palette-lines-default);
}

.hcal-hours {
    position: relative;
    height: 28px;
}

.hcal-hour {
    position: absolute;
    top: 7px;
    transform: translateX(-50%);
    font-size: .6875rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hcal-body {
    position: relative;
    display: flex;
    flex: 1 1 auto; /* the rows share the height (a scrollbar if they need more) */
    flex-direction: column;
}

.hcal-row {
    display: grid;
    grid-template-columns: var(--hcal-label) minmax(0, 1fr);
    flex: 1 1 0;
    min-height: 72px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.hcal-row:last-child {
    border-bottom: 0;
}

.hcal-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 6px 10px;
    border-right: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.hcal-lane {
    position: relative;
    display: flex;
    flex-direction: row;
    min-width: 0;
}

/* quarter hours side by side: a line every hour, a dotted line every half hour, none in between */
.hcal-lane .day-calendar-slot {
    flex: 1 1 0;
    min-width: 0;
    border-top: 0;
    border-left: 1px solid var(--mud-palette-lines-default);
}

.hcal-lane .day-calendar-slot:first-child,
.hcal-lane .day-calendar-slot.quarter {
    border-left-color: transparent;
}

.hcal-lane .day-calendar-slot.half {
    border-top: 0;
    border-left: 1px dotted color-mix(in srgb, var(--mud-palette-lines-default) 70%, transparent);
}

/* items: briefing / debriefing left and right of the session */
.day-calendar.horizontal .calendar-item-inner {
    flex-direction: row;
}

.day-calendar.horizontal .calendar-band.before {
    border-bottom: 0;
    border-right: 1px dashed color-mix(in srgb, var(--event-color, var(--mud-palette-primary)) 45%, transparent);
}

.day-calendar.horizontal .calendar-band.after {
    border-top: 0;
    border-left: 1px dashed color-mix(in srgb, var(--event-color, var(--mud-palette-primary)) 45%, transparent);
}

.day-calendar.horizontal .calendar-main {
    min-width: 0;
}

/* the now line: vertical */
.hcal-lane .calendar-now {
    top: 0;
    bottom: 0;
    right: auto;
    width: 2px;
    height: auto;
    margin-top: 0;
    margin-left: -1px;
}

/* the time slot of the dragged session: across all rows */
.day-calendar-timeslot.horizontal {
    top: 0;
    bottom: 0;
    right: auto;
    border-top: 0;
    border-bottom: 0;
    border-left: 2px solid color-mix(in srgb, var(--mud-palette-primary) 70%, transparent);
    border-right: 2px solid color-mix(in srgb, var(--mud-palette-primary) 70%, transparent);
}

.planning-orientation .mud-button-root {
    white-space: nowrap;
}

/* several days: a strong line between days, the days labelled in bold */
.day-calendar-slot.day-line {
    border-top: 2px solid color-mix(in srgb, var(--mud-palette-text-secondary) 45%, transparent);
}

.hcal-lane .day-calendar-slot.day-line {
    border-top: 0;
    border-left: 2px solid color-mix(in srgb, var(--mud-palette-text-secondary) 45%, transparent);
}

.calendar-hour.day,
.hcal-hour.day {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.day-calendar.multi-day .calendar-hour {
    white-space: nowrap;
}

/* planning (several days): the session hovered in the list, highlighted in the calendar */
.calendar-item-highlight {
    box-shadow: 0 0 0 3px var(--mud-palette-primary);
}

.calendar-item-root:has(.calendar-item-highlight) {
    z-index: 4;
}

/* ---------- month calendar: day tiles, Monday to Sunday, the weeks from top to bottom ---------- */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: var(--mud-palette-surface);
    overflow: hidden;
}

.month-weekday {
    padding: 6px 8px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.month-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    min-height: 0;
    padding: 4px 6px;
    overflow: hidden;
    border-right: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    cursor: pointer;
}

.month-tile:nth-child(7n) {
    border-right: 0;
}

.month-tile:hover {
    background: var(--mud-palette-action-default-hover);
}

.month-tile.other-month {
    background: var(--mud-palette-background-gray);
}

.month-tile.other-month .month-day-number {
    color: var(--mud-palette-text-disabled);
}

.month-day-number {
    align-self: flex-end;
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.month-tile.today .month-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.month-item-root {
    display: block;
    min-width: 0;
}

.month-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 1px 6px;
    border-left: 3px solid var(--event-color, var(--mud-palette-primary));
    border-radius: 3px;
    background: color-mix(in srgb, var(--event-color, var(--mud-palette-primary)) 10%, var(--mud-palette-surface));
    font-size: .75rem;
    line-height: 1.5;
    cursor: default;
}

.month-item-time {
    flex: none;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

.month-item-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-more {
    font-size: .6875rem;
    color: var(--mud-palette-text-secondary);
}

/* courses list: the version status and the number of problems */
.list-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 3px;
}

.list-item-meta .status-chip {
    font-size: .6875rem;
    padding: 0 6px;
}

.session-dialog-students {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

/* ---------- publish course dialog ---------- */
.publish-summary {
    margin: 0 0 8px;
}

.publish-problems {
    margin: 0 0 8px;
    color: var(--mud-palette-error);
}

.publish-recipients-head {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-weight: 600;
}

.publish-recipients {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
}

.publish-recipient {
    display: grid;
    grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) 90px minmax(0, 1.4fr);
    align-items: center;
    gap: 8px;
    padding: 0 12px 0 4px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    cursor: pointer;
}

.publish-recipient:last-child {
    border-bottom: none;
}

.publish-recipient-role,
.publish-recipient-email {
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publish-recipient-email.missing {
    color: var(--mud-palette-error);
}

.publish-none {
    color: var(--mud-palette-text-secondary);
}

/* ---------- Settings → E-Mail Server ---------- */
.mail-server .mail-redirect {
    color: var(--mud-palette-warning-darken);
    font-weight: 600;
}

.publish-group {
    padding: 6px 12px 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background-gray);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.publish-group-hint {
    margin-left: 8px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.publish-recipient-changes {
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.publish-recipient.no-changes {
    cursor: default;
    opacity: .5;
}

/* ---------- Device key (shown once after creating a device / New Key) ---------- */
.device-key-intro {
    margin: 0 0 12px;
}

.device-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-key {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-background-gray);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: .8125rem;
    word-break: break-all;
    user-select: all;
}

/* ---------- Links to entities (EntityLink): tooltip "<icon> <type>: <name>" ---------- */
/* terminals: "simulator (site)" on one line (the links are inline-blocks: MudBlazor keeps an invisible block element of
   the tooltip inside them, so "display: inline" would break the line after each link) */
.identity-simulator {
    white-space: nowrap;
}

/* light card like the event hover card */
.mud-tooltip.entity-tooltip {
    padding: 6px 10px;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .16);
    font-size: .8125rem;
    line-height: 1.4;
    text-align: left;
}

    .mud-tooltip.entity-tooltip.mud-tooltip-arrow::after {
        border-color: var(--mud-palette-lines-default) transparent transparent transparent;
    }

.entity-tooltip-content {
    display: flex; /* a block: no text baseline below it, so it sits centered in the card */
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

    .entity-tooltip-content .mud-icon-root {
        font-size: 1rem;
        color: var(--mud-palette-text-secondary);
    }

.entity-tooltip-type {
    color: var(--mud-palette-text-secondary);
}

.entity-tooltip-name {
    font-weight: 600;
}

/* details below the title (e.g. address and e-mail of a person), aligned with the title text */
.entity-tooltip-details {
    margin: 4px 0 0 22px;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.entity-tooltip-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

    .entity-tooltip-line .mud-icon-root {
        font-size: .875rem;
    }

/* ---------- Effective permission matrix of an identity (PermissionMatrixDialog) ---------- */
.permission-matrix-wrap {
    max-height: 65vh;
    overflow: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
}

.permission-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .8125rem;
}

    .permission-matrix th,
    .permission-matrix td {
        padding: 6px 12px;
        border-bottom: 1px solid var(--mud-palette-lines-default);
        text-align: left;
        vertical-align: top;
    }

    .permission-matrix thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--mud-palette-background-gray);
        font-weight: 600;
        color: var(--mud-palette-text-secondary);
        white-space: nowrap;
    }

    /* first column stays visible while scrolling sideways */
    .permission-matrix .pm-permission {
        position: sticky;
        left: 0;
        z-index: 1;
        min-width: 150px;
        background: var(--mud-palette-surface);
        font-weight: 500;
        white-space: nowrap;
    }

    .permission-matrix thead .pm-permission {
        z-index: 3;
        background: var(--mud-palette-background-gray);
    }

.pm-role-name {
    display: block;
    color: var(--mud-palette-text-primary);
}

.pm-role-through {
    display: block;
    font-weight: 400;
    font-size: .75rem;
}

.permission-matrix .pm-cell,
.permission-matrix td.pm-effective {
    min-width: 120px;
    max-width: 240px;
}

/* the result: emphasised column */
.permission-matrix .pm-effective {
    border-left: 1px solid var(--mud-palette-lines-default);
    background: rgba(var(--mud-palette-primary-rgb), .04);
}

/* its head stays opaque (sticky: the rows scroll under it) - the tint over the head's own background */
.permission-matrix thead th.pm-effective {
    background: linear-gradient(rgba(var(--mud-palette-primary-rgb), .04), rgba(var(--mud-palette-primary-rgb), .04)), var(--mud-palette-background-gray);
}

.permission-matrix tr.pm-granted td.pm-effective {
    color: var(--mud-palette-primary);
    font-weight: 600;
}

.app-dark .permission-matrix tr.pm-granted td.pm-effective,
body:has(.app-dark) .permission-matrix tr.pm-granted td.pm-effective {
    color: var(--app-link);
}

.permission-matrix .pm-area td {
    padding-top: 12px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-surface);
}

.pm-dash {
    color: var(--mud-palette-text-disabled);
}

.pm-search {
    margin-bottom: 10px;
}

.permission-matrix .pm-empty {
    color: var(--mud-palette-text-secondary);
}

/* explicit grant + "…" (the grants through other permissions on hovering) */
.pm-cell-content {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.pm-more {
    padding: 0 6px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    cursor: default;
}

    .pm-more:hover,
    .pm-more:focus-visible {
        border-color: var(--mud-palette-text-secondary);
        color: var(--mud-palette-text-primary);
    }

.pm-more-title {
    margin-bottom: 2px;
    font-weight: 600;
}

.pm-more-line {
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

/* identity role → PERMISSIONS: search above the table */
.permission-search {
    margin-bottom: 8px;
}

/* ---------- Help menu (top bar): version and Version History (CHANGELOG.md) ---------- */
.help-version {
    display: flex;
    flex-direction: column;
    padding: 10px 16px 8px;
    min-width: 200px;
}

.help-version-name {
    font-weight: 600;
}

.help-version-number {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.version-current {
    margin-bottom: 12px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

.version-history {
    max-height: 65vh;
    overflow-y: auto;
    font-size: .875rem;
    line-height: 1.55;
}

    .version-history h1 {
        display: none; /* the dialog has its title */
    }

    .version-history h2 {
        margin: 18px 0 6px;
        padding-bottom: 4px;
        border-bottom: 1px solid var(--mud-palette-lines-default);
        font-size: 1.0625rem;
        font-weight: 600;
    }

        .version-history h2:first-of-type {
            margin-top: 0;
        }

    .version-history h3 {
        margin: 12px 0 4px;
        font-size: .875rem;
        font-weight: 600;
        color: var(--mud-palette-text-secondary);
    }

    .version-history p {
        margin: 0 0 8px;
    }

    .version-history ul,
    .version-history ol {
        margin: 0 0 8px;
        padding-left: 22px;
    }

    .version-history li {
        margin: 2px 0;
    }

    .version-history code {
        padding: 1px 4px;
        border-radius: 3px;
        background: var(--mud-palette-background-gray);
        font-size: .8125rem;
    }

    .version-history a {
        color: var(--app-link);
    }

    .version-history table {
        border-collapse: collapse;
        margin: 0 0 8px;
    }

    .version-history th,
    .version-history td {
        padding: 4px 10px;
        border: 1px solid var(--mud-palette-lines-default);
        text-align: left;
    }

/* ---------- Documentation (Help → Documentation): table of contents and topics (Markdown) ---------- */
.docs-toc-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    user-select: none;
    gap: 4px;
    width: 100%;
    border: 0;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    padding-top: 14px;
    padding-bottom: 4px;
    padding-right: 16px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.docs-toc-topic.list-item {
    padding-top: 7px;
    padding-bottom: 7px;
}

.docs-breadcrumb {
    margin-bottom: 6px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* topic and its "On this page" links side by side (the links stay in view while scrolling) */
.docs-layout {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

    .docs-layout .docs-topic {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 1100px;
    }

.docs-outline {
    position: sticky;
    top: 0;
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    padding-left: 14px;
    border-left: 1px solid var(--mud-palette-lines-default);
    font-size: .8125rem;
}

.docs-outline-title {
    margin-bottom: 6px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.docs-outline-link {
    padding: 3px 0;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
}

    .docs-outline-link:hover {
        color: var(--app-link);
    }

    .docs-outline-link.level-3 {
        padding-left: 12px;
    }

/* narrow screens: no "On this page" column */
@media (max-width: 1100px) {
    .docs-outline {
        display: none;
    }
}

/* a rendered Markdown document */
.markdown-body {
    max-width: 1100px;
    font-size: .9375rem;
    line-height: 1.6;
}

    .markdown-body h1 {
        margin: 0 0 14px;
        font-size: 1.75rem;
        font-weight: 600;
        letter-spacing: -.01em;
    }

    .markdown-body h2 {
        margin: 26px 0 8px;
        padding-bottom: 4px;
        border-bottom: 1px solid var(--mud-palette-lines-default);
        font-size: 1.25rem;
        font-weight: 600;
    }

    .markdown-body h3 {
        margin: 20px 0 6px;
        font-size: 1.0625rem;
        font-weight: 600;
    }

    .markdown-body p,
    .markdown-body ul,
    .markdown-body ol,
    .markdown-body table,
    .markdown-body pre,
    .markdown-body blockquote {
        margin: 0 0 12px;
    }

    .markdown-body ul,
    .markdown-body ol {
        padding-left: 24px;
    }

    .markdown-body li {
        margin: 3px 0;
    }

    .markdown-body a {
        color: var(--app-link);
        text-decoration: underline;
        text-decoration-color: var(--app-link-underline);
    }

        .markdown-body a:hover {
            color: var(--app-link-hover);
        }

    .markdown-body code {
        padding: 1px 5px;
        border-radius: 4px;
        background: var(--mud-palette-background-gray);
        font-family: Consolas, "Cascadia Mono", monospace;
        font-size: .8125rem;
    }

    .markdown-body pre {
        padding: 10px 12px;
        overflow-x: auto;
        border: 1px solid var(--mud-palette-lines-default);
        border-radius: 6px;
        background: var(--mud-palette-background-gray);
    }

        .markdown-body pre code {
            padding: 0;
            background: none;
        }

    .markdown-body blockquote {
        padding: 8px 14px;
        border-left: 4px solid rgba(var(--mud-palette-info-rgb), .6);
        border-radius: 0 6px 6px 0;
        background: rgba(var(--mud-palette-info-rgb), .06);
        color: var(--mud-palette-text-primary);
    }

        .markdown-body blockquote p:last-child {
            margin-bottom: 0;
        }

    .markdown-body table {
        border-collapse: collapse;
        font-size: .875rem;
    }

    .markdown-body th,
    .markdown-body td {
        padding: 6px 12px;
        border: 1px solid var(--mud-palette-lines-default);
        text-align: left;
        vertical-align: top;
    }

    .markdown-body th {
        background: var(--mud-palette-background-gray);
        font-weight: 600;
    }

    .markdown-body hr {
        margin: 20px 0;
        border: 0;
        border-top: 1px solid var(--mud-palette-lines-default);
    }

    .markdown-body .task-list-item {
        list-style: none;
    }

        .markdown-body .task-list-item input {
            margin-right: 6px;
        }

/* images of the documentation: screenshots (framed, at most the text width) and icons (inline, text height); with a dark
   variant, the one of the current appearance is shown */
.markdown-body img.doc-img {
    display: block;
    max-width: 100%;
    height: auto; /* the width comes from the image (75 % of the app's size), shrinks on narrow screens */
    margin: 4px 0 6px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}

.markdown-body img.doc-icon {
    height: 1.6em;
    vertical-align: middle;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
}

.markdown-body img.doc-dark {
    display: none;
}

.app-dark .markdown-body img.doc-light,
body:has(.app-dark) .markdown-body img.doc-light {
    display: none;
}

.app-dark .markdown-body img.doc-img.doc-dark,
body:has(.app-dark) .markdown-body img.doc-img.doc-dark {
    display: block;
}

.app-dark .markdown-body img.doc-icon.doc-dark,
body:has(.app-dark) .markdown-body img.doc-icon.doc-dark {
    display: inline;
}

/* callout boxes in the documentation ("> [!NOTE]", "> [!TIP]", "> [!IMPORTANT]", "> [!WARNING]", "> [!CAUTION]") */
.markdown-body .markdown-alert {
    --alert-rgb: var(--mud-palette-info-rgb);
    margin: 0 0 14px;
    padding: 10px 14px;
    border-left: 4px solid rgba(var(--alert-rgb), .85);
    border-radius: 0 6px 6px 0;
    background: rgba(var(--alert-rgb), .07);
}

    .markdown-body .markdown-alert > :last-child {
        margin-bottom: 0;
    }

.markdown-body .markdown-alert-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    font-weight: 600;
    color: rgb(var(--alert-rgb));
}

    .markdown-body .markdown-alert-title svg {
        fill: currentColor;
    }

.markdown-body .markdown-alert-tip {
    --alert-rgb: var(--mud-palette-success-rgb);
}

.markdown-body .markdown-alert-important {
    --alert-rgb: var(--mud-palette-primary-rgb);
}

.markdown-body .markdown-alert-warning {
    --alert-rgb: var(--mud-palette-warning-rgb);
}

.markdown-body .markdown-alert-caution {
    --alert-rgb: var(--mud-palette-error-rgb);
}

/* "important" in the primary color would be too dark in dark mode */
.app-dark .markdown-body .markdown-alert-important,
body:has(.app-dark) .markdown-body .markdown-alert-important {
    --alert-rgb: 138, 180, 248;
}

/* ---------- Settings → Identity Providers ---------- */
.status-chip.provider-enabled {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .35);
}

.status-chip.provider-disabled {
    color: var(--mud-palette-text-secondary);
    background: rgba(var(--mud-palette-text-secondary-rgb, 100, 116, 139), .08);
    border-color: var(--mud-palette-lines-default);
}

.provider-redirect {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

    .provider-redirect code {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 2px 6px;
        border-radius: 4px;
        background: var(--mud-palette-background-gray);
        font-family: Consolas, "Cascadia Mono", monospace;
        font-size: .8125rem;
    }

.provider-test {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .8125rem;
}

.provider-test-ok {
    color: var(--mud-palette-success);
}

.provider-test-failed {
    color: var(--mud-palette-error);
}

/* sign-in page: "Sign in with …" */
.login-providers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

/* sign-in page: "Choose how to sign in." above the methods, and the way back from the form to them */
.login-intro {
    margin: 0;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

.login-intro + .login-providers {
    margin-top: 12px;
}

.login-back {
    display: inline-block;
    margin-top: 16px;
    font-size: .8125rem;
    color: var(--app-link);
    text-decoration: none;
}

    .login-back:hover {
        text-decoration: underline;
    }

.login-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 4px;
    color: var(--mud-palette-text-primary);
    font-weight: 500;
    text-decoration: none;
}

    .login-provider:hover {
        background: var(--mud-palette-action-default-hover);
    }

    .login-provider svg {
        width: 20px;
        height: 20px;
    }

/* links to accounts at identity providers (My Profile, identity dialog) */
.profile-logins {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-login {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    font-size: .875rem;
}

.profile-login-name {
    font-weight: 500;
}

.profile-login-account {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

/* My Profile: a titled group (MAINTENANCE: Quick Access) */
.profile-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.profile-group-title {
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.profile-quick-access-switch {
    margin-left: -8px;
}

.profile-quick-access-code input {
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* identity dialog: tabs GENERAL and LOGINS; same height for both, so the dialog does not jump */
.identity-dialog-tab {
    min-height: 300px;
}

.identity-logins-table .mud-toolbar {
    padding-left: 0;
    padding-right: 0;
}

/* status of a login: color shows it (pending = applied with Save) */
.login-status-active {
    color: var(--mud-palette-success);
}

.login-status-pending {
    color: var(--mud-palette-primary);
    font-weight: 500;
}

.login-status-waiting {
    color: var(--mud-palette-warning);
}

.login-status-disabled {
    color: var(--mud-palette-text-disabled);
}

/* an invitation not yet accepted (or expired) */
.login-status-invited {
    color: var(--mud-palette-warning);
}

/* identities table: Active / Inactive (color shows the status) */
.identity-status-active {
    color: var(--mud-palette-success);
}

.identity-status-inactive {
    color: var(--mud-palette-text-disabled);
}

/* identities table: Pending (invited, not yet accepted) */
.identity-status-pending {
    color: var(--mud-palette-warning);
}

/* invitation summary: color shows the result */
.invite-summary {
    margin: 0 0 8px;
    font-weight: 500;
}

.invite-result-ok {
    color: var(--mud-palette-success);
}

.invite-result-skipped {
    color: var(--mud-palette-text-secondary);
}

.invite-result-failed {
    color: var(--mud-palette-error);
}

.invite-results .invite-note {
    white-space: normal;
    color: var(--mud-palette-text-secondary);
}

/* the info icon next to "Inactive": hover shows why */
.identity-status-info {
    margin-left: 4px;
    vertical-align: -3px;
    font-size: 1rem !important;
    color: var(--mud-palette-text-secondary);
    cursor: help;
}

/* a disabled login: type and account greyed out (the switch and the buttons stay usable) */
.identity-logins-table tr.login-disabled td:not(.cell-actions) .type-label,
.identity-logins-table tr.login-disabled td[data-label="Account"] {
    color: var(--mud-palette-text-disabled);
}

/* =====================================================================
   Roles (Pilot / Training Administration): roles to pick on the left, a matrix persons × selected roles on the right.
   ===================================================================== */
.role-pick {
    cursor: pointer;
    align-items: center;
}

.role-pick input[type="checkbox"] {
    margin: 0 10px 0 4px;
    accent-color: var(--mud-palette-primary);
    flex: 0 0 auto;
}

.role-matrix-clear {
    margin-left: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--mud-palette-primary);
    font: inherit;
    cursor: pointer;
}

.role-matrix-clear:hover {
    text-decoration: underline;
}

.role-matrix-wrap {
    overflow: auto;
    min-height: 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-surface);
}

.role-matrix {
    border-collapse: collapse;
    width: 100%;
    font-size: .875rem;
}

.role-matrix th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--mud-palette-surface);
    text-align: center;
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--mud-palette-text-secondary);
    padding: 10px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    white-space: nowrap;
}

.role-matrix td {
    text-align: center;
    padding: 6px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.role-matrix tbody tr:last-child td {
    border-bottom: 0;
}

.role-matrix tbody tr:hover td {
    background: var(--mud-palette-action-default-hover);
}

.role-matrix th.role-matrix-person,
.role-matrix td.role-matrix-person {
    text-align: left;
    width: 280px;
    min-width: 220px;
}

.role-matrix-org {
    display: block;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.role-matrix .role-chip {
    padding: 2px 10px;
}

.role-matrix td.role-matrix-empty {
    text-align: left;
    padding: 16px 12px;
    color: var(--mud-palette-text-secondary);
}

/* Dropdowns without typing (MudSelect: its input is read-only): no text cursor when focused. Autocompletes (typing
   allowed) keep it. */
.mud-select input[readonly] {
    caret-color: transparent;
}

/* Dense outlined dropdowns with a label: MudSelect shows a value in a div padded 10.5px / 10.5px, the placeholder in
   the input padded 12.5px / 8.5px - the value sat 2px higher. A text value gets the input's padding; a value with an
   icon (taller than the text) keeps the even padding, which centers it. */
.mud-input-outlined-with-label .mud-select-input > div.mud-input-slot.mud-input-root-margin-dense:not(:has(.mud-icon-root)) {
    padding-top: 12.5px;
    padding-bottom: 8.5px;
}

/* Roles page: preset buttons (Show Missing / Show Expiring Soon) */
.role-preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

/* Document type → ASSIGNED TAGS: a short hint above the chips; chip names are plain text */
.group-hint {
    margin-bottom: 8px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.tag-chip-name-static {
    padding-right: 4px;
}

/* Session requirements dialog: tabs keep their height */
.session-requirements-tab {
    min-height: 200px;
}

/* Course → SESSIONS (draft): the ⋮ column */
.course-session-list .cell-actions {
    width: 40px;
    text-align: right;
}

/* Requirements editor: nested "all of" / "any of" groups with roles and qualifications */
.req-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.req-toolbar .req-summary {
    margin-bottom: 0;
}

.req-summary {
    margin-bottom: 12px;
    font-size: .875rem;
}

.req-summary-label {
    margin-right: 6px;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.req-summary-none {
    color: var(--mud-palette-error);
}

.req-group {
    border: 1px solid var(--mud-palette-lines-default);
    border-left-width: 3px;
    border-radius: var(--mud-default-borderradius);
    padding: 8px 10px;
    background: var(--mud-palette-surface);
}

.req-group.req-all {
    border-left-color: var(--mud-palette-primary);
}

.req-group.req-any {
    border-left-color: var(--mud-palette-warning);
}

.req-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.req-kind {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--mud-palette-text-secondary);
}

.req-kind-switch a {
    cursor: pointer;
}

.req-children {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.req-children > .req-group {
    align-self: stretch;
}

.req-connector {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--mud-palette-text-secondary);
    padding-left: 4px;
}

.req-empty {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.req-leaf {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 2px 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    font-size: .8125rem;
    background: var(--mud-palette-background);
}

.req-leaf .mud-icon-root {
    font-size: 16px;
    color: var(--mud-palette-text-secondary);
}

.req-leaf-type {
    color: var(--mud-palette-text-secondary);
}

.req-leaf-name {
    font-weight: 600;
}

.req-add {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.req-add-picker {
    max-width: 320px;
}

/* Dropdown entries with icon, title and subtitle: the list item's text element and the entry are flexes, every part
   (icon, title, subtitle) an inline-block - so the flex centres them vertically */
.mud-popover .mud-list-item-text:has(.req-option),
.mud-popover .mud-list-item-text:has(.req-option) > .mud-typography {
    display: flex;
    align-items: center;
}

.req-option {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.req-option > * {
    display: inline-block;
    vertical-align: middle;
    line-height: 1.4;
}

.req-option > .mud-icon-root {
    flex: none;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.req-option > .implied-option-category {
    margin-left: 4px;
    margin-top: 2px; /* the smaller type label sits optically centred (user's value from DevTools) */
}

/* Load Requirement dialog: the saved requirements as a list of clickable rows (name + type, the requirement as text) */
.load-requirement-list {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
}

.load-requirement-list:has(> .group-empty:only-child) {
    border: 0;
}

.load-requirement-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.load-requirement-item:last-child {
    border-bottom: 0;
}

.load-requirement-item:hover,
.load-requirement-item:focus-visible {
    background: var(--mud-palette-action-default-hover);
    outline: none;
}

.load-requirement-name {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: .875rem;
    font-weight: 600;
}

.load-requirement-text {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Course template → REVISIONS: the tab fills the height; only the blocks of the selected revision scroll (the revision
   list, the revision header with Add Block / Publish and the summary stay in place) */
.tab-content:has(> .revisions) {
    overflow: hidden;
}

.revisions {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
}

.revisions > .revision-list {
    max-height: 100%;
    overflow-y: auto;
}

.revisions > .revision-detail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.revision-blocks {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px; /* room for the scrollbar */
}

/* Course → SESSIONS: the summary stays, the blocks scroll when they do not fit (the cards keep their height) */
.tab-content:has(> .course-session-blocks) {
    overflow: hidden;
}

.course-sessions-toolbar {
    flex: none;
}

.course-session-blocks {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px; /* room for the scrollbar */
}

.course-session-blocks > .block-card,
.revision-blocks > .block-card {
    flex-shrink: 0;
}

/* Dragging in the scheduler: the start and end line also run through the ruler (times on top / hours on the left), with
   the start and end time of the drag at the lines */
.ruler-drag {
    position: absolute;
    z-index: 3;
    box-sizing: border-box;
    pointer-events: none;
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, transparent);
}

.ruler-drag.horizontal {
    top: 0;
    bottom: 0;
    border-left: 2px solid color-mix(in srgb, var(--mud-palette-primary) 70%, transparent);
    border-right: 2px solid color-mix(in srgb, var(--mud-palette-primary) 70%, transparent);
}

.ruler-drag.vertical {
    left: 0;
    right: 0;
    border-top: 2px solid color-mix(in srgb, var(--mud-palette-primary) 70%, transparent);
    border-bottom: 2px solid color-mix(in srgb, var(--mud-palette-primary) 70%, transparent);
}

.ruler-drag-time {
    position: absolute;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .6875rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
}

/* horizontal: the start time left of the start line, the end time right of the end line (they never overlap) */
.ruler-drag.horizontal .ruler-drag-time {
    top: 50%;
    transform: translateY(-50%);
}

.ruler-drag.horizontal .ruler-drag-time.start {
    right: calc(100% + 2px);
}

.ruler-drag.horizontal .ruler-drag-time.end {
    left: calc(100% + 2px);
}

/* vertical: the start time above the start line, the end time below the end line */
.ruler-drag.vertical .ruler-drag-time {
    left: 2px;
}

.ruler-drag.vertical .ruler-drag-time.start {
    bottom: calc(100% + 1px);
}

.ruler-drag.vertical .ruler-drag-time.end {
    top: calc(100% + 1px);
}

/* MAINTENANCE pages (not built yet): title, then the "not available yet" note filling the page */
.maintenance-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--app-topbar-height));
    padding: 20px 24px;
}

.maintenance-page .detail-empty {
    flex: 1 1 auto;
}

/* MAINTENANCE → Dashboard: one tile per resource (name, type / model and site, status) */
.maintenance-dashboard {
    overflow-y: auto;
}

.resource-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* always three per row, filling the width (also with fewer tiles) */
    gap: 16px;
}

.resource-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}

.resource-tile:has(.resource-tile-main:hover),
.resource-tile:has(.resource-tile-main:focus-visible) {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}

/* the upper part of a tile (name, status, configuration): opens the simulator */
.resource-tile-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: inherit;
    text-decoration: none;
    outline: none;
}

.resource-tile-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-tile-head .mud-icon-root {
    color: var(--mud-palette-text-secondary);
}

.resource-tile-name {
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-tile-sub {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.resource-tile-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.resource-tile-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--mud-palette-text-secondary);
}

/* narrow screens: fewer tiles per row */
@media (max-width: 900px) {
    .resource-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .resource-tiles {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Dashboard tile: further rows below the status (label left, value right) */
.resource-tile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.resource-tile-value {
    font-size: .875rem;
    font-weight: 600;
}

/* Dashboard tile: problems of the simulator below a separator, each in the color of its priority */
.resource-tile-problems {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px; /* + the tile gap of 4px = 8px, as above the status */
    padding-top: 8px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.resource-tile-problem {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--priority-color);
}

.resource-tile-problem .mud-icon-root {
    flex: none;
    margin-top: 1px;
    color: var(--priority-color);
}

.resource-tile-problem-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.resource-tile-problem-title {
    font-size: .875rem;
    font-weight: 600;
}

.resource-tile-problem-detail {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.resource-tile-no-problems {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

/* Dashboard tile: the reserved (empty) configuration row of a tile without configurations */
.resource-tile-placeholder {
    visibility: hidden;
}

/* a problem of a tile is a link (to where it can be solved): highlighted on hover */
a.resource-tile-problem {
    margin: 0 -6px;
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none;
}

a.resource-tile-problem:hover,
a.resource-tile-problem:focus-visible {
    background: var(--mud-palette-action-default-hover);
    outline: none;
}

/* Customization → MAINTENANCE → REGULAR CHECKS: one row per check (name, medium, high, unit) */
.customization-fields:has(.regular-checks) {
    max-width: 760px;
}

.regular-checks {
    display: grid;
    grid-template-columns: 140px 150px 150px minmax(0, 1fr);
    align-items: center;
    gap: 12px 16px;
}

.regular-check-name {
    font-size: .875rem;
    font-weight: 600;
}

.regular-check-unit {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

/* read-only numbers: same look as the read-only dropdowns */
.customization-fields.read-only .mud-input.mud-input-outlined {
    background: color-mix(in srgb, var(--mud-palette-background-gray) 50%, var(--mud-palette-surface));
}

/* Dashboard: two rows of tiles fill the visible height (detail pane: 20px padding top and bottom, 16px gap); more rows
   scroll the page. In a tile, the problems take the rest of its height and scroll on their own if they are many. */
.resource-tiles {
    grid-auto-rows: calc((100vh - var(--app-topbar-height) - 40px - 16px) / 2);
}

.resource-tile {
    min-height: 0;
    overflow: hidden;
}

.resource-tile-main {
    flex: none;
}

.resource-tile-problems {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* the problems scroll vertically only: the list reaches 6px further on both sides (padding keeps the text in line), so
   the hover highlight of a problem (margin -6px) stays inside it */
.resource-tile-problems {
    margin-left: -6px;
    margin-right: -6px;
    padding-left: 6px;
    padding-right: 6px;
    overflow-x: hidden;
}

/* Dashboard tile: grip in the upper right corner (drag the tile to another place); the dragged tile is faded, the tile
   it would go to is outlined */
.resource-tile {
    position: relative;
}

.resource-tile-head {
    padding-right: 24px;
}

.resource-tile-drag {
    position: absolute;
    top: 12px;
    right: 10px;
    display: inline-flex;
    padding: 2px;
    border-radius: 4px;
    color: var(--mud-palette-text-secondary);
    cursor: grab;
}

.resource-tile-drag:hover {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-text-primary);
}

.resource-tile-dragging {
    opacity: .5;
}

.resource-tile.resource-tile-drop-target {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 2px var(--mud-palette-primary);
}

/* Dashboard tile: "N Open Downtimes" below the type/site line, a link to them (MAINTENANCE → Downtimes); with open
   downtimes in the color of a medium priority */
.resource-tile-downtimes {
    align-self: flex-start;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
}

.resource-tile-downtimes.has-downtimes {
    color: var(--mud-palette-warning-darken);
}

.resource-tile-downtimes:hover,
.resource-tile-downtimes:focus-visible {
    text-decoration: underline;
    outline: none;
}

/* MAINTENANCE → Downtimes: status of a downtime (open: amber, closed: green) */
/* a group of checkboxes in a dialog with a small label (e.g. an audit type's resource types) */
.dialog-field-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dialog-field-label {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 2px;
}

/* audits of resources: planned (neutral), scheduled (blue), completed (green), canceled (grey, struck through) */
.status-chip.audit-status-planned {
    color: var(--mud-palette-text-secondary);
    background: color-mix(in srgb, var(--mud-palette-text-secondary) 8%, transparent);
    border-color: color-mix(in srgb, var(--mud-palette-text-secondary) 40%, transparent);
}

.status-chip.audit-status-scheduled {
    color: var(--mud-palette-info);
    background: rgba(var(--mud-palette-info-rgb), .08);
    border-color: rgba(var(--mud-palette-info-rgb), .35);
}

.status-chip.audit-status-completed {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .35);
}

.status-chip.audit-status-canceled {
    color: var(--mud-palette-text-disabled);
    background: transparent;
    border-color: var(--mud-palette-lines-default);
    text-decoration: line-through;
}

.status-chip.downtime-open {
    color: var(--mud-palette-warning-darken);
    background: rgba(var(--mud-palette-warning-rgb), .1);
    border-color: rgba(var(--mud-palette-warning-rgb), .45);
}

.status-chip.downtime-closed {
    color: var(--mud-palette-success);
    background: rgba(var(--mud-palette-success-rgb), .08);
    border-color: rgba(var(--mud-palette-success-rgb), .35);
}

/* Resource → OVERVIEW: GENERAL and CONFIGURATIONS keep their height, NOTIFICATIONS fills the rest of the tab (never
   higher) and scrolls on its own; if too little is left, the tab scrolls */
.resource-overview {
    flex: 1 1 auto;
    min-height: 0;
}

.resource-overview > .info-group {
    flex: none;
}

.resource-overview > .resource-notifications {
    flex: 1 1 auto;
    min-height: 160px;
    display: flex;
    flex-direction: column;
}

.resource-notifications .info-group-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* the AUDIT LOG tab always sits on the right of the tab bar, the other tabs on the left */
.tabs > [data-tab="AUDIT"] {
    margin-left: auto;
}

/* Event dialog: the fields in groups (EVENT, PLANNED TIME, STATUS; ATTENDEES on the right), each with a small title over
   a line */
.event-form-main {
    gap: 24px;
}

.event-form-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.event-form-group-title {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

/* the attendee list and search stay close together under their title */
.event-form-attendees {
    gap: 8px;
}

/* Event dialog groups as boxes like the INFO groups of the detail pages (GENERAL, …): border, header bar with the title */
.event-form-main {
    gap: 16px;
}

.event-form-group {
    padding: 0 14px 14px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-surface);
}

.event-form-group-title {
    margin: 0 -14px;
    padding: 8px 14px;
    letter-spacing: .08em;
    background: var(--mud-palette-background);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px 4px 0 0;
}

.event-form-attendees {
    gap: 14px;
}

/* Event dialog → TIMES (full width): PLANNED and ACTUAL side by side, each with a small label over its fields */
.event-times {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.event-times-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.event-times-column > .dialog-label {
    margin-bottom: -8px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .6875rem;
}

@media (max-width: 760px) {
    .event-times {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Event dialog: may use nearly the whole window height (MudBlazor limits dialogs to the window minus the app bar), so its
   form fits without a scrollbar on common screens */
.mud-dialog.event-dialog {
    max-height: calc(100vh - 24px);
}

/* Event → lock: the views to pick */
.event-lock-views {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
}

/* Event dialog: the lock next to the title (open: grey; locked: amber) */
.event-title-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.event-title-row > .mud-input-control {
    flex: 1 1 auto;
}

.event-lock {
    margin-top: 6px;
    color: var(--mud-palette-text-secondary);
}

.event-lock.locked {
    color: var(--mud-palette-warning-darken);
}

/* Event → DOWNTIMES: one row per downtime (number, status, actions) */
.event-downtimes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 460px;
}

.event-downtime-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
}

.event-downtime-name {
    flex: 1 1 auto;
    font-size: .875rem;
    font-weight: 600;
}

.event-lock-dialog .dialog-text {
    margin: 0;
    max-width: 380px;
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

/* Event dialog: the lock right of the dialog title (same font as the other dialog titles) */
.event-dialog-title {
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-dialog-title .event-lock {
    margin: -6px 0;
}

/* Event dialog: the lock's hover card wrapper stays inline next to the title */
.event-lock-root {
    display: inline-flex;
}

/* Event lock hover card: the views that may change the event as a bullet list */
.event-lock-views-list {
    margin: 2px 0 0;
    padding-left: 18px;
    list-style: disc;
}

/* calendar hover card: a small lock after the title of a locked event */
.calendar-card-lock.mud-icon-root {
    flex: none;
    font-size: .9375rem;
    color: var(--mud-palette-text-secondary);
}

/* ... in the upper right corner of the card */
.calendar-card-head .calendar-card-lock.mud-icon-root {
    margin-left: auto;
    align-self: flex-start;
}

/* the lock as far from the top and right edge as the color square from the top and left edge (square: 4px bar + 12px
   padding from the left, ~15px from the top; the lock glyph has ~2.5px empty space on its right, ~0.5px on top) */
.calendar-card {
    position: relative;
}

.calendar-card-head .calendar-card-lock.mud-icon-root {
    position: absolute;
    top: 14px;
    right: 13.5px;
    margin: 0;
}

/* the title does not run under the lock */
.calendar-card:has(.calendar-card-lock) .calendar-card-head {
    padding-right: 22px;
}

/* Event dialog: read-only fields look like the read-only Customization fields (light grey fill, frame kept, no arrow,
   normal cursor) - all fields without Write Event; when locked for the current view all except status and actual times
   (they stay editable); the owner of maintenance events (always the tenant) */
:is(.event-dialog-overview.all-read-only, .event-dialog-overview.fields-read-only, .field-read-only) .mud-input.mud-input-outlined:not(:is(.event-status, .event-actual-start-date, .event-actual-start-time, .event-actual-end-date, .event-actual-end-time) .mud-input),
.event-dialog-overview.all-read-only .mud-input.mud-input-outlined {
    background: color-mix(in srgb, var(--mud-palette-background-gray) 50%, var(--mud-palette-surface));
    border-radius: var(--mud-default-borderradius);
}

:is(.event-dialog-overview.all-read-only, .event-dialog-overview.fields-read-only, .field-read-only) .mud-input-adornment-end:not(:is(.event-status, .event-actual-start-date, .event-actual-start-time, .event-actual-end-date, .event-actual-end-time) *),
.event-dialog-overview.all-read-only .mud-input-adornment-end {
    display: none;
}

:is(.event-dialog-overview.all-read-only, .event-dialog-overview.fields-read-only, .field-read-only) .mud-input:not(:is(.event-status, .event-actual-start-date, .event-actual-start-time, .event-actual-end-date, .event-actual-end-time) .mud-input),
:is(.event-dialog-overview.all-read-only, .event-dialog-overview.fields-read-only, .field-read-only) .mud-input:not(:is(.event-status, .event-actual-start-date, .event-actual-start-time, .event-actual-end-date, .event-actual-end-time) .mud-input) *,
.event-dialog-overview.all-read-only .mud-input,
.event-dialog-overview.all-read-only .mud-input * {
    cursor: default !important;
}

/* GENERAL → Scheduling: filters on the left (scroll when long), calendar on the right filling the height */
.list-pane-header.scheduling-filters {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.detail-pane.scheduling-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    padding: 16px 20px;
}

.scheduling-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: none;
}

.scheduling-calendar {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
}

.scheduling-filters .filter-option .status-chip {
    margin-right: 4px;
}

/* Scheduling → Favorites: the menu button under the title; in the menu each favorite with a delete icon on the right */
.scheduling-favorites {
    align-self: flex-start;
    margin: 4px 0 8px;
}

.scheduling-favorites .mud-button-root {
    max-width: 280px;
    text-transform: none;
}

.scheduling-favorites .mud-button-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduling-favorite {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.scheduling-favorite-name {
    flex: 1 1 auto;
}

.scheduling-favorite-delete {
    display: inline-flex;
    padding: 2px;
    border-radius: 4px;
    color: var(--mud-palette-text-secondary);
}

.scheduling-favorite-delete:hover {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-error);
}

.scheduling-favorites-empty {
    padding: 8px 16px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

/* Scheduling → Favorites as a star right of the title (filled amber while a favorite is shown) */
.module-title .scheduling-favorites {
    align-self: center;
    margin: 0 0 0 auto;
}

.scheduling-favorites .mud-icon-button {
    color: var(--mud-palette-text-secondary);
}

.scheduling-favorites.active .mud-icon-button {
    color: var(--mud-palette-warning);
}

/* Resource calendar (scheduling): the configuration of a resource as a bar along its lane - at the left of a column
   (vertical), at the top of a row (horizontal); the items share the room beside it */
.day-calendar-column.has-bands {
    --band-width: 14px;
}

.day-calendar-band-bar {
    pointer-events: auto;
}

.day-calendar.horizontal .day-calendar-band-bar {
    top: 0;
    height: var(--band-width);
}

.day-calendar.horizontal .day-calendar-band-bar .calendar-band-bar-label {
    top: 0;
    left: 4px;
    width: auto;
    max-width: calc(100% - 8px);
    max-height: none;
    writing-mode: horizontal-tb;
}

/* Resource calendar (scheduling): free slots where an event can be created - pointer and a light highlight on hover */
.day-calendar-slot.clickable {
    cursor: pointer;
}

.day-calendar-slot.clickable:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

/* Resource calendar (scheduling): the state chip of a resource next to its name in the column / row head */
/* a resource's head: the name takes the room left by icon and state chip, cut with "…" - nothing spills into the next column */
.day-calendar-column-head {
    min-width: 0;
    overflow: hidden;
}

.day-calendar-column-title {
    min-width: 0;
    max-width: 100%;
}

.day-calendar-column-name {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    /* a narrow column: the name on up to two lines (see .narrow) */
    .day-calendar-column-head.narrow .day-calendar-column-name {
        white-space: normal;
    }

.day-calendar-column-title .day-calendar-column-badge {
    flex: none;
    margin-left: 2px;
    font-size: .6875rem;
}

/* Resource calendar: a bit more room in a resource's head, between the name (with its state chip) and the line below */
.day-calendar-column-head {
    gap: 4px;
    padding: 8px 8px 7px;
}

.hcal-label {
    gap: 4px;
}

/* Event → DOWNTIMES: the times of a downtime (from the terminal) after its number */
.event-downtime-time {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Event dialog → DOWNTIMES: number with failure classification and (shortened) description below it */
.event-downtime-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

    .event-downtime-main .event-downtime-name {
        flex: none;
    }

.event-downtime-details {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-downtime-description {
    margin-left: 4px;
}

/* Downtime dialog (terminal: End Downtime; office: edit): compact overview above the fields, hint why closing is disabled */
.downtime-dialog-fields.fields {
    grid-template-columns: 110px 1fr;
    gap: 4px 16px;
    margin-bottom: 16px;
}

.downtime-dialog-hint {
    margin-top: 8px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* downtimes in the calendars: dark yellow (red is the current-time line) */
:root {
    --downtime-rgb: 184, 134, 11;
}

/* My Profile: the fields of a tab one below the other (both tabs are in one form; the hidden one keeps its entries) */
.profile-form .profile-tab:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* MAINTENANCE tab: Quick Access is the whole tab - no separator line above it */
.profile-tab > .profile-group {
    gap: 12px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* hover card DOWNTIMES: the striped mark vertically centered on the text of its row */
.calendar-card-downtimes li {
    display: flex;
    align-items: center;
}

    .calendar-card-downtimes li::before {
        flex: none;
    }

/* ... optically: 1px higher (the digits sit high in their line box) */
.calendar-card-downtimes li::before {
    position: relative;
    top: -1px;
}

/* ... anchored to the baseline instead of the line box: centered on the height of the digits (cap height ~0.7em; mark
   8px), the same with or without letters like g / y in the line and at any zoom */
.calendar-card-downtimes li {
    align-items: baseline;
}

    .calendar-card-downtimes li::before {
        top: calc((8px - 0.7em) / 2);
    }

/* calendar hover card moved into the window (app.js): no arrow - it would not point at the item any more */
.mud-tooltip.calendar-tooltip.calendar-tooltip-shifted.mud-tooltip-arrow::after,
.calendar-tooltip-shifted .mud-tooltip-arrow::after {
    display: none;
}

/* GENERAL → Notifications: filters on the left (scroll when long); the notifications as cards on the right, like in the
   bell menu but larger, with their type and priority at the right */
.list-pane-header.notifications-filters {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Roles: the role list can be long - the left pane scrolls (not past its background) */
.list-pane-header.roles-filters {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.notifications-search {
    margin-bottom: 8px;
}

.notifications-filters .notification-dot {
    display: inline-block;
    flex: none;
    width: 10px;
    height: 10px;
    margin: 0 4px 0 2px;
    border-radius: 50%;
    background: var(--priority-color);
}

.notifications-sort .mud-radio {
    margin: 0;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    flex-shrink: 0; /* keeps its height: the page scrolls (shrunk, the list cut off the notifications below) */
    max-width: 960px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: var(--mud-palette-surface);
    overflow: hidden;
}

.notifications-page-item {
    padding-top: 12px;
    padding-bottom: 12px;
}

.notifications-page-item .notification-text {
    flex: 1 1 auto;
}

.notifications-page-item .notification-title {
    font-size: .9375rem;
}

.notifications-page-item .notification-sub,
.notifications-page-item .notification-when {
    font-size: .8125rem;
}

.notifications-page-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: none;
    gap: 2px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
}

.notifications-page-priority {
    font-weight: 600;
    color: var(--priority-color);
}

/* bell menu: "Show All Notifications" below the list */
.notification-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--mud-palette-lines-default);
    text-align: center;
}

.notification-show-all {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--mud-palette-primary);
    text-decoration: none;
}

    .notification-show-all:hover {
        text-decoration: underline;
    }

/* Notifications page: the list uses the full width of the pane */
.notifications-list {
    max-width: none;
}

/* the "?" next to a page title: opens the page's documentation in a new tab */
.page-help {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border-radius: 50%;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
}

    .page-help:hover,
    .page-help:focus-visible {
        background: var(--mud-palette-action-default-hover);
        color: var(--mud-palette-primary);
        outline: none;
    }

    .page-help .mud-icon-root {
        font-size: 1.125rem;
    }

/* ---------- Documentation in its own tab (HelpLayout): slim bar instead of the menu ---------- */
.help-shell {
    --app-topbar-height: 49px;           /* 48px bar + 1px border, as the app's top bar */
    min-height: 100vh;
    background: var(--mud-palette-background);
}

.help-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-appbar-background);
}

.help-topbar-separator {
    color: var(--mud-palette-text-disabled);
}

.help-topbar-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

/* "+" (create) in the module title of a list pane: a compact square in the primary colour */
.module-title .mud-icon-button.module-add {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: var(--mud-default-borderradius);
}

.docs-toc-section:hover {
    color: var(--mud-palette-text-primary);
}

.docs-toc-section .docs-toc-chevron {
    font-size: 18px;
    flex-shrink: 0;
}

/* The buttons of the revision header keep their label on one line */
.revision-header .mud-button-root {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Documentation only: the table of contents 25 % wider than other list panes (320px → 400px) */
.list-pane.docs-toc {
    flex: 0 0 400px;
    width: 400px;
}

/* "Did you mean?" in New Person / New Organization: existing ones with a similar name, each one clickable */
.similar-intro {
    margin-bottom: 10px;
    color: var(--mud-palette-text-secondary);
}

.similar-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    overflow: hidden;
}

.similar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: none;
    font: inherit;
    color: var(--mud-palette-text-primary);
    text-align: left;
    cursor: pointer;
}

.similar-item:last-child {
    border-bottom: 0;
}

.similar-item:hover,
.similar-item:focus-visible {
    background: var(--mud-palette-action-default-hover);
    outline: none;
}

.similar-item .mud-icon-root {
    color: var(--mud-palette-text-secondary);
}

.similar-name {
    font-weight: 600;
}

.similar-detail {
    display: inline-flex;
    align-items: center;
    color: var(--mud-palette-text-secondary);
}

.similar-detail + .similar-detail::before {
    content: "·";
    margin-right: 8px;
}

/* "Extra" next to the name of an extra session of a course (not part of the course template) */
.session-extra {
    display: inline-block;
    margin-left: 8px;
    padding: 0 6px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 10px;
    font-size: .6875rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    vertical-align: middle;
    white-space: nowrap;
}

/* A drafted event: the session of a course that is still a draft - planned, not booked yet. Half-transparent with a dashed
   outline in every calendar; clearer on hover. */
.calendar-item.drafted {
    opacity: .5;
    outline: 1px dashed var(--mud-palette-text-secondary);
    outline-offset: -1px;
    transition: opacity .15s;
}

.calendar-item.drafted:hover,
.calendar-item.drafted:focus-visible {
    opacity: .9;
}

.event-status-drafted {
    color: var(--mud-palette-text-secondary);
    background: transparent;
    border-color: var(--mud-palette-text-secondary);
    border-style: dashed;
}

/* the status of a session's event, under the resource name: close to it, with a little air above the row line */
.session-event-status {
    margin-top: 0;
    margin-bottom: 2px;
}

/* Event dialog: "this event is a session of a course" (planned there) */
.event-course-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 12px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-background-gray);
    font-size: .875rem;
    color: var(--mud-palette-text-secondary);
}

.event-course-note .mud-icon-root {
    flex-shrink: 0;
    margin-top: 1px;
}

/* SESSIONS: the line under a session's name - for an extra session its "Extra" label, then the problems (wraps if needed) */
.session-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 6px;
    min-width: 0;
}

.session-name-row .session-extra {
    flex: none;
    margin-left: 0;
}

/* ---------- Course → PROGRESS: one collapsible group per student, the header with a progress bar ---------- */
.progress-header {
    cursor: pointer;
    user-select: none;
}

.progress-header:hover {
    background: var(--mud-palette-action-default-hover);
}

.progress-header .progress-chevron {
    flex: none;
    color: var(--mud-palette-text-secondary);
}

.progress-who {
    flex: 0 0 260px;
    min-width: 0;
}

.progress-bar-area {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.progress-bar-area .progress-bar {
    flex: 1 1 auto;
    min-width: 60px;
}

.progress-figures {
    flex: none;
    min-width: 96px;
    text-align: right;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-text-secondary);
}

.progress-sessions .cell-status {
    width: 110px;
    text-align: right;
    white-space: nowrap;
}

.progress-sessions tr.progress-done .session-name {
    color: var(--mud-palette-text-secondary);
}

/* PROGRESS: its own column widths (number · name · resource / crew · when and where · duration · status) */
.course-session-list.progress-sessions {
    width: 100%;
}

.course-session-list.progress-sessions .cell-name {
    width: 26%;
}

.course-session-list.progress-sessions .cell-resource {
    width: 17%;
}

.course-session-list.progress-sessions .cell-planned {
    width: auto;
}

.course-session-list.progress-sessions .cell-duration {
    width: 64px;
}

/* ---------- Person Portal (/portal/{person}): top bar, tabs, page (plain HTML, always light) ---------- */
.portal-page {
    min-height: 100vh;
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    font-family: Inter, system-ui, sans-serif;
    font-size: .875rem;
}

.portal-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 56px;
    padding: 0 24px;
    background: var(--portal-bar);
    color: #fff;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.portal-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: auto;
    text-align: right;
    line-height: 1.25;
}

.portal-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-organization {
    font-size: .75rem;
    opacity: .8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, .25);
    white-space: nowrap;
}

    .portal-actions a,
    .portal-actions button {
        padding: 6px 10px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: inherit;
        font: inherit;
        font-size: .8125rem;
        text-decoration: none;
        cursor: pointer;
    }

        .portal-actions a:hover,
        .portal-actions button:hover,
        .portal-actions a:focus-visible,
        .portal-actions button:focus-visible {
            background: rgba(255, 255, 255, .14);
            outline: none;
        }

.portal-tabs {
    display: flex;
    justify-content: center; /* the tabs in the middle of the page */
    gap: 4px;
    padding: 0 24px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.portal-tab {
    padding: 14px 16px 12px;
    border-bottom: 2px solid transparent;
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-decoration: none;
}

    .portal-tab:hover,
    .portal-tab:focus-visible {
        color: var(--mud-palette-text-primary);
        outline: none;
    }

    .portal-tab.active {
        border-bottom-color: var(--portal-accent);
        color: var(--portal-accent);
    }

.portal-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

    .portal-content h1 {
        margin: 0 0 16px;
        font-size: 1.25rem;
        font-weight: 600;
    }

.portal-card {
    padding: 20px 24px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: var(--mud-palette-surface);
}

    .portal-card h2 {
        margin: 0 0 12px;
        font-size: .75rem;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--mud-palette-text-secondary);
    }

    .portal-card .portal-fields {
        margin-bottom: 0;
    }

/* HOME: the notifications above the schedule */
.portal-notifications {
    margin-bottom: 16px;
}

    .portal-notifications .portal-empty {
        margin: 0;
    }

.portal-notification-list {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    overflow: hidden;
}

    /* (a list to read, nothing to click) */
    .portal-notification-list .notification-item:hover {
        background: transparent;
    }

.portal-count {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--portal-accent);
    color: var(--mud-palette-surface);
    font-size: .6875rem;
    letter-spacing: 0;
    line-height: 18px;
    text-align: center;
}

/* SCHEDULE: the week calendar fills the window below the bar and the tabs (the hours scroll inside the calendar) */
.portal-page:has(.portal-fill) {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.portal-fill {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

.portal-schedule {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

    .portal-next-event {
        margin-left: 12px;
    }

    /* (read-only: free half hours are not clickable) */
    .portal-schedule .calendar-slot {
        cursor: default;
    }

/* HOME: the page never scrolls - Upcoming Events (at most 5) is as high as its content, Notifications gets the rest of
   the window, and the list of the notifications scrolls inside its card */
.portal-fill > .portal-upcoming {
    flex: none;
}

.portal-fill > .portal-notifications {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-height: 0;
}

    .portal-fill > .portal-notifications > h2 {
        flex: none;
    }

    .portal-fill > .portal-notifications > .portal-notification-list {
        flex: 0 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

/* SCHEDULE → Subscribe to Calendar: the dialog with the private link */
.portal-subscribe.mud-button-root {
    margin-left: 8px;
}

.portal-calendar-intro,
.portal-calendar-note {
    margin: 0 0 12px;
}

.portal-calendar-note {
    color: var(--mud-palette-text-secondary);
}

.portal-calendar-hints {
    margin: 12px 0 0;
    padding-left: 18px;
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
    line-height: 1.6;
}

    .portal-calendar-hints a {
        color: var(--portal-accent);
    }

/* HOME: the upcoming events - the day at the left, title and details next to it */
.portal-upcoming-list {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
}

.portal-upcoming-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

    .portal-upcoming-item:last-child {
        border-bottom: 0;
    }

.portal-upcoming-day {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    width: 48px;
    line-height: 1.2;
}

.portal-upcoming-weekday {
    color: var(--mud-palette-text-secondary);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.portal-upcoming-date {
    font-size: 1rem;
    font-weight: 600;
}

.portal-upcoming-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* at the right of an upcoming event: opens the SCHEDULE at its week */
.portal-upcoming-show {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border-radius: 50%;
    color: var(--mud-palette-text-secondary);
}

    .portal-upcoming-show:hover,
    .portal-upcoming-show:focus-visible {
        background: var(--mud-palette-action-default-hover);
        color: var(--portal-accent);
    }

.portal-upcoming-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.portal-upcoming-sub {
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
}

.portal-upcoming-all {
    display: inline-block;
    margin-top: 12px;
}

.portal-card-table {
    padding: 0;
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
}

    .portal-table th,
    .portal-table td {
        padding: 10px 16px;
        border-bottom: 1px solid var(--mud-palette-lines-default);
        text-align: left;
        white-space: nowrap;
    }

    .portal-table th {
        color: var(--mud-palette-text-secondary);
        font-size: .75rem;
        font-weight: 600;
    }

    .portal-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .portal-table .portal-group td {
        padding-top: 14px;
        background: var(--mud-palette-background);
        color: var(--mud-palette-text-secondary);
        font-size: .6875rem;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

.portal-empty {
    color: var(--mud-palette-text-secondary);
}

/* narrow screens: the bar wraps, the name first */
@media (max-width: 640px) {
    .portal-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 8px 16px;
    }

    .portal-actions {
        width: 100%;
        padding-left: 0;
        border-left: 0;
    }

    .portal-tabs,
    .portal-content {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ---------- Portal: upload a document from a notification ---------- */
.portal-notification-list .notification-item {
    align-items: center;
}

    .portal-notification-list .notification-text {
        flex: 1 1 auto;
    }

.portal-upload-button.mud-button-root {
    flex: none;
}

.portal-submitted {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-info);
}

.portal-upload-for {
    margin-bottom: 12px;
    font-size: .875rem;
}

.portal-upload-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 28px 16px;
    border: 2px dashed var(--mud-palette-lines-inputs);
    border-radius: 8px;
    color: var(--mud-palette-text-secondary);
    text-align: center;
    cursor: pointer;
}

    .portal-upload-drop:hover,
    .portal-upload-drop:focus-within {
        border-color: var(--mud-palette-primary);
    }

/* the file input covers the area (click and drop), invisible */
.portal-upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.portal-upload-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.portal-upload-hint,
.portal-upload-note {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.portal-upload-note {
    margin-top: 12px;
}

.portal-upload-files {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

    .portal-upload-files li {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 2px 0;
        font-size: .875rem;
    }

.portal-upload-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Upload Document dialog opened with a file from the portal: where it comes from */
.upload-submission {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid rgba(var(--mud-palette-info-rgb), .35);
    border-radius: 6px;
    background: rgba(var(--mud-palette-info-rgb), .08);
    font-size: .8125rem;
}

/* ---------- Availabilities: portal tab, CRM tab, instructor picker ---------- */
.portal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

    .portal-head h1 {
        margin: 0;
    }

.portal-intro {
    margin: 0 0 16px;
    color: var(--mud-palette-text-secondary);
}

.portal-table td.portal-wrap {
    white-space: normal;
}

.portal-table td.portal-actions-cell {
    width: 1%;
    padding-top: 4px;
    padding-bottom: 4px;
    text-align: right;
}

.portal-availability-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.availability-tab {
    padding: 16px;
}

.availability-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.availability-list th {
    padding: 6px 12px 6px 0;
    color: var(--mud-palette-text-secondary);
    font-size: .75rem;
    font-weight: 600;
    text-align: left;
}

.availability-list td {
    white-space: nowrap;
}

.availability-list tr.availability-past td {
    color: var(--mud-palette-text-disabled);
}

/* a person in a picker who is not available at the time */
.select-warning {
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-warning-darken);
}

/* the bars of a calendar's bands (configuration, availability): a label to read - no text cursor, not selectable */
.calendar-band-bar,
.calendar-band-bar-label {
    cursor: default;
    user-select: none;
}

/* ---------- Week calendar: selecting a range of half hours by dragging ---------- */
.calendar-slot.selectable {
    user-select: none;
}

.calendar-slot.selecting,
.calendar-slot.selecting:hover {
    background: rgba(var(--mud-palette-primary-rgb), .2);
}

/* the portal's schedule: free time can be dragged over to add an availability */
.portal-schedule .calendar-slot.selectable {
    cursor: crosshair;
}

.portal-add-availability {
    margin-left: 8px;
}

/* while a range is selected by dragging: lines at its start and end across the week, their times at the time axis,
   and the range inside the selection (none of them takes the mouse: the half hours below stay reachable) */
.calendar-selection-line {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 3;
    height: 0;
    border-top: 2px solid var(--mud-palette-primary);
    pointer-events: none;
}

.calendar-selection-time {
    position: absolute;
    right: 4px;
    z-index: 3;
    padding: 0 4px;
    border-radius: 3px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: .6875rem;
    font-weight: 600;
    line-height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
}

.calendar-selection-label {
    position: absolute;
    left: 6px;
    z-index: 3;
    margin-top: 4px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--mud-palette-primary);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* a band that can be clicked (the portal's availabilities: change or remove) */
.calendar-band-bar.clickable,
.calendar-band-bar.clickable .calendar-band-bar-label {
    cursor: pointer;
}

    .calendar-band-bar.clickable:hover {
        filter: brightness(1.15);
    }


/* the edges of a band that can be resized: a handle at its start and at its end */
.calendar-band-handle {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    height: 8px;
    cursor: ns-resize;
}

    .calendar-band-handle.start {
        top: 0;
        border-top: 3px solid rgba(0, 0, 0, .28);
    }

    .calendar-band-handle.end {
        bottom: 0;
        border-bottom: 3px solid rgba(0, 0, 0, .28);
    }

    .calendar-band-handle:hover {
        background: rgba(0, 0, 0, .18);
    }

/* while an edge is dragged: the half hours below take the mouse (not the bars and the items), with the resize cursor */
.calendar.resizing .calendar-band-bar,
.calendar.resizing .calendar-item-root {
    pointer-events: none;
}

.calendar.resizing .calendar-slot,
.portal-schedule .calendar.resizing .calendar-slot.selectable {
    cursor: ns-resize;
}

/* a band with handles at its edges: its label starts below the top handle */
.calendar-band-bar.clickable .calendar-band-bar-label {
    top: 12px;
}

/* ---------- Course planner: instructors (columns with their availabilities) and the instructor picker ---------- */
/* a band that shades its time over the whole column / row (an instructor's availability): behind the items */
.day-calendar-band-fill {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 0;
    opacity: .14;
    pointer-events: none;
}

.day-calendar.horizontal .day-calendar-band-fill {
    top: 0;
    bottom: 0;
    left: auto;
    right: auto;
}

/* the instructor of a session: search field, switch and the list to pick from */
.instructor-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.instructor-picker-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .instructor-picker-tools .instructor-search {
        flex: 1 1 auto;
    }

.instructor-list {
    max-height: min(320px, 40vh);
    overflow-y: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
}

.instructor-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 12px;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

    .instructor-option:last-child {
        border-bottom: 0;
    }

    .instructor-option:hover,
    .instructor-option:focus-visible {
        background: var(--mud-palette-action-default-hover);
        outline: none;
    }

    .instructor-option.selected {
        background: rgba(var(--mud-palette-primary-rgb), .08);
    }

.instructor-radio.mud-icon-root {
    flex: none;
    color: var(--mud-palette-text-secondary);
}

.instructor-option.selected .instructor-radio.mud-icon-root {
    color: var(--mud-palette-primary);
}

.instructor-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.instructor-name {
    font-size: .875rem;
    font-weight: 500;
}

.instructor-empty {
    padding: 16px;
    color: var(--mud-palette-text-secondary);
    font-size: .875rem;
}

.instructor-hint {
    color: var(--mud-palette-text-secondary);
    font-size: .75rem;
}

/* the planner's session filter: two switches and the resource type - the type on its own line (full width) */
.planning-sessions-filter {
    flex-wrap: wrap;
    row-gap: 4px;
}

.planning-sessions-filter .planning-type-filter {
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
}

/* narrow columns / rows of the day calendar (the planner's instructors): less space, the name on up to two lines */
.day-calendar-column-head.narrow {
    padding-left: 6px;
    padding-right: 6px;
}

    .day-calendar-column-head.narrow .day-calendar-column-title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: .8125rem;
        line-height: 1.2;
        white-space: normal;
    }

        .day-calendar-column-head.narrow .day-calendar-column-title .mud-icon-root {
            vertical-align: text-bottom;
        }

.hcal-row.narrow {
    flex: .45 1 0;
    min-height: 40px;
}

/* course dialog: start and end date side by side */
.course-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* day calendar: a thick line before the first column / row of another kind (the instructors after the resources) */
.day-calendar .day-calendar-column-head.group-start,
.day-calendar .day-calendar-column.group-start {
    border-left: 3px solid var(--mud-palette-text-secondary);
}

.day-calendar.horizontal .hcal-row.group-start {
    border-top: 3px solid var(--mud-palette-text-secondary);
}

/* ---------- Portal: light / dark (the identity's display setting) ---------- */
.portal-page {
    --portal-bar: #1e3a5f;
    --portal-accent: var(--mud-palette-primary);
}

    .portal-page.app-dark {
        --portal-bar: #16233a;
    }

/* links of the plain pages' style (Open Schedule …) in the theme's link color */
.portal-page .apps-back {
    color: var(--app-link);
}

/* the display settings in the bar: a gear, its menu as in the Office's profile menu */
.portal-settings-button {
    display: inline-flex;
    align-items: center;
}

.portal-count {
    color: var(--mud-palette-primary-text);
}

/* ---------- Rich text editor (a session's content): buttons B / I / U, text area, preview ---------- */
.rich-editor {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rich-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rich-editor-label {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.rich-editor-tools {
    display: inline-flex;
    gap: 2px;
}

    .rich-editor-tools button {
        width: 28px;
        height: 26px;
        border: 1px solid var(--mud-palette-lines-inputs);
        border-radius: 4px;
        background: transparent;
        color: var(--mud-palette-text-primary);
        font: inherit;
        font-size: .875rem;
        cursor: pointer;
    }

        .rich-editor-tools button:hover,
        .rich-editor-tools button:focus-visible {
            background: var(--mud-palette-action-default-hover);
            outline: none;
        }

.rich-editor-area {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 4px;
    background: transparent;
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: .875rem;
    line-height: 1.4;
    resize: vertical;
}

    .rich-editor-area:focus {
        border-color: var(--mud-palette-primary);
        outline: 1px solid var(--mud-palette-primary);
    }

.rich-editor-preview {
    padding: 6px 12px;
    border-left: 3px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background);
    font-size: .8125rem;
}


.session-content {
    font-size: .8125rem;
}

/* students of a course: the block a student starts with (a button in a draft) */
.crew-students td.cell-start {
    width: 170px; /* (the table has fixed columns) */
    white-space: nowrap;
    text-align: right;
}

.student-start-button,
.student-start-text {
    padding: 1px 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font: inherit;
    font-size: .75rem;
}

.student-start-button {
    cursor: pointer;
}

    .student-start-button:hover,
    .student-start-button:focus-visible {
        border-color: var(--mud-palette-primary);
        color: var(--mud-palette-text-primary);
        outline: none;
    }

/* (a later block: stands out) */
.student-start-button.later,
.student-start-text.later {
    border-color: rgba(var(--mud-palette-info-rgb), .45);
    background: rgba(var(--mud-palette-info-rgb), .08);
    color: var(--mud-palette-info);
    font-weight: 600;
}

/* PROGRESS: the persons who left the course, below the students */
.progress-left-head {
    margin: 16px 0 4px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.progress-bar-area.progress-left {
    justify-content: flex-end;
}

/* Audit Log page: the fixed columns (When, Type, Action, User, Details) need about 780px - in a narrow window nothing was
   left for the Name column (it disappeared). The table keeps a minimum width; narrower: it scrolls sideways. */
.audit-log-table table {
    min-width: 980px;
}

/* ---------- Analytics: dashboards ---------- */
.list-group-label {
    padding: 10px 16px 4px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--mud-palette-text-secondary);
}

.analytics-pane {
    overflow-y: auto;
}

.dashboard-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

/* the header and the filter bar keep their height (the page column would squeeze them - the lines then ran into the
   filter bar); the buttons keep their size */
.analytics-pane > .detail-header,
.analytics-pane > .dashboard-filters {
    flex-shrink: 0;
}

.analytics-pane > .detail-header > .detail-actions {
    flex-shrink: 0;
}

.dashboard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

/* the description: its own line below the owner / sharing line (no "·" at the start of a wrapped line) */
.dashboard-description {
    flex-basis: 100%;
}

/* filter bar: one row above the widgets */
.dashboard-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 16px 0 12px;
}

.dashboard-filters .mud-input-control {
    flex: 0 0 auto;
    width: 200px;
    margin: 0;
}

.dashboard-filters .filter-sites,
.dashboard-filters .filter-resources {
    width: 240px;
}

.dashboard-filters .filter-date {
    width: 160px;
}

/* widgets: a grid of --grid-columns columns (per dashboard, 1-50) and 24px rows (gap 16px; dashboard.js snaps to them); each widget spans its columns
   and rows (inline style), resized by its corner handle */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns, 12), minmax(0, 1fr));
    grid-auto-rows: 24px;
    gap: 16px;
    padding-bottom: 24px;
}

.dashboard-widget {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px 16px 16px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

/* narrow screens: the widgets one below the other (in their order: top to bottom, left to right), no grid, no moving */
@media (max-width: 1100px) {
    .dashboard-widget { grid-column: 1 / -1 !important; grid-row: auto / span var(--rows, 9) !important; }
    .widget-resize, .widget-grip, .grid-cell { display: none; }
}

/* the grid of the edit mode: its cells (faint), behind the widgets */
.grid-cell {
    border: 1px dashed var(--mud-palette-lines-default);
    border-radius: 4px;
    pointer-events: none;
}

.dashboard-grid-editing .dashboard-widget {
    z-index: 1;
}

.widget-grip {
    cursor: grab;
    touch-action: none;
}

/* moving a widget: lifted; red where it cannot go (another widget is there) */
.widget-moving {
    z-index: 2 !important;
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -1px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .18);
    cursor: grabbing;
    user-select: none;
}

.dashboard-widget.widget-invalid {
    outline: 2px solid var(--mud-palette-error);
}

.widget-invalid.widget-resizing::after {
    background: var(--mud-palette-error);
}

/* the resize handle: lower right corner, shown on hover */
.widget-resize {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    touch-action: none;
    opacity: 0;
    transition: opacity .15s;
    background:
        linear-gradient(135deg, transparent 0 55%, var(--mud-palette-text-secondary) 55% 62%, transparent 62% 72%,
                        var(--mud-palette-text-secondary) 72% 79%, transparent 79%);
}

.dashboard-widget:hover .widget-resize,
.widget-resizing .widget-resize {
    opacity: .8;
}

/* while resizing: outlined, the size (columns × rows) in the middle */
.widget-resizing {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -1px;
    user-select: none;
}

.widget-resizing::after {
    content: attr(data-size);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: .8125rem;
    font-weight: 600;
}

.dashboard-widget-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}

.dashboard-widget-title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: .9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-widget-sub {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dashboard-widget-sub .mud-icon-root {
    font-size: 1rem;
}

/* the chart (plot and legend) fills what is left of the widget's height; the plot shrinks, the legend keeps its lines */
.widget-chart {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* MudChart with Height="100%" wraps itself in a div with a fixed fallback height (inline "height:350px"): that
   wrapper fills the widget instead */
.widget-chart > div {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
}

.widget-chart .mud-chart {
    min-height: 0;
}

.widget-chart .mud-chart > svg {
    flex: 1 1 auto;
    min-height: 0;
}

.widget-chart .mud-chart-legend {
    flex-shrink: 0;
}

.widget-chart .mud-chart {
    width: 100%;
}

.widget-empty {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 160px;
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
}

.widget-number {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
}

.widget-number-value {
    font-size: 2.75rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.widget-number-label {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.widget-table {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.widget-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8125rem;
}

.widget-table th,
.widget-table td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    text-align: left;
    white-space: nowrap;
}

.widget-table th {
    position: sticky;
    top: 0;
    background: var(--mud-palette-surface);
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.widget-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.widget-table .total,
.widget-table tfoot td {
    font-weight: 600;
}

.widget-table tfoot td {
    border-bottom: 0;
    border-top: 1px solid var(--mud-palette-text-secondary);
}

/* the widget designer: settings left, live preview right */
/* the designer dialog: a fixed width (whatever is picked) and no scrollbar - everything fits */
.mud-dialog.widget-dialog {
    width: min(1180px, calc(100vw - 32px));
    max-width: none;
}

.widget-dialog .mud-dialog-content {
    overflow: visible;
    max-height: none;
}

.widget-designer {
    display: grid;
    grid-template-columns: 440px minmax(0, 1fr);
    gap: 24px;
}

.widget-designer-form.dialog-form {
    gap: 12px;
}

@media (max-width: 900px) {
    .widget-designer { grid-template-columns: 1fr; }
}

.visualization-picker {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.visualization-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font: inherit;
    font-size: .7rem;
    cursor: pointer;
}

.visualization-option:hover {
    border-color: var(--mud-palette-primary);
}

.visualization-option.active {
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

.widget-filter-row {
    display: flex;
    gap: 8px;
}

.widget-filter-row > * {
    flex: 1 1 0;
    min-width: 0;
}

.widget-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border-radius: 6px;
    background: var(--mud-palette-background-gray);
}

.widget-preview-label {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.widget-preview-card {
    flex: 1 1 auto;
}

.select-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* share dialog */
.share-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.share-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-row .share-access {
    flex: 0 0 140px;
    margin: 0;
}

/* Analytics catalog fields (measure, dimensions): each option with its name and what it is */
.catalog-option {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 0;
    white-space: normal;
}

.catalog-option-name {
    font-weight: 500;
}

.catalog-option-description {
    font-size: .75rem;
    line-height: 1.3;
    color: var(--mud-palette-text-secondary);
}

.catalog-popover {
    max-width: 420px;
}

/* Analytics filter bar: a filter (sites, persons, …) - a field showing the selection that opens a searchable list */
.filter-picker-activator {
    width: 200px; /* = the field (as wide as the Period field): equal gaps in the filter bar */
    cursor: pointer;
}

.filter-picker-activator .mud-input-control {
    margin: 0;
}

.filter-picker-activator input {
    cursor: pointer;
    caret-color: transparent;
}

.filter-picker-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 300px;
    padding: 8px;
}

.filter-picker-list {
    max-height: 320px;
    overflow-y: auto;
}

.filter-picker-option {
    width: 100%;
}

.filter-picker-option-text {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.25;
}

.filter-picker-option-sub,
.filter-choice-description {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.filter-picker-empty {
    padding: 6px 8px;
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.filter-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 0;
    border-top: 1px solid var(--mud-palette-lines-default);
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

/* dashboard dialog: the filters to choose, each with what it filters */
.filter-choice-text {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.3;
}

/* Analytics edit mode: the dashboard is being designed (Save / Discard Changes) */
.dashboard-editing {
    color: var(--mud-palette-primary);
    font-weight: 500;
}

/* a filter in the edit mode: grip (drag to reorder), the filter, × (remove) */
.filter-slot {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 2px 2px 0;
    border: 1px dashed var(--mud-palette-lines-inputs);
    border-radius: 6px;
}

.filter-slot {
    flex: 0 0 auto;
}

/* the view: the same wrapper without frame */
.filter-slot.filter-slot-view {
    padding: 0;
    border: 0;
}

.filter-slot-grip,
.widget-grip {
    display: inline-flex;
    align-items: center;
    cursor: grab;
    color: var(--mud-palette-text-secondary);
}

.filter-slot-dragging,
.widget-dragging {
    opacity: .45;
}

.filter-slot-drop-target,
.dashboard-widget.widget-drop-target {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

.add-filter {
    align-self: center;
}

/* widgets in the edit mode: a dashed frame */
.dashboard-grid-editing .dashboard-widget {
    border-style: dashed;
    border-color: var(--mud-palette-lines-inputs);
}

.dashboard-grid-editing .widget-resize {
    opacity: .6;
}

/* Analytics bookmarks: the menu in the filter bar; the list in "Manage Bookmarks" */
.bookmarks-menu {
    align-self: center;
}

.bookmark-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bookmark-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bookmark-name {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.bookmark-sub {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* Analytics: a long dashboard name wraps (at most two lines) instead of being cut off beside the buttons */
.dashboard-heading .mud-typography-h4 {
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
