/* W3PF core styles (on top of Bootstrap 5). No inline styles are allowed (CSP). */

/* Messages are fixed to the viewport, above modals, without covering the controls. */
.w3pf-messages {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
    width: min(26rem, calc(100vw - 2rem));
    pointer-events: none;
}

.w3pf-messages > .alert {
    pointer-events: auto;
}

.w3pf-skip-link {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 1100;
    padding: .5rem 1rem;
    background: var(--bs-body-bg);
}

/* DEV bar: always stays at the top of the viewport (any layout, menu position or fixing); w3pf.js keeps its height
   in --w3pf-dev-height so fixed menus stick below it. */
[data-w3pf-dev] {
    position: sticky;
    top: 0;
    z-index: 1035;
}

/* Narrow centered card (login, password change). */
.w3pf-narrow {
    max-width: 28rem;
    padding-top: 10vh;
    padding-bottom: 2rem;
}

/* Cookie notice at the bottom of the page until the visitor chooses (partials/cookie-notice.php, w3pf.js). */
.w3pf-cookie-notice {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    background: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
    box-shadow: 0 -.25rem .75rem rgba(0, 0, 0, .1);
}

/* Field changed against the stored original (form drafts, §14); not a TAB stop (hover shows the original). */
.w3pf-draft-changed {
    margin-left: .35rem;
    color: var(--bs-warning-text-emphasis);
    cursor: help;
}

/* QR code image (e.g. TOTP setup): white background for scanning in any theme. */
.w3pf-qr {
    width: 12rem;
    height: 12rem;
    background: #fff;
    border-radius: .25rem;
}

/* QR of a field with the option `qr`: small in the detail, large in the QR window (DBGrid). */
.w3pf-qr-image,
.w3pf-qr-large {
    background: #fff;
    image-rendering: pixelated;
}

.w3pf-qr-image {
    width: 120px;
    height: 120px;
}

.w3pf-qr-large {
    width: min(280px, 70vw);
    height: auto;
    aspect-ratio: 1;
}

/* Error of the last job of a scheduled task (administration). */
.w3pf-job-error {
    max-width: 32rem;
}

/* Multi-line text in a detail. */
.w3pf-pre {
    white-space: pre-line;
}
body > .ts-dropdown {
    z-index: 1060; /* above modal windows */
}

/* Dropdown menu of an input moved to <body> (W3PF.floatMenu): not clipped by tables or modals. */
.dropdown-menu.w3pf-float-menu {
    position: fixed;
    z-index: 1060;
    margin: 0;
    max-width: min(36rem, calc(100vw - 1rem));
    max-height: 50vh;
    overflow-y: auto;
}

/* Colour swatch of a colour field (the colour is set by w3pf.js from data-w3pf-color). */
.w3pf-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: -.15rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .2rem;
}

/* Field with the "not set" switch on. */
.w3pf-null .form-control,
.w3pf-null .form-select {
    opacity: .5;
}

/* Value of a range widget. */
.w3pf-range-value {
    min-width: 3rem;
}

/* Tabs without JavaScript: all panes one below the other, each with its heading. */
html:not(.w3pf-js) .w3pf-tabs > .nav-tabs {
    display: none;
}
html:not(.w3pf-js) .w3pf-tabs > .tab-content > .tab-pane {
    display: block;
    opacity: 1;
}
html.w3pf-js .w3pf-tab-heading {
    display: none;
}

/* ------------------------------------------------------------------ layout */

/* Content uses the whole width of the screen; smaller gutters on phones. */
.w3pf-main {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
}
@media (min-width: 768px) {
    .w3pf-main {
        padding: 1.5rem;
    }
}

/* Density of the page (html[data-w3pf-density], W3PF\Ui\UiPreferences): Bootstrap and this file size in rem,
   so the root font size scales the whole page; gutters of tables, cards and forms follow. */
html[data-w3pf-density="compact"] {
    font-size: 87.5%;
}
html[data-w3pf-density="large"] {
    font-size: 112.5%;
}
html[data-w3pf-density="compact"] .w3pf-main {
    padding: .5rem .75rem 1rem;
}
html[data-w3pf-density="compact"] .table {
    --w3pf-cell-y: .2rem;
    --w3pf-cell-x: .35rem;
}
html[data-w3pf-density="compact"] .table > :not(caption) > * > * {
    padding: var(--w3pf-cell-y) var(--w3pf-cell-x);
}
html[data-w3pf-density="compact"] .card {
    --bs-card-spacer-y: .5rem;
    --bs-card-spacer-x: .75rem;
    --bs-card-cap-padding-y: .35rem;
    --bs-card-cap-padding-x: .75rem;
}
html[data-w3pf-density="compact"] .form-control,
html[data-w3pf-density="compact"] .form-select {
    padding-top: .2rem;
    padding-bottom: .2rem;
}
html[data-w3pf-density="compact"] .mb-3 {
    margin-bottom: .6rem !important;
}
html[data-w3pf-density="compact"] h1,
html[data-w3pf-density="compact"] .h1,
html[data-w3pf-density="compact"] .h3 {
    margin-bottom: .5rem;
}
@media (min-width: 768px) {
    html[data-w3pf-density="large"] .w3pf-main {
        padding: 2rem;
    }
}

/* -------------------------------------------------------------- main menu */

/* Shell of an application page: the menu on one side of the content (data-w3pf-shell = top | left | bottom | right). */
.w3pf-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.w3pf-shell > .w3pf-main {
    flex: 1 1 auto;
    min-width: 0;
}
.w3pf-shell-bottom {
    flex-direction: column-reverse;
}

/* Colours: theme by default, own colours from the settings as variables (set by w3pf.js, CSP forbids inline styles). */
.w3pf-menu {
    background-color: var(--w3pf-menu-bg, var(--bs-tertiary-bg));
}
.w3pf-menu .nav-link.active,
.w3pf-menu .nav-link.show {
    background-color: var(--w3pf-menu-active-bg, transparent);
    color: var(--w3pf-menu-active-fg, var(--bs-navbar-active-color));
    border-radius: var(--bs-border-radius-sm);
}
.w3pf-menu[data-w3pf-menu-colors] .navbar-brand,
.w3pf-menu[data-w3pf-menu-colors] .navbar-text {
    color: var(--bs-navbar-color);
}

/* A horizontal menu wraps into more rows: always shown whole. */
.w3pf-menu:not(.w3pf-menu-vertical) [data-w3pf-menu] {
    flex-wrap: wrap;
    row-gap: .1rem;
}
@media (min-width: 992px) {
    .w3pf-menu:not(.w3pf-menu-vertical) .navbar-collapse {
        flex-wrap: wrap;
    }
    .w3pf-menu:not(.w3pf-menu-vertical) [data-w3pf-menu] {
        flex: 1 1 auto;
        min-width: 0;
    }
    .w3pf-menu:not(.w3pf-menu-vertical) [data-w3pf-menu] .nav-link {
        white-space: nowrap;
    }
}

/* Horizontal menu of a signed-in user: the info row (brand, clock … logout) at the page edge, the menu next to the
   content (top: info row above the menu, bottom: below it). */
.w3pf-bars {
    display: flex;
    flex-direction: column;
}
.w3pf-shell-bottom .w3pf-bars {
    flex-direction: column-reverse;
}
.w3pf-topbar {
    --bs-navbar-padding-y: .25rem;
}
@media (min-width: 992px) {
    .w3pf-topbar .navbar-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: .25rem;
    }
}
/* Small screens: the menu bar has no toggler of its own (the info row opens it), no empty strip when closed. */
@media (max-width: 991.98px) {
    .w3pf-menu-bar {
        --bs-navbar-padding-y: 0;
    }
    /* An opened fixed menu longer than the screen scrolls on its own. */
    .w3pf-shell-fixed > .w3pf-bars,
    .w3pf-shell-fixed > .w3pf-menu {
        max-height: calc(100vh - var(--w3pf-dev-height, 0px));
        overflow-y: auto;
    }
}

/* Fixed menu: stays in place while a long page scrolls (below the DEV bar, which is always fixed). */
.w3pf-shell-fixed.w3pf-shell-top > .w3pf-menu,
.w3pf-shell-fixed.w3pf-shell-top > .w3pf-bars {
    position: sticky;
    top: var(--w3pf-dev-height, 0);
    z-index: 1020;
}
.w3pf-shell-fixed.w3pf-shell-bottom > .w3pf-menu,
.w3pf-shell-fixed.w3pf-shell-bottom > .w3pf-bars {
    position: sticky;
    bottom: 0;
    z-index: 1020;
}

/* Side menu (left / right) from the lg breakpoint; on smaller screens it is the usual collapsed bar. */
.w3pf-menu-sub {
    list-style: none;
    margin: 0;
    padding: 0 0 .25rem .75rem;
}
.w3pf-menu-sub .nav-link {
    padding-top: .2rem;
    padding-bottom: .2rem;
}
/* Lines between the root items: an expanded group stays visibly together. */
.w3pf-menu-vertical [data-w3pf-menu] > .nav-item + .nav-item {
    border-top: var(--bs-border-width) solid var(--bs-border-color-translucent);
}
.w3pf-menu-header {
    margin-top: .35rem;
    padding: .1rem 0;
    font-size: .75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    opacity: .7;
}
.w3pf-menu-group-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    text-align: start;
    border: 0;
    background: none;
}
.w3pf-menu-group-toggle::after {
    content: "";
    width: .45em;
    height: .45em;
    margin-left: .5em;
    border-right: .12em solid currentColor;
    border-bottom: .12em solid currentColor;
    transform: rotate(45deg);
    transition: transform .15s;
}
.w3pf-menu-group-toggle.collapsed::after {
    transform: rotate(-45deg);
}
@media (min-width: 992px) {
    .w3pf-shell-left {
        flex-direction: row;
    }
    .w3pf-shell-right {
        flex-direction: row-reverse;
    }
    .w3pf-menu-vertical {
        flex: 0 0 15rem;
        width: 15rem;
        align-items: stretch;
        padding: .5rem 0;
    }
    /* Everything at the top (brand, tools, menu): Bootstrap spreads the navbar container with space-between,
       which in the full-height side menu leaves the brand alone at the top and the rest at the bottom. */
    .w3pf-menu-vertical {
        align-content: flex-start;
    }
    .w3pf-menu-vertical > .container-fluid {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
    }
    .w3pf-menu-vertical .navbar-brand {
        margin: 0 0 .5rem;
    }
    .w3pf-menu-vertical .navbar-collapse {
        flex-direction: column;
        align-items: stretch;
        flex-grow: 0;
    }
    .w3pf-menu-vertical .navbar-nav {
        flex-direction: column;
    }
    .w3pf-menu-vertical .navbar-nav .nav-link {
        padding-left: .5rem;
        padding-right: .5rem;
    }
    /* Tools (clock … logout) as a box above the side menu: icons in a row, wide items and panels on own rows. */
    .w3pf-menu-vertical .navbar-nav.w3pf-menu-tools {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        column-gap: .15rem;
        margin-bottom: .75rem;
        padding-bottom: .5rem;
        border-bottom: var(--bs-border-width) solid var(--bs-border-color);
    }
    .w3pf-menu-vertical .w3pf-menu-tools .nav-link {
        padding-left: .4rem;
        padding-right: .4rem;
    }
    .w3pf-menu-vertical .w3pf-menu-tools .w3pf-clock {
        padding-left: .4rem;
    }
    .w3pf-menu-vertical .w3pf-menu-tools > .w3pf-tool-wide,
    .w3pf-menu-vertical .w3pf-menu-tools > .w3pf-tool-panel {
        flex-basis: 100%;
    }
    .w3pf-menu-vertical .w3pf-menu-tools > .w3pf-tool-panel {
        order: 1;
        padding: 0 .4rem;
    }
    .w3pf-menu-vertical .w3pf-menu-tools form {
        padding: .25rem .4rem;
    }
    .w3pf-menu-vertical .w3pf-tool-panel form {
        padding: 0;
    }
    .w3pf-menu-vertical .w3pf-tool-wide select {
        max-width: 100%;
    }
    .w3pf-shell-fixed .w3pf-menu-vertical {
        position: sticky;
        top: var(--w3pf-dev-height, 0);
        height: calc(100vh - var(--w3pf-dev-height, 0px));
        overflow-y: auto;
        z-index: 1020;
    }
}

/* Compact menu (per part of the application): smaller texts and gutters, a narrower side menu. */
.w3pf-shell-compact .w3pf-menu {
    --bs-navbar-padding-y: .15rem;
    --bs-navbar-brand-padding-y: 0;
    --bs-navbar-brand-font-size: 1rem;
    --bs-nav-link-padding-y: .2rem;
    --bs-navbar-nav-link-padding-x: .4rem;
    font-size: .8125rem;
}
.w3pf-shell-compact .w3pf-menu .navbar-brand img {
    width: 20px;
    height: 20px;
}
.w3pf-shell-compact .w3pf-menu .btn-sm {
    --bs-btn-padding-y: .1rem;
    --bs-btn-font-size: .75rem;
}
@media (min-width: 992px) {
    .w3pf-shell-compact > .w3pf-menu-vertical {
        flex-basis: 11.5rem;
        width: 11.5rem;
    }
}

/* Configurator of the menu layout (Settings, data-w3pf-menu-config). */
.w3pf-cfg-handle {
    cursor: grab;
    padding: 0 .15rem;
}
.w3pf-cfg-group {
    background-color: var(--bs-tertiary-bg);
}
.w3pf-cfg-items {
    min-height: 2.5rem;
    margin-left: 1.25rem;
}
.w3pf-cfg-items:empty::before {
    content: attr(data-empty);
    display: block;
    padding: .5rem .75rem;
    border: var(--bs-border-width) dashed var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    color: var(--bs-secondary-color);
    font-size: .875em;
}
.w3pf-cfg-header {
    background-color: var(--bs-light-bg-subtle);
}
.w3pf-cfg-node.sortable-ghost {
    opacity: .4;
}
@media (min-width: 992px) {
    .w3pf-menu-palette-card {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* Appearance switch in the header. */
.w3pf-ui-switcher {
    min-width: 17rem;
}
.w3pf-ui-custom {
    color: var(--w3pf-menu-active-fg, var(--bs-primary));
}

/* ------------------------------------------------------------------- tables */

/* Tables framed from the outside: a border around the scrollable box, no outer row lines. */
.w3pf-table {
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    margin-bottom: 1rem;
}
.w3pf-table > .table {
    margin-bottom: 0;
}
.w3pf-table > .table > :last-child > tr:last-child > * {
    border-bottom-width: 0;
}
.w3pf-table > .table > thead > tr > th {
    white-space: nowrap;
    background-color: var(--bs-tertiary-bg);
}

/* Selection column (bulk actions) first, action column second; both stay visible
   when the table scrolls sideways. */
.w3pf-table .w3pf-select,
.w3pf-table .w3pf-actions {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 1%;
    white-space: nowrap;
    background-color: var(--bs-body-bg);
}
.w3pf-table .w3pf-select {
    min-width: 2.5rem;
    max-width: 2.5rem;
    text-align: center;
}
.w3pf-table .w3pf-has-select .w3pf-actions {
    left: 2.5rem;
}
/* A cell with an open dropdown (row menu) above the sticky cells of the next rows (w3pf.js). */
.w3pf-table .w3pf-menu-open {
    z-index: 5;
}
/* Headers can be dragged to reorder columns (table[data-w3pf-columns-form]). */
.w3pf-table [data-w3pf-columns-form] th[data-w3pf-column] {
    cursor: grab;
}
.w3pf-table th[data-w3pf-column].sortable-ghost {
    opacity: .4;
}
.w3pf-table > .table > thead .w3pf-select,
.w3pf-table > .table > thead .w3pf-actions {
    background-color: var(--bs-tertiary-bg);
}
.w3pf-table .w3pf-actions .btn {
    --bs-btn-padding-x: .4rem;
    --bs-btn-padding-y: .15rem;
}

/* Drag handle of a grid with a strict order (rows reordered by SortableJS). */
.w3pf-table .w3pf-drag-cell {
    width: 1%;
    white-space: nowrap;
}
.w3pf-table .w3pf-drag {
    cursor: grab;
    --bs-btn-padding-x: .3rem;
    --bs-btn-padding-y: .15rem;
}
.w3pf-table .sortable-ghost {
    opacity: .4;
}
.w3pf-table .w3pf-reordering {
    cursor: progress;
}

/* Tree view: indented first column, collapsible subtrees, ancestors of filter matches dimmed. */
.w3pf-table .w3pf-tree-leaf,
.w3pf-table .w3pf-tree-toggle {
    display: inline-block;
    width: 1rem;
    text-align: center;
}
.w3pf-table .w3pf-tree-context > td {
    color: var(--bs-secondary-color);
    font-style: italic;
}
/* Subrecords table: field partials inside cells without their labels and columns. */
.w3pf-subrecords td > [data-w3pf-field] {
    width: auto;
    max-width: none;
    padding: 0;
}
.w3pf-subrecords td .form-label,
.w3pf-subrecords td [data-w3pf-null-toggle] + label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}
.w3pf-subrecords .w3pf-subrecord-deleted > td {
    opacity: .5;
    text-decoration: line-through;
}
.w3pf-links {
    max-height: 24rem;
    overflow-y: auto;
}
.w3pf-tree-pick.active,
.w3pf-tree-tile.active {
    background-color: var(--bs-primary-bg-subtle);
}
.w3pf-tree-graph {
    height: 70vh;
    min-height: 420px;
}

/* Row action menu: hidden while all icons fit; in a compact table (wider than its box,
   or actions_menu = always) only the primary action stays and the others go to the menu. */
.w3pf-table .w3pf-actions-menu {
    display: none !important;
}
.w3pf-table .w3pf-actions-compact .w3pf-actions-menu {
    display: inline-block !important;
}
.w3pf-table .w3pf-actions-compact .w3pf-action-secondary {
    display: none;
}

/* Search of a grid with the always visible "Active" filter and page size on one line (wraps on phones). */
.w3pf-grid-searchbar .w3pf-grid-search {
    flex: 1 1 15rem;
    width: auto;
}

/* Toolbar buttons show only icons on phones (the label stays for screen readers). */
@media (max-width: 575.98px) {
    .w3pf-toolbar .w3pf-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
}

/* Bulk action bar above a grid. */
.w3pf-bulk-bar {
    min-height: 2.375rem;
}

/* Chart (Apache ECharts via data-w3pf-chart): a default height, override with own classes. */
[data-w3pf-chart] {
    min-height: 18rem;
}

/* Number and amount inputs: wide enough for "999 999 999,99", aligned right; the attributes of
   the field (style, class) can override it. */
.w3pf-num {
    max-width: 11em;
    text-align: right;
}
/* Amount with its currency: input and currency code / currency select side by side. */
.w3pf-money {
    flex-wrap: nowrap;
    max-width: 17em;
}
.w3pf-money > .w3pf-num {
    max-width: none;
    flex: 1 1 11em;
}
.w3pf-money > .w3pf-money-currency {
    flex: 0 0 auto;
    width: 6em;
}
.w3pf-money-system {
    max-width: 17em;
}

/* Dates and times have a fixed length: the input (and its flatpickr copy) is only as wide as the value. */
.w3pf-date,
.w3pf-month,
.w3pf-week {
    max-width: 10em;
}
.w3pf-time {
    max-width: 6.5em;
}
.w3pf-datetime {
    max-width: 14em;
}

/* Declared input width (key `width` of a field, in em of the value plus the input padding). */
.w3pf-w-3 { max-width: calc(3em + 1.5rem + 2px); }
.w3pf-w-4 { max-width: calc(4em + 1.5rem + 2px); }
.w3pf-w-5 { max-width: calc(5em + 1.5rem + 2px); }
.w3pf-w-6 { max-width: calc(6em + 1.5rem + 2px); }
.w3pf-w-8 { max-width: calc(8em + 1.5rem + 2px); }
.w3pf-w-10 { max-width: calc(10em + 1.5rem + 2px); }
.w3pf-w-12 { max-width: calc(12em + 1.5rem + 2px); }
.w3pf-w-16 { max-width: calc(16em + 1.5rem + 2px); }
.w3pf-w-20 { max-width: calc(20em + 1.5rem + 2px); }

/* Addon fields (`addon_of`) in the input group of their owner field: they keep their own width. */
.w3pf-addons > .form-select {
    flex: 0 0 auto;
    width: auto;
}

/* Month picker (input[data-w3pf-period="month"]): 4 × 3 grid of months. */
.w3pf-month-picker {
    min-width: 15rem;
}
.w3pf-month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .25rem;
}

/* Drag handle of sortable lists (column chooser). */
.w3pf-drag {
    cursor: grab;
}
.w3pf-columns-menu {
    min-width: 16rem;
}
/* Drag handle, checkbox and label side by side (no Bootstrap form-check indent, which pulled
   the checkbox over the handle). */
.w3pf-columns-menu .form-check {
    padding-left: 0;
}
.w3pf-columns-menu .form-check .form-check-input {
    float: none;
    margin-left: 0;
    flex-shrink: 0;
}

/* Resizable grid columns (w3pf.js; widths are kept in saved views). */
.w3pf-table th.w3pf-resizable {
    position: relative;
}
.w3pf-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: .5rem;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}
.w3pf-resize-handle:hover {
    border-right: 2px solid var(--bs-primary);
}

/* CRUD modal windows use the full width of the screen (minus the Bootstrap margins);
   below md they are fullscreen (modal-fullscreen-md-down). */
@media (min-width: 768px) {
    .modal-dialog.w3pf-modal-wide {
        max-width: calc(100% - 2 * var(--bs-modal-margin));
    }
}

/* File fields: list of attached and newly chosen files. */
.w3pf-files .w3pf-file + .w3pf-file {
    border-top: 1px solid var(--bs-border-color-translucent);
}
.w3pf-file-name {
    width: auto;
    max-width: 22rem;
    flex: 1 1 12rem;
}
.w3pf-file-handle {
    cursor: grab;
}
.w3pf-file-deleted > :not(.form-check):not(.btn-group) {
    text-decoration: line-through;
    opacity: .55;
}
.w3pf-file[data-w3pf-file-status]::after {
    content: attr(data-w3pf-file-status);
    font-size: .875em;
    color: var(--bs-warning-text-emphasis);
}
.w3pf-file-new {
    background: var(--bs-primary-bg-subtle);
}

/* Photo fields: thumbnails and the crop dialog. */
.w3pf-photo-thumb img {
    display: block;
    width: 4rem;
    height: 4rem;
    object-fit: cover;
    border-radius: var(--bs-border-radius);
    background: var(--bs-tertiary-bg);
}
.w3pf-crop {
    position: relative;
    display: inline-block;
    max-width: 100%;
    touch-action: none;
    user-select: none;
}
.w3pf-crop img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
}
.w3pf-crop-box {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5);
    cursor: move;
}
.w3pf-crop-handle {
    position: absolute;
    right: -.5rem;
    bottom: -.5rem;
    width: 1rem;
    height: 1rem;
    background: #fff;
    border: 1px solid var(--bs-primary);
    cursor: nwse-resize;
}
.w3pf-file-drop {
    outline: 2px dashed var(--bs-primary);
    outline-offset: 4px;
    border-radius: var(--bs-border-radius);
    background: var(--bs-primary-bg-subtle);
}
.w3pf-embedded-grid[aria-busy="true"]{opacity:.6;transition:opacity .2s}

/* Org chart ([data-w3pf-orgchart]): toolbar, pannable viewport, cards positioned by w3pf.js,
   SVG connectors (staff dashed), group frames, drop zones while dragging. */
.w3pf-orgchart {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.w3pf-orgchart-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
.w3pf-orgchart-search {
    width: 14rem;
    max-width: 100%;
}
.w3pf-orgchart-viewport {
    position: relative;
    height: 70vh;
    min-height: 420px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--bs-tertiary-bg);
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.w3pf-orgchart-viewport.w3pf-orgchart-panning {
    cursor: grabbing;
}
.w3pf-orgchart-canvas {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
}
.w3pf-orgchart-lines {
    position: absolute;
    left: 0;
    top: 0;
    overflow: visible;
    pointer-events: none;
}
.w3pf-orgchart-line {
    fill: none;
    stroke: var(--bs-secondary-color);
    stroke-width: 1.5;
}
.w3pf-orgchart-line-staff {
    stroke-dasharray: 5 4;
}
.w3pf-orgchart-frame {
    position: absolute;
    border: 1.5px solid var(--bs-border-color);
    border-radius: calc(var(--bs-border-radius) * 1.5);
    background: rgba(var(--bs-body-bg-rgb), .35);
    pointer-events: none;
}
.w3pf-orgchart-frame-title {
    position: absolute;
    left: .5rem;
    top: .2rem;
    max-width: calc(100% - 1rem);
    overflow: hidden;
    font-size: .75rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    white-space: nowrap;
    text-overflow: ellipsis;
}
.w3pf-orgchart-node {
    position: absolute;
    left: 0;
    top: 0;
    width: 13rem;
    cursor: default;
}
.w3pf-orgchart-card {
    padding: .45rem .6rem;
    font-size: .8125rem;
    line-height: 1.3;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    overflow-wrap: anywhere;
}
.w3pf-orgchart-colored {
    border-left-width: 4px;
}
.w3pf-orgchart-staff .w3pf-orgchart-card {
    border-style: dashed;
}
.w3pf-orgchart-title {
    font-weight: 600;
}
.w3pf-orgchart-field {
    color: var(--bs-secondary-color);
}
.w3pf-orgchart-label {
    opacity: .8;
}
/* Accent of an item of a card (data-w3pf-accent → --w3pf-accent): text, border or fill. */
.w3pf-accent-text {
    color: var(--w3pf-accent, inherit);
}
.w3pf-accent-border {
    border-left: 3px solid var(--w3pf-accent, currentColor);
    padding-left: .35rem;
}
.w3pf-accent-fill {
    background-color: color-mix(in srgb, var(--w3pf-accent, transparent) 18%, transparent);
    border-radius: .25rem;
    padding: 0 .35rem;
}
.w3pf-accent-fill + .w3pf-accent-fill {
    margin-top: 2px;
}
.badge.w3pf-accent-fill {
    color: var(--bs-body-color);
    border: 1px solid var(--w3pf-accent, var(--bs-border-color));
    padding: .35em .65em;
}
.w3pf-orgchart-node:focus {
    outline: none;
}
.w3pf-orgchart-node:focus-visible .w3pf-orgchart-card,
.w3pf-orgchart-focused .w3pf-orgchart-card {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .25);
}
.w3pf-orgchart-context .w3pf-orgchart-card {
    color: var(--bs-secondary-color);
    background: var(--bs-secondary-bg);
}
.w3pf-orgchart-match .w3pf-orgchart-card {
    background: var(--bs-warning-bg-subtle);
}
.w3pf-orgchart-highlight .w3pf-orgchart-card {
    border-color: var(--bs-warning);
    box-shadow: 0 0 0 .25rem rgba(var(--bs-warning-rgb), .45);
}
.w3pf-orgchart-node:has(> .w3pf-orgchart-toggle) > .w3pf-orgchart-card {
    padding-bottom: .85rem;
}
.w3pf-orgchart-toggle {
    position: absolute;
    left: 50%;
    bottom: -.6rem;
    min-width: 1.4rem;
    height: 1.2rem;
    padding: 0 .3rem;
    font-size: .7rem;
    line-height: 1.1rem;
    color: var(--bs-secondary-color);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    transform: translateX(-50%);
}
.w3pf-orgchart-collapsed .w3pf-orgchart-toggle {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.w3pf-orgchart[data-w3pf-orgchart-edit] .w3pf-orgchart-node {
    cursor: move;
}
.w3pf-orgchart-moving {
    opacity: .4;
}
.w3pf-orgchart-ghost {
    position: fixed;
    z-index: 2000;
    opacity: .75;
    transform-origin: 0 0;
    pointer-events: none;
}
.w3pf-orgchart-zones {
    position: absolute;
    inset: -.35rem;
    z-index: 1;
    min-height: 2.6rem;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .15);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: "before child after" "staff-left child staff-right";
    font-size: .65rem;
    line-height: 1.1;
    border-radius: var(--bs-border-radius);
    overflow: hidden;
}
.w3pf-orgchart-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .1rem;
    text-align: center;
    color: var(--bs-primary-text-emphasis);
    background: var(--bs-primary-bg-subtle);
    outline: 1px dashed rgba(var(--bs-primary-rgb), .4);
}
.w3pf-orgchart-zone[data-w3pf-zone="before"] { grid-area: before; }
.w3pf-orgchart-zone[data-w3pf-zone="after"] { grid-area: after; }
.w3pf-orgchart-zone[data-w3pf-zone="child"] { grid-area: child; }
.w3pf-orgchart-zone[data-w3pf-zone="staff-left"] { grid-area: staff-left; }
.w3pf-orgchart-zone[data-w3pf-zone="staff-right"] { grid-area: staff-right; }
.w3pf-orgchart-zone.active {
    color: #fff;
    background: var(--bs-primary);
}
.w3pf-orgchart-zone.disabled {
    color: var(--bs-secondary-color);
    background: var(--bs-secondary-bg);
    outline-color: transparent;
}
.w3pf-orgchart-zone.disabled.active {
    color: var(--bs-danger-text-emphasis);
    background: var(--bs-danger-bg-subtle);
}

/* Printing an org chart: only the image of the chart, fitted to a landscape page. */
.w3pf-orgchart-print {
    display: none;
}
@page orgchart {
    size: landscape;
    margin: 10mm;
}
@media print {
    body.w3pf-orgchart-printing * {
        visibility: hidden;
    }
    body.w3pf-orgchart-printing .w3pf-orgchart-print {
        display: block;
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        visibility: visible;
        page: orgchart;
    }
}

/* Clock in the header (data-w3pf-clock): the application time is emphasized, the own time of the user is muted. */
.w3pf-clock {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.w3pf-clock.w3pf-clock-app {
    font-weight: 600;
    color: var(--bs-primary-text-emphasis);
    background-color: var(--bs-primary-bg-subtle);
    border: 1px solid var(--bs-primary-border-subtle);
}
.w3pf-clock.w3pf-clock-user {
    color: var(--bs-secondary-color);
    border: 1px dashed var(--bs-border-color);
}
.w3pf-clock-app .w3pf-clock-badge {
    background-color: var(--bs-primary);
    color: #fff;
}
.w3pf-clock-user .w3pf-clock-badge {
    background-color: transparent;
    color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color);
}
/* Time of a development installation frozen or moved (DEV, /dev/time): the clock in the warning style. */
.w3pf-clock.w3pf-clock-dev,
.w3pf-clock.w3pf-clock-dev.w3pf-clock-app,
.w3pf-clock.w3pf-clock-dev.w3pf-clock-user {
    color: var(--bs-warning-text-emphasis);
    background-color: var(--bs-warning-bg-subtle);
    border: 1px solid var(--bs-warning-border-subtle);
    border-radius: var(--bs-border-radius-sm);
}
span.w3pf-clock.w3pf-clock-dev {
    padding: 0.125rem 0.5rem;
}
.w3pf-clock-dev .w3pf-clock-badge {
    background-color: var(--bs-warning);
    color: #000;
    border: 0;
}
/* DBGrid filter panel: fields of the applied filters are highlighted (also in the column filter dialog). */
.w3pf-filter-active [data-w3pf-filter-label] {
    font-weight: 600;
    color: var(--bs-primary-text-emphasis);
}
.w3pf-filter-active [data-w3pf-filter-label]::before {
    content: "\f0b0";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.8em;
    margin-right: 0.35em;
}
.w3pf-filter-active .form-control,
.w3pf-filter-active .form-select,
.w3pf-filter-active .ts-wrapper .ts-control {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary-bg-subtle);
}

/* Calendar ([data-w3pf-calendar]): toolbar, views month / year / quarter (mini months), week / day
   (time grid, 48px per hour – CALENDAR_HOUR in w3pf.js), agenda, timeline (resources × days).
   Event colour = --w3pf-calendar-color set by w3pf.js (CSSOM, no inline style attribute). */
.w3pf-calendar {
    --w3pf-calendar-color: var(--bs-primary);
    --w3pf-calendar-hour: 48px;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.w3pf-calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
.w3pf-calendar-title {
    flex: 1 1 auto;
}
.w3pf-calendar-views .btn {
    white-space: nowrap;
}
@media (max-width: 767.98px) {
    .w3pf-calendar-views .btn {
        font-size: 0; /* icons only on phones */
    }
    .w3pf-calendar-views .btn i {
        font-size: .875rem;
    }
}
.w3pf-calendar-loading .w3pf-calendar-body {
    opacity: .6;
    transition: opacity .2s;
}
.w3pf-calendar-body {
    min-width: 0;
}
.w3pf-calendar-event {
    display: block;
    width: 100%;
    overflow: hidden;
    padding: 0 .3rem;
    border: 0;
    border-left: 3px solid var(--w3pf-calendar-color);
    border-radius: .2rem;
    background: color-mix(in srgb, var(--w3pf-calendar-color) 18%, var(--bs-body-bg));
    color: var(--bs-body-color);
    font-size: .8rem;
    line-height: 1.35;
    text-align: left;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.w3pf-calendar-event:hover,
.w3pf-calendar-event:focus-visible {
    background: color-mix(in srgb, var(--w3pf-calendar-color) 32%, var(--bs-body-bg));
}
.w3pf-calendar-event:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 1px;
}
.w3pf-calendar-event.w3pf-calendar-absent {
    background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--w3pf-calendar-color) 14%, transparent) 6px 12px);
}
.w3pf-calendar-event.w3pf-calendar-busy {
    border-left-style: dashed;
    font-style: italic;
}
.w3pf-calendar-continued {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.w3pf-calendar-continues {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.w3pf-calendar-time {
    font-variant-numeric: tabular-nums;
    color: var(--bs-secondary-color);
}
.w3pf-calendar-daynum {
    padding: 0 .25rem;
    border: 0;
    border-radius: 1rem;
    background: none;
    color: inherit;
    font-variant-numeric: tabular-nums;
}
.w3pf-calendar-daynum:hover {
    background: var(--bs-secondary-bg);
}
.w3pf-calendar-today .w3pf-calendar-daynum {
    background: var(--bs-primary);
    color: #fff;
}
.w3pf-calendar-daynote {
    overflow: hidden;
    color: var(--bs-secondary-color);
    font-size: .7rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.w3pf-calendar-holiday .w3pf-calendar-daynote {
    color: var(--bs-danger-text-emphasis);
}
.w3pf-calendar-off {
    background: var(--bs-tertiary-bg);
}
.w3pf-calendar-selecting {
    background: var(--bs-primary-bg-subtle) !important;
}
.w3pf-calendar-event.w3pf-calendar-expected {
    border-left-style: dotted;
    background-image: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--w3pf-calendar-color) 10%, transparent) 6px 12px);
}

/* moving events (data-w3pf-calendar-move) */
.w3pf-calendar-draggable {
    cursor: grab;
    touch-action: none;
}
.w3pf-calendar-dragging {
    opacity: .5;
    pointer-events: none;
}
.w3pf-calendar-probe {
    pointer-events: none;
}
.w3pf-calendar-drop {
    outline: 2px dashed var(--bs-primary);
    outline-offset: -2px;
}
.w3pf-calendar-resize {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    cursor: ns-resize;
}

/* month */
.w3pf-calendar-month {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}
.w3pf-calendar-month th {
    padding: .2rem;
    font-weight: 500;
    font-size: .8rem;
    text-align: center;
    color: var(--bs-secondary-color);
}
.w3pf-calendar-month td {
    height: 7rem;
    padding: .15rem;
    border: 1px solid var(--bs-border-color);
    vertical-align: top;
    user-select: none;
}
.w3pf-calendar-month .w3pf-calendar-weeknum {
    width: 2.25rem;
    font-size: .7rem;
}
.w3pf-calendar-outside {
    opacity: .55;
}
.w3pf-calendar-celltop {
    display: flex;
    align-items: baseline;
    gap: .25rem;
    min-width: 0;
}
.w3pf-calendar-cellevents {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.w3pf-calendar-more {
    padding: 0 .3rem;
    border: 0;
    background: none;
    color: var(--bs-link-color);
    font-size: .75rem;
    text-align: left;
}

/* year / quarter */
.w3pf-calendar-months {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
}
.w3pf-calendar-months-3 {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}
.w3pf-calendar-mini table {
    width: 100%;
    table-layout: fixed;
    font-size: .8rem;
    text-align: center;
}
.w3pf-calendar-mini th {
    font-weight: 500;
    color: var(--bs-secondary-color);
}
.w3pf-calendar-mini td {
    padding: 1px;
}
.w3pf-calendar-busyday .w3pf-calendar-daynum {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--bs-primary);
    text-underline-offset: 3px;
}
.w3pf-calendar-mini .w3pf-calendar-holiday .w3pf-calendar-daynum {
    color: var(--bs-danger-text-emphasis);
}

/* week / day */
.w3pf-calendar-timegrid {
    --w3pf-calendar-days: 7;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}
.w3pf-calendar-days-1 {
    --w3pf-calendar-days: 1;
}
.w3pf-calendar-tg-head,
.w3pf-calendar-tg-allday,
.w3pf-calendar-tg-grid {
    display: grid;
    grid-template-columns: 3.5rem repeat(var(--w3pf-calendar-days), minmax(0, 1fr));
}
.w3pf-calendar-tg-head {
    border-bottom: 1px solid var(--bs-border-color);
    text-align: center;
    font-size: .8rem;
}
.w3pf-calendar-tg-allday {
    border-bottom: 2px solid var(--bs-border-color);
}
.w3pf-calendar-tg-allday .w3pf-calendar-tg-day {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-height: 1.75rem;
    padding: 1px;
    border-left: 1px solid var(--bs-border-color);
}
.w3pf-calendar-tg-head .w3pf-calendar-tg-day {
    padding: .2rem;
    border-left: 1px solid var(--bs-border-color);
}
.w3pf-calendar-tg-gutter {
    font-size: .7rem;
    color: var(--bs-secondary-color);
    text-align: right;
    padding-right: .25rem;
}
.w3pf-calendar-tg-scroll {
    height: 65vh;
    min-height: 360px;
    overflow-y: auto;
}
.w3pf-calendar-tg-hour {
    height: var(--w3pf-calendar-hour);
    transform: translateY(-.45em);
}
.w3pf-calendar-tg-col {
    position: relative;
    height: calc(24 * var(--w3pf-calendar-hour));
    border-left: 1px solid var(--bs-border-color);
    background-image: repeating-linear-gradient(to bottom, var(--bs-border-color-translucent) 0 1px, transparent 1px var(--w3pf-calendar-hour));
    user-select: none;
}
.w3pf-calendar-timed {
    position: absolute;
    white-space: normal;
    border: 1px solid var(--bs-body-bg);
    border-left: 3px solid var(--w3pf-calendar-color);
}
.w3pf-calendar-tg-select {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}
.w3pf-calendar-now {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 2px solid var(--bs-danger);
    pointer-events: none;
}

/* agenda */
.w3pf-calendar-agenda-day {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.w3pf-calendar-agenda-day li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
    padding: .1rem 0;
}
.w3pf-calendar-agenda-day .w3pf-calendar-event {
    width: auto;
    max-width: 100%;
    font-size: .875rem;
}
.w3pf-calendar-agenda-time {
    flex: 0 0 7.5rem;
    color: var(--bs-secondary-color);
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
}
.w3pf-calendar-agenda-detail {
    color: var(--bs-secondary-color);
    font-size: .8rem;
}

/* timeline (resources or people × days) */
.w3pf-calendar-timeline-wrap {
    overflow-x: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}
.w3pf-calendar-timeline {
    border-collapse: collapse;
    table-layout: fixed;
    font-size: .8rem;
}
.w3pf-calendar-timeline th,
.w3pf-calendar-timeline td {
    width: 2.25rem;
    min-width: 2.25rem;
    border: 1px solid var(--bs-border-color-translucent);
    text-align: center;
}
.w3pf-calendar-timeline thead th {
    font-weight: 500;
    padding: .15rem 0;
}
.w3pf-calendar-timeline .w3pf-calendar-tl-name {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 14rem;
    min-width: 14rem;
    max-width: 14rem;
    overflow: hidden;
    padding: .2rem .4rem;
    background: var(--bs-body-bg);
    text-align: left;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.w3pf-calendar-timeline tbody td {
    position: relative;
    height: calc(var(--w3pf-calendar-lanes, 1) * 1.3rem + .3rem);
    vertical-align: top;
    user-select: none;
}
.w3pf-calendar-tl-group th {
    padding: .2rem .4rem;
    background: var(--bs-secondary-bg);
    text-align: left;
    font-weight: 600;
}
.w3pf-calendar-bar {
    position: absolute;
    z-index: 1;
    left: 2px;
    top: calc(var(--w3pf-calendar-lane, 0) * 1.3rem + .15rem);
    height: 1.2rem;
}

/* Scanning (form[data-w3pf-scan]): camera preview. */
.w3pf-scan-video {
    display: block;
    width: 100%;
    max-width: 28rem;
    margin-top: .5rem;
    border-radius: var(--bs-border-radius);
}

/* PDF documents (data-w3pf-pdf): the choice menu next to the link and the own viewer (pdf.js in a modal window). */
.w3pf-pdf-menu {
    position: absolute;
    z-index: 1090;
}
.w3pf-pdf-pages {
    overflow: auto;
}
@media (min-width: 576px) {
    .w3pf-pdf-dialog {
        max-width: min(1140px, calc(100vw - 3rem));
    }
    .w3pf-pdf-dialog .modal-content {
        height: calc(100vh - 3.5rem);
    }
}
.w3pf-pdf-print {
    display: none;
}
@media print {
    body.w3pf-pdf-printing > *:not(.w3pf-pdf-print) {
        display: none !important;
    }
    body.w3pf-pdf-printing {
        margin: 0;
        padding: 0;
        background: #fff;
    }
    body.w3pf-pdf-printing .w3pf-pdf-print {
        display: block;
    }
    .w3pf-pdf-print-page {
        display: block;
        page-break-after: always;
        break-after: page;
    }
    .w3pf-pdf-print-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }
}
.w3pf-pdf-sheet {
    max-width: none;
}
.w3pf-pdf-sheet canvas {
    display: block;
}
.w3pf-pdf-page {
    min-width: 7rem;
}
.w3pf-pdf-title {
    max-width: 40vw;
}

/* Non-blocking warning under an input (field option "warn", e.g. a possible duplicate). */
.w3pf-field-warning {
    color: var(--bs-warning-text-emphasis);
}

.w3pf-field-warning ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Duplicates warning of the form: "Show differences" hides equal rows while "Only differences" is on. */
.w3pf-duplicates-diff:has(.w3pf-duplicates-only:checked) .w3pf-duplicates-same {
    display: none;
}

.w3pf-duplicates-diff summary {
    cursor: pointer;
}
