:root {
    --app-topbar-height: 60px;
    --app-sidebar-width: 280px;
    --app-space-1: 4px;
    --app-space-2: 8px;
    --app-space-3: 12px;
    --app-space-4: 16px;
    --app-content-gap: var(--app-space-4);
    --app-chrome-inset: var(--app-space-4);
    --app-nav-flyout-page-gap: var(--app-space-2);
    --app-surface-shadow: 0 6px 12px -10px rgb(18 31 43 / 68%);
    --app-surface-shadow-hover: 0 8px 14px -12px rgb(18 31 43 / 76%);
    --app-desktop-topbar-height: 58px;
    --app-desktop-topbar-bottom: calc(var(--app-chrome-inset) + var(--app-desktop-topbar-height));
    --app-sticky-content-top: calc(var(--app-desktop-topbar-bottom) + var(--app-content-gap));
    --app-z-sticky-mask: 19;
    --app-z-sticky-surface: 20;
    --app-z-sticky-heading: 21;
    --app-body-background: #e8f2f1;
    --app-surface: #ffffff;
    --app-border: #cfe2df;
    --app-text: #163047;
    --app-text-secondary: #405d6d;
    --app-muted: #6f8791;
    --app-control-placeholder: var(--app-muted);
    --app-sidebar: #12314a;
    --app-sidebar-muted: #91aebc;
    --app-nav-foreground: #cbd5e4;
    --app-nav-icon: #8290aa;
    --app-nav-active-foreground: #ffffff;
    --app-nav-hover-background: color-mix(in srgb, #ffffff 7%, var(--app-sidebar));
    --app-nav-flyout-hover-background: rgb(255 255 255 / 8%);
    --app-chrome-background: #173b55;
    --app-primary: #1eb3a5;
    --app-primary-hover: #1aa99c;
    --app-primary-hover-rgb: 26, 169, 156;
    --app-primary-hover-foreground: #ffffff;
    --app-primary-dark: #0f7f78;
    --app-button-border-radius: 10px;
    --app-blue: #287bb5;
    --app-amber: #d18b35;
    --app-amber-soft-background: color-mix(in srgb, var(--app-amber) 16%, var(--app-surface));
    --app-green: #40866f;
    --app-red: #b84a51;
    --app-teal-accent: #3c9f98;
    --app-blue-accent: #4c91c2;
    --app-amber-accent: #d7a04b;
    --app-sage-accent: #66a58c;
    --app-coral-accent: #ef8d78;
    --app-violet-accent: #8a6eb4;
    --app-panel-neutral-background: #eeeae2;
    --app-panel-neutral-border: #ded8cd;
    --app-panel-blue-background: #edf2f7;
    --app-panel-blue-border: #d6dfeb;
    --app-panel-green-background: #eef4f1;
    --app-panel-green-border: #d6e1dc;
    --app-panel-amber-background: #faf3e7;
    --app-panel-amber-border: #eadbc2;
    --app-toolbar-panel-background: color-mix(in srgb, var(--app-primary) 7%, var(--app-surface));
    --app-toolbar-panel-border: color-mix(in srgb, var(--app-primary) 20%, var(--app-border));
    --app-error-bg: #f4d5d4;
    --app-error-text: #963a42;
    --bs-body-color: var(--app-text);
    --bs-emphasis-color: var(--app-text);
    --bs-secondary-color: var(--app-muted);
    --bs-tertiary-color: var(--app-sidebar-muted);
    --bs-link-color: var(--app-primary-dark);
    --bs-link-hover-color: var(--app-primary);
    --bs-focus-ring-color: rgb(var(--app-primary-hover-rgb) / 28%);
}

/* Shared application controls. */
.btn-outline-secondary {
    --bs-btn-color: var(--app-text-secondary);
    --bs-btn-bg: var(--app-surface);
    --bs-btn-border-color: var(--app-border);
    --bs-btn-hover-color: var(--app-primary-dark);
    --bs-btn-hover-bg: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
    --bs-btn-hover-border-color: color-mix(in srgb, var(--app-primary) 35%, var(--app-border));
    --bs-btn-focus-shadow-rgb: var(--app-primary-hover-rgb);
    --bs-btn-active-color: var(--app-primary-dark);
    --bs-btn-active-bg: color-mix(in srgb, var(--app-primary) 16%, var(--app-surface));
    --bs-btn-active-border-color: var(--app-primary);
    --bs-btn-disabled-color: var(--app-muted);
    --bs-btn-disabled-bg: var(--app-surface);
    --bs-btn-disabled-border-color: var(--app-border);
}

/* Keep success badges aligned with the application's muted status green. */
.badge.text-bg-success {
    background-color: #4f7d68 !important;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

html {
    min-height: 100%;
    background: var(--app-body-background);
}

[x-cloak] {
    display: none !important;
}

.app-tooltip {
    position: fixed;
    z-index: 1120;
    width: max-content;
    max-width: min(260px, calc(100vw - 16px));
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--app-nav-hover-background);
    color: #ffffff;
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    white-space: pre-line;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -100%) translateY(3px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.app-tooltip::after {
    position: absolute;
    top: 100%;
    left: 50%;
    border: 5px solid transparent;
    border-top-color: var(--app-nav-hover-background);
    content: "";
    transform: translateX(-50%);
}

.app-tooltip.is-visible {
    opacity: 1;
    transform: translate(-50%, -100%);
}

.app-tooltip.is-below {
    transform: translate(-50%, 0) translateY(-3px);
}

.app-tooltip.is-below.is-visible {
    transform: translate(-50%, 0);
}

.app-tooltip.is-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--app-nav-hover-background);
}

.app-tooltip.is-left {
    transform: translate(-100%, -50%) translateX(3px);
}

.app-tooltip.is-left.is-visible {
    transform: translate(-100%, -50%);
}

.app-tooltip.is-left::after {
    top: 50%;
    left: 100%;
    border-top-color: transparent;
    border-left-color: var(--app-nav-hover-background);
    transform: translateY(-50%);
}

.app-tooltip.is-right {
    transform: translate(0, -50%) translateX(-3px);
}

.app-tooltip.is-right.is-visible {
    transform: translate(0, -50%);
}

.app-tooltip.is-right::after {
    top: 50%;
    right: 100%;
    left: auto;
    border-top-color: transparent;
    border-right-color: var(--app-nav-hover-background);
    transform: translateY(-50%);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--app-body-background);
    color: var(--app-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.app-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-chrome {
    display: contents;
}

.auth-shell {
    display: grid;
    place-items: center;
}

.app-sidebar {
    width: var(--app-sidebar-width);
    min-height: calc(100vh - var(--app-topbar-height));
    padding: 24px 18px;
    background: var(--app-sidebar);
    border-right: 1px solid var(--app-border);
    color: var(--app-text);
    position: fixed;
    inset: var(--app-topbar-height) auto 0 0;
    transform: translateX(-100%);
    transition: transform 160ms ease;
    z-index: 1040;
}

.app-sidebar.is-open {
    transform: translateX(0);
}

.app-backdrop {
    position: fixed;
    inset: var(--app-topbar-height) 0 0;
    background: rgb(23 59 58 / 45%);
    z-index: 1030;
}

.app-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.app-brand-logo-link {
    position: relative;
    display: block;
    width: 212px;
    height: 44px;
    flex: 0 0 212px;
    overflow: hidden;
    text-decoration: none;
}

.app-brand-logo {
    position: absolute;
    top: -33px;
    left: -10px;
    display: block;
    width: 237px;
    max-width: none;
    height: auto;
}

.sidebar-foot,
.metric-note,
.metric-label,
.panel-heading p,
.learning-row span {
    color: var(--app-muted);
}

.sidebar-foot {
    color: var(--app-sidebar-muted);
    font-size: 0.85rem;
}

.app-nav {
    display: grid;
    gap: 4px;
}

.app-nav-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--app-nav-foreground);
    text-decoration: none;
    font-weight: 650;
    transition:
        background-color 140ms ease,
        color 140ms ease;
}

.app-nav-link:hover,
.app-nav-link.has-flyout-hover {
    background: var(--app-primary-hover);
    color: var(--app-nav-active-foreground);
}

.app-nav-link.active {
    background: var(--app-primary);
    color: var(--app-nav-active-foreground);
}

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

.app-nav-link .ti {
    width: 20px;
    flex: 0 0 20px;
    color: var(--app-nav-icon);
    font-size: 1.15rem;
    text-align: center;
    transition: color 140ms ease;
}

.app-nav-link:hover .ti,
.app-nav-link.has-flyout-hover .ti,
.app-nav-link.active .ti {
    color: currentColor;
}

.app-nav-group {
    min-width: 0;
}

.app-nav-submenu-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.app-nav-submenu-indicator {
    margin-left: auto;
}

.app-nav-submenu-indicator .ti {
    width: auto;
    color: currentColor;
    font-size: 0.9rem;
}

.app-nav-group.is-open > .app-nav-submenu-trigger {
    border-color: rgb(255 255 255 / 8%);
    background: rgb(255 255 255 / 7%);
    color: #ffffff;
}

.app-nav-group.is-open > .app-nav-submenu-trigger .ti {
    color: currentColor;
}

.app-nav-flyout[hidden] {
    display: none;
}

.app-nav-flyout-shell[hidden] {
    display: none;
}

.app-nav-flyout-shell {
    --app-nav-flyout-sidebar-spacer-width: 0px;
    --app-nav-flyout-page-spacer-width: var(--app-nav-flyout-page-gap);
    position: fixed;
    z-index: 1060;
    display: flex;
    align-items: stretch;
    background: transparent;
}

.app-nav-flyout-sidebar-spacer {
    position: relative;
    z-index: 1;
    width: var(--app-nav-flyout-sidebar-spacer-width);
    flex: 0 0 var(--app-nav-flyout-sidebar-spacer-width);
    background: var(--app-sidebar);
}

.app-nav-flyout-page-spacer {
    position: relative;
    z-index: 1;
    width: var(--app-nav-flyout-page-spacer-width);
    flex: 0 0 var(--app-nav-flyout-page-spacer-width);
    background: var(--app-body-background);
}

.app-nav-flyout {
    z-index: 1060;
    min-width: 210px;
    padding: 8px;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 12px;
    background: var(--app-sidebar);
    color: #ffffff;
    box-shadow: 0 18px 38px rgb(8 33 51 / 28%);
}

.app-nav-flyout-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -8px -8px 6px;
    padding: 12px 14px;
    border-bottom: 1px solid rgb(255 255 255 / 10%);
    border-radius: 12px 12px 0 0;
    background: rgb(255 255 255 / 4%);
    font-size: 0.82rem;
    font-weight: 750;
}

.app-nav-flyout-heading .ti {
    color: var(--app-primary);
    font-size: 1.2rem;
}

.app-nav-flyout-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--app-nav-foreground);
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
}

.app-nav-submenu-flyout .app-nav-flyout-link + .app-nav-flyout-link {
    margin-top: 2px;
}

.app-nav-flyout-link:hover,
.app-nav-flyout-link:focus-visible,
.app-nav-flyout-link.is-highlighted {
    background: var(--app-nav-flyout-hover-background);
    color: var(--app-nav-active-foreground);
}

.app-nav-flyout-link.is-active {
    background: var(--app-primary);
    color: var(--app-nav-active-foreground);
}

.app-nav-flyout-link:focus-visible {
    outline: 2px solid var(--app-primary);
    outline-offset: -2px;
}

.app-nav-flyout-link .ti {
    width: 18px;
    color: var(--app-nav-icon);
    font-size: 1rem;
    text-align: center;
}

.app-nav-flyout-link.is-active .ti {
    color: currentColor;
}

.app-nav-label-flyout {
    min-width: 170px;
    padding: 0;
    border: 0;
    background: #1a4961;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
}

.app-nav-label-flyout-shell {
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
}

.app-nav-label-flyout .app-nav-flyout-heading {
    min-height: 48px;
    margin: 0;
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom: 0;
    border-radius: inherit;
    background: transparent;
}

.app-nav-label-flyout-shell:hover .app-nav-label-flyout,
.app-nav-label-flyout-shell:focus-visible .app-nav-label-flyout {
    color: #9fe3dc;
}

.app-nav-label-flyout-shell:focus-visible .app-nav-label-flyout {
    outline: 2px solid var(--app-primary);
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .app-nav-flyout-shell {
        position: static;
        display: block;
        margin-top: 6px;
    }

    .app-nav-flyout-sidebar-spacer,
    .app-nav-flyout-page-spacer {
        display: none;
    }

    .app-nav-flyout {
        position: static;
        min-width: 0;
        box-shadow: none;
    }
}

.sidebar-foot {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1;
}

.app-topbar {
    width: 100%;
    height: var(--app-topbar-height);
    flex: 0 0 var(--app-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgb(255 255 255 / 10%);
    background: var(--app-chrome-background);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.topbar-action {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #cbd5e4;
    font-size: 0.875rem;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    transition:
        background-color 140ms ease,
        border-color 140ms ease,
        box-shadow 140ms ease,
        color 140ms ease;
}

.topbar-action .ti {
    width: 20px;
    flex: 0 0 20px;
    color: #8290aa;
    font-size: 1.15rem;
    text-align: center;
    transition: color 140ms ease;
}

.topbar-action:hover {
    border-color: rgb(255 255 255 / 8%);
    background: rgb(255 255 255 / 7%);
    color: #ffffff;
}

.topbar-action:hover .ti {
    color: currentColor;
}

.topbar-action:focus-visible {
    outline: 2px solid var(--app-primary);
    outline-offset: 2px;
}

.topbar-icon-action {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    border-color: rgb(255 255 255 / 8%);
    background: rgb(255 255 255 / 7%);
    color: #ffffff;
}

.topbar-icon-action .ti {
    width: auto;
    flex-basis: auto;
    color: currentColor;
}

.topbar-menu-icon {
    width: 15px;
    height: 12px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
}

.topbar-menu-icon span {
    width: 100%;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
    transition: transform 200ms ease;
}

.topbar-menu-toggle.is-active .topbar-menu-icon span:nth-child(2) {
    transform: scaleX(0.62);
    transform-origin: right center;
}

@media (prefers-reduced-motion: reduce) {
    .topbar-menu-icon span {
        transition-duration: 0.01ms;
    }
}

/* Inventory and vendor workspaces */
.app-workspace {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: var(--app-content-gap);
}

.app-workspace > .edit-workspace-heading-frame {
    margin-bottom: 0;
}

.inventory-directory-workspace,
.vendor-directory-workspace {
    gap: var(--app-content-gap);
}

.inventory-settings-tabs-frame {
    --app-surface-frame-gap: var(--app-content-gap);
    border-radius: 14px;
    background: var(--app-chrome-background);
    box-shadow: var(--app-surface-shadow);
}

.inventory-settings-tabs-toggle {
    width: 100%;
    min-height: 60px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 16px;
    border: 0;
    border-radius: 14px;
    background: var(--app-chrome-background);
    color: #ffffff;
    font-family: inherit;
    text-align: left;
}

.inventory-settings-tabs-toggle:hover,
.inventory-settings-tabs-toggle:focus-visible {
    background: color-mix(in srgb, #ffffff 4%, var(--app-chrome-background));
    color: #ffffff;
}

.inventory-settings-tabs-toggle-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 10px;
    background: rgb(255 255 255 / 7%);
    color: #ffffff;
    font-size: 1.05rem;
}

.inventory-settings-tabs-toggle-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
    overflow: hidden;
}

.inventory-settings-tabs-toggle-title {
    margin: 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 1.03rem;
    font-weight: 850;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-settings-tabs-toggle-description {
    overflow: hidden;
    color: rgb(255 255 255 / 62%);
    font-size: 0.73rem;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-settings-tabs-frame.is-open .inventory-settings-tabs-toggle {
    border-radius: 14px 14px 0 0;
}

.inventory-settings-tabs {
    min-width: 0;
    display: none;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 7px;
    padding: 8px;
    overflow: visible;
    border-top: 1px solid rgb(255 255 255 / 14%);
    border-radius: 0 0 14px 14px;
    background: var(--app-chrome-background);
    box-shadow: none;
}

.inventory-settings-tabs-frame.is-open .inventory-settings-tabs {
    display: grid;
}

.inventory-settings-tab {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--app-nav-foreground);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    text-align: left;
    white-space: normal;
    transition:
        border-color 140ms ease,
        background-color 140ms ease,
        color 140ms ease;
}

.inventory-settings-tab strong {
    min-width: 22px;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgb(255 255 255 / 9%);
    color: rgb(255 255 255 / 72%);
    font-size: 0.67rem;
    line-height: 1;
}

.inventory-settings-tab:hover,
.inventory-settings-tab:focus-visible {
    border-color: rgb(255 255 255 / 8%);
    background: var(--app-nav-hover-background);
    color: var(--app-nav-active-foreground);
}

.inventory-settings-tab.is-active {
    background: var(--app-primary);
    color: var(--app-nav-active-foreground);
}

.inventory-settings-tab.is-active strong {
    background: rgb(255 255 255 / 18%);
    color: #ffffff;
}

.inventory-line-repeater {
    min-width: 0;
    display: grid;
    gap: var(--app-content-gap);
}

@media (min-width: 768px) {
    .inventory-identifier-fields:has(> .inventory-identifier-custom-label[hidden])
        > .inventory-identifier-type,
    .inventory-identifier-fields:has(> .inventory-identifier-custom-label[hidden])
        > .inventory-identifier-value {
        width: 50%;
    }
}

.inventory-receipt-line {
    min-inline-size: 0;
    margin: 0;
    border: 0;
}

.inventory-receipt-line > legend {
    width: auto;
    margin: 0 0 14px;
    padding: 5px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-primary) 11%, var(--app-surface));
    color: var(--app-primary-dark);
    font-size: 0.73rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inventory-settings-content {
    min-width: 0;
    display: grid;
    gap: var(--app-content-gap);
}

.inventory-section-card.inventory-settings-add-card {
    border-top-color: var(--inventory-section-accent);
    border-top-left-radius: 14px;
}

@media (max-width: 575.98px) {
    .inventory-settings-tabs-toggle {
        padding: 11px 12px;
    }

    .inventory-settings-tabs-toggle-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .inventory-settings-tabs-toggle-title {
        font-size: 0.9rem;
    }

    .inventory-settings-tabs-toggle-description {
        font-size: 0.65rem;
    }

    .inventory-settings-tab {
        min-height: 44px;
        padding: 8px 10px;
        font-size: 0.76rem;
    }

    .inventory-settings-tab strong {
        min-width: 20px;
        min-height: 20px;
        padding: 2px 5px;
        font-size: 0.61rem;
    }
}

.inventory-settings-directory {
    min-width: 0;
    display: grid;
}

.inventory-settings-add-heading {
    align-items: flex-end;
}

.inventory-settings-add-heading .app-section-heading-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.inventory-settings-add-heading .app-section-heading-copy > p:last-child {
    margin: 4px 0 0;
    color: var(--app-text-secondary);
    font-size: 0.79rem;
}

.inventory-settings-add-heading .inventory-settings-order-state {
    margin-left: auto;
}

.inventory-settings-add-form {
    display: grid;
    gap: 16px;
    margin: 0;
}

.inventory-settings-add-form > .row {
    --bs-gutter-y: 14px;
}

.inventory-settings-add-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
}

.inventory-settings-add-actions .btn {
    min-width: 150px;
}

.inventory-settings-order-state {
    display: grid;
    justify-items: end;
    gap: 3px;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: right;
}

.inventory-settings-order-state strong {
    color: var(--app-text-secondary);
    font-size: 0.76rem;
    font-weight: 800;
}

.inventory-settings-order-state [data-state="saving"],
.inventory-settings-order-state [data-state="dragging"] {
    color: var(--app-amber);
}

.inventory-settings-order-state [data-state="saved"] {
    color: var(--app-green);
}

.inventory-settings-order-state [data-state="error"] {
    color: var(--app-red);
}

.inventory-setting-sortable {
    min-width: 0;
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.inventory-setting-item {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.inventory-setting-sortable--children {
    margin-left: 34px;
}

.inventory-setting-sortable--children:not(:has(> .inventory-setting-item)) {
    display: none;
}

.inventory-setting-row {
    --app-data-row-accent: var(--app-primary);
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 66px;
    padding: 11px 14px 11px 17px;
    border-color: color-mix(in srgb, var(--app-border) 78%, transparent);
    border-radius: 11px;
}

.inventory-setting-row.is-archived {
    --app-data-row-accent: var(--app-violet-accent);
    --app-data-row-background: color-mix(
        in srgb,
        var(--app-violet-accent) 3%,
        var(--app-surface)
    );
}

.inventory-setting-drag-handle {
    width: 34px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--app-muted);
    cursor: grab;
    touch-action: none;
}

.inventory-setting-drag-handle:hover,
.inventory-setting-drag-handle:focus-visible {
    background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
    color: var(--app-primary-dark);
}

.inventory-setting-drag-handle:active {
    cursor: grabbing;
}

.inventory-setting-drag-handle .ti {
    font-size: 1.25rem;
}

.inventory-setting-row-copy {
    display: grid;
    gap: 2px;
}

.inventory-setting-row-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.inventory-setting-row .app-data-row-title {
    margin: 0;
    overflow: hidden;
    font-size: 0.96rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-setting-row .app-data-row-subtitle {
    max-width: 920px;
    margin: 0;
    overflow: hidden;
    font-size: 0.77rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-setting-row-details {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.inventory-setting-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    color: var(--app-green);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
}

.inventory-setting-status::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.inventory-setting-status.is-archived {
    color: var(--app-muted);
}

.inventory-setting-nest-target {
    display: none;
}

.inventory-settings-directory.is-dragging .inventory-setting-sortable--children {
    min-height: 34px;
    display: grid;
}

.inventory-settings-directory.is-dragging .inventory-setting-nest-target {
    min-height: 32px;
    display: flex;
    align-items: center;
    padding-inline: 12px;
    border: 1px dashed color-mix(in srgb, var(--app-amber-accent) 60%, var(--app-border));
    border-radius: 9px;
    background: color-mix(in srgb, var(--app-amber-accent) 11%, var(--app-surface));
    color: var(--app-amber);
    font-size: 0.68rem;
    font-weight: 800;
}

.inventory-setting-sortable--children.is-drop-target {
    border-radius: 10px;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-amber-accent) 48%, transparent);
}

.inventory-setting-item.gu-transit {
    width: var(--inventory-drag-item-width);
    height: var(--inventory-drag-item-height);
    min-height: var(--inventory-drag-item-height);
    box-sizing: border-box;
    opacity: 1;
    border: 2px dashed color-mix(in srgb, var(--app-amber-accent) 72%, var(--app-amber));
    border-radius: 11px;
    background: color-mix(in srgb, var(--app-amber-accent) 24%, #fffdf4);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--app-amber-accent) 18%, transparent);
    transition: margin-left 120ms ease, width 120ms ease;
}

.inventory-setting-item.gu-transit.is-nesting-preview {
    width: calc(var(--inventory-drag-item-width) - 34px);
    margin-left: 34px;
}

.inventory-setting-item.gu-transit > * {
    display: none;
}

.inventory-setting-item.gu-transit::after {
    display: flex;
    align-items: center;
    justify-content: center;
    color: color-mix(in srgb, var(--app-amber) 82%, var(--app-text));
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.02em;
    content: "Drop here";
}

.inventory-setting-item.gu-mirror {
    z-index: 1100 !important;
    width: var(--inventory-drag-item-width) !important;
    opacity: 0.94;
    cursor: grabbing;
    pointer-events: none;
}

.inventory-setting-item.gu-mirror > .inventory-setting-row {
    height: var(--inventory-drag-row-height);
    min-height: var(--inventory-drag-row-height);
    box-sizing: border-box;
}

.inventory-setting-item.gu-mirror > .inventory-setting-sortable--children {
    display: none;
}

.inventory-setting-drawer-form {
    margin: 0;
}

.inventory-setting-publication-form {
    display: none;
}

@media (max-width: 575.98px) {
    .inventory-section-card > .app-section-heading.inventory-settings-add-heading {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .inventory-settings-add-heading .inventory-settings-order-state {
        width: 100%;
        max-width: none;
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: minmax(0, 1fr) auto;
        justify-items: start;
        padding-top: 12px;
        margin: 0;
        border-top: 1px solid var(--app-border);
        text-align: left;
    }

    .inventory-settings-add-heading .inventory-settings-order-state strong {
        justify-self: end;
    }

    .inventory-settings-add-actions .btn {
        width: 100%;
    }

    .inventory-setting-sortable--children {
        margin-left: 18px;
    }

    .inventory-settings-directory .inventory-setting-row {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 8px;
        padding-inline: 12px;
    }

    .inventory-settings-directory .inventory-setting-row .inventory-setting-drag-handle {
        grid-column: 1;
        grid-row: 1;
    }

    .inventory-settings-directory .inventory-setting-row .inventory-setting-row-copy {
        grid-column: 2;
        grid-row: 1;
    }

    .inventory-settings-directory .inventory-setting-row .app-data-row-actions {
        grid-column: 3;
        grid-row: 1;
    }

    .inventory-setting-drag-handle {
        width: 30px;
    }

    .inventory-setting-row .app-row-action-button span,
    .inventory-setting-status {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .inventory-settings-directory .inventory-setting-row {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
        padding: 11px 12px 11px 15px;
    }

    .inventory-settings-directory .inventory-setting-row .inventory-setting-drag-handle {
        grid-column: 1;
        grid-row: 1;
    }

    .inventory-settings-directory .inventory-setting-row .inventory-setting-row-copy {
        grid-column: 2;
        grid-row: 1;
    }

    .inventory-settings-directory .inventory-setting-row .app-data-row-actions {
        grid-column: 3;
        grid-row: 1;
    }
}

@media (min-width: 1100px) {
    .directory-workspace.inventory-directory-workspace {
        grid-template-rows: auto auto minmax(min-content, 1fr);
    }
}

.inventory-results-heading {
    position: relative;
}

.vendor-work-item .directory-avatar {
    font-size: 1.35rem;
}

.app-data-row.inventory-work-item {
    --inventory-state-accent: var(--app-primary);
    --inventory-state-color: var(--app-primary-dark);
    --app-data-row-accent: var(--inventory-state-accent);
    --app-data-row-status-accent: var(--inventory-state-accent);
    --app-data-row-status-color: var(--inventory-state-color);
    --app-data-row-background: color-mix(
        in srgb,
        var(--inventory-state-accent) 2.5%,
        var(--app-surface)
    );
}

.app-data-row.inventory-work-item--success {
    --inventory-state-accent: var(--app-sage-accent);
    --inventory-state-color: var(--app-green);
}

.app-data-row.inventory-work-item--info {
    --inventory-state-accent: var(--app-blue-accent);
    --inventory-state-color: var(--app-blue);
}

.app-data-row.inventory-work-item--warning {
    --inventory-state-accent: var(--app-amber-accent);
    --inventory-state-color: var(--app-amber);
}

.app-data-row.inventory-work-item--danger {
    --inventory-state-accent: var(--app-coral-accent);
    --inventory-state-color: var(--app-red);
}

.app-data-row.inventory-work-item--muted {
    --inventory-state-accent: var(--app-violet-accent);
    --inventory-state-color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.app-data-row.inventory-work-item--low {
    --inventory-state-accent: var(--app-amber-accent);
    --inventory-state-color: var(--app-amber);
}

.app-data-row.inventory-work-item--out {
    --inventory-state-accent: var(--app-coral-accent);
    --inventory-state-color: var(--app-red);
}

.app-data-row.inventory-work-item--inactive {
    --inventory-state-accent: var(--app-violet-accent);
    --inventory-state-color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.inventory-work-item-status {
    --app-data-row-status-accent: var(--inventory-state-accent);
    --app-data-row-status-color: var(--inventory-state-color);
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
}

.inventory-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.inventory-status-compact-label {
    display: none;
    color: var(--inventory-state-color);
    font-size: 0.69rem;
    font-weight: 850;
    letter-spacing: 0.045em;
    line-height: 1;
    text-transform: uppercase;
}

.inventory-item-subtitle {
    margin: 4px 0 0;
    color: var(--app-text-secondary);
    font-size: 0.83rem;
    line-height: 1.45;
}

.inventory-product-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-product-title > a {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-product-presentation {
    margin: 3px 0 0;
    overflow: hidden;
    color: var(--app-text);
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-product-presentation + .inventory-item-subtitle {
    margin-top: 2px;
}

.inventory-item-meta {
    grid-template-columns: repeat(4, minmax(95px, 1fr));
}

.inventory-location-modal-trigger {
    width: fit-content;
    margin-top: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--app-primary-dark);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.35;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.inventory-location-modal-trigger:hover,
.inventory-location-modal-trigger:focus-visible {
    color: var(--app-primary);
}

.inventory-location-modal-backdrop {
    text-align: left;
}

.inventory-location-modal {
    width: min(100%, 560px);
    max-height: min(80vh, 680px);
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow-hover);
}

.inventory-location-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--app-border);
}

.inventory-location-modal-header .eyebrow {
    margin-bottom: 4px;
}

.inventory-location-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.inventory-location-modal-close {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.inventory-location-modal-close svg {
    width: 18px;
    height: 18px;
}

.inventory-location-modal-list {
    max-height: 48vh;
    overflow-y: auto;
    padding: 6px 24px;
}

.inventory-location-modal-row,
.inventory-location-modal-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
}

.inventory-location-modal-row {
    padding: 15px 0;
    border-bottom: 1px solid var(--app-border);
}

.inventory-location-modal-row:last-child {
    border-bottom: 0;
}

.inventory-location-modal-row span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--app-text);
    font-weight: 700;
}

.inventory-location-modal-row strong,
.inventory-location-modal-total strong {
    flex: 0 0 auto;
    text-align: right;
}

.inventory-location-modal-total {
    padding: 17px 24px;
    border-top: 1px solid var(--app-border);
    background: var(--app-toolbar-panel-background);
    font-weight: 800;
}

.inventory-work-item .directory-work-item-meta-block > span:not(.status-label) {
    min-width: 0;
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .inventory-work-item-status {
        grid-column: 1;
        grid-row: 1;
    }

    .inventory-work-item .app-data-row-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .inventory-work-item .app-data-row-main {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

.inventory-item-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.inventory-item-flags span:not(.app-data-row-state-badge) {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--app-primary) 9%, var(--app-surface));
    color: var(--app-primary-dark);
    font-size: 0.68rem;
    font-weight: 750;
}

.app-form-stack,
.inventory-item-form,
.vendor-form {
    display: grid;
    gap: 20px;
}

.app-form-stack--cards,
.inventory-item-form--cards,
.vendor-form--cards {
    gap: var(--app-content-gap);
}

.app-form-section,
.inventory-form-section {
    min-width: 0;
    padding-top: 2px;
}

:is(.app-form-section, .inventory-form-section) + :is(.app-form-section, .inventory-form-section) {
    padding-top: 20px;
    border-top: 1px solid var(--app-border);
}

.app-form-section-heading,
.inventory-form-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

:is(.app-form-section-heading, .inventory-form-section-heading) > span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: color-mix(in srgb, var(--app-primary) 13%, var(--app-surface));
    color: var(--app-primary-dark);
}

:is(.app-form-section-heading, .inventory-form-section-heading) h3,
:is(.app-form-section-heading, .inventory-form-section-heading) p {
    margin: 0;
}

:is(.app-form-section-heading, .inventory-form-section-heading) h3 {
    font-size: 0.92rem;
    font-weight: 850;
}

:is(.app-form-section-heading, .inventory-form-section-heading) p {
    margin-top: 2px;
    color: var(--app-text-secondary);
    font-size: 0.72rem;
    line-height: 1.4;
}

:is(.app-form-switch-column, .inventory-form-switch-column) .form-check {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

:is(.app-form-switch-column, .inventory-form-switch-column) .form-check-input {
    margin-top: 0;
}

.app-form-note,
.inventory-form-note {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--app-primary) 8%, var(--app-surface));
    color: var(--app-text-secondary);
    font-size: 0.73rem;
    font-weight: 650;
}

:is(.app-form-note--locked, .inventory-form-note--locked) {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 7px;
}

[data-app-conditional-fields][hidden] {
    display: none !important;
}

@media (max-width: 1399.98px) {
    .inventory-item-meta {
        grid-template-columns: repeat(3, minmax(110px, 1fr));
    }
}

@media (max-width: 767.98px) {
    .inventory-item-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-item-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .inventory-item-meta {
        grid-template-columns: 1fr;
    }
}

.topbar-icon-action:hover {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #ffffff;
    box-shadow: 0 6px 14px rgb(8 15 29 / 22%);
}

.app-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 28px 18px 44px;
}

.auth-shell .app-main,
.auth-shell .app-content {
    width: 100%;
}

.auth-shell .app-content {
    padding-top: 0;
    padding-bottom: 0;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: clamp(72px, 20vh, 150px) 0 48px;
}

.auth-card {
    width: min(100%, 430px);
    padding: 24px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.auth-access-layout,
.auth-access-layout .app-content {
    background: var(--app-body-background);
}

.auth-access-layout .app-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(72px, 20vh, 150px) clamp(18px, 3vw, 32px) 48px;
}

.auth-access-layout .app-content > #app-flash-messages {
    width: min(100%, 550px);
}

.auth-access-layout #app-flash-messages > .alert {
    width: 100%;
    margin: 0 0 20px;
}

.auth-access-layout .auth-access-page {
    width: 100%;
    min-height: 0;
    padding: 0;
    background: transparent;
}

.auth-access-card {
    width: min(100%, 550px);
    padding: 50px 90px;
    border: 0;
    border-radius: 10px;
    box-shadow: var(--app-surface-shadow);
    text-align: center;
}

.auth-access-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-access-title {
    margin: 0 0 10px;
    font-family: inherit;
    font-size: 26px;
    font-weight: 400;
}

.auth-access-form {
    text-align: left;
}

.auth-access-form .input {
    margin-bottom: 16px;
}

.auth-access-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--app-text-secondary);
    font-size: 16px;
    font-weight: 600;
}

.auth-access-form .form-control {
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 16px;
    border: 0;
    border-radius: 4px;
    background: #edf4f4;
    font-family: inherit;
    font-size: 16px;
    line-height: 24px;
}


.auth-access-form .form-control:focus {
    background: #e8f3f1;
    box-shadow: 0 0 0 2px rgb(15 118 110 / 25%);
}

.auth-access-form .form-actions {
    margin-top: 8px;
}

.auth-access-form .auth-access-submit {
    width: 100%;
    min-height: 50px;
    padding: 13px;
    border: 0;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
}

.auth-access-help {
    margin: -8px 0 16px;
    color: var(--app-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.auth-access-links {
    margin-top: 6px;
    font-size: 14px;
    text-align: right;
}

.auth-access-links a {
    color: var(--app-primary-dark);
    font-weight: 400;
    text-decoration: none;
}

.auth-access-links a:hover {
    color: var(--app-primary);
}

.page-heading {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px;
    margin-bottom: var(--app-content-gap);
}

.page-heading > :first-child {
    min-width: 0;
}

/* Major tiled surfaces use an unclipped frame for layout, sticky behavior, and grout masks. */
.app-surface-frame {
    --app-surface-frame-gap: var(--app-content-gap);
    --app-surface-frame-sticky-top: var(--app-sticky-content-top);
    min-width: 0;
    position: relative;
    isolation: isolate;
}

.app-surface-frame--sticky {
    position: sticky;
    z-index: var(--app-z-sticky-surface);
    top: var(--app-surface-frame-sticky-top);
}

.app-surface-frame--sticky > .app-surface {
    box-shadow: var(--app-surface-shadow);
}

.app-surface-frame--mask-before::before,
.app-surface-frame--mask-after::after {
    position: absolute;
    z-index: 0;
    right: 0;
    left: 0;
    height: var(--app-surface-frame-gap);
    background: var(--app-body-background);
    content: "";
    pointer-events: none;
}

.app-surface-frame--mask-before::before {
    bottom: 100%;
}

.app-surface-frame--mask-after::after {
    top: 100%;
}

.app-surface-frame--mask-underlay {
    background: transparent;
}

.app-surface-frame--mask-underlay::before {
    bottom: 0;
    height: calc(100% + var(--app-surface-frame-gap));
}

.app-surface-frame--mask-bleed::before,
.app-surface-frame--mask-bleed::after {
    box-shadow: 0 0 0 100vmax var(--app-body-background);
    clip-path: inset(0 -100vmax);
}

.app-surface-frame > .app-surface {
    position: relative;
    z-index: 1;
}

.app-surface-frame > .page-heading {
    margin-bottom: 0;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--app-primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-section-heading {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.app-section-heading--divided {
    margin-bottom: 23px;
    padding-bottom: 19px;
    border-bottom: 1px solid var(--app-border);
}

.app-section-heading-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    border-radius: 12px 5px 12px 5px;
    background: color-mix(in srgb, var(--app-primary) 16%, var(--app-surface));
    color: var(--app-primary-dark);
    font-size: 1.15rem;
}

.app-section-heading-icon--blue {
    background: color-mix(in srgb, var(--app-blue) 14%, var(--app-surface));
    color: var(--app-blue);
}

.app-section-heading-icon--amber {
    background: var(--app-amber-soft-background);
    color: var(--app-amber);
}

.app-section-heading-icon--green {
    background: color-mix(in srgb, var(--app-green) 15%, var(--app-surface));
    color: var(--app-green);
}

.app-section-heading-icon--violet {
    background: color-mix(in srgb, var(--app-violet-accent) 14%, var(--app-surface));
    color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.app-section-heading-icon--coral {
    background: color-mix(in srgb, var(--app-coral-accent) 14%, var(--app-surface));
    color: var(--app-red);
}

.app-section-heading-copy {
    min-width: 0;
}

.app-section-heading-eyebrow {
    margin: 0 0 2px;
    color: var(--app-primary-dark);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-section-heading h2,
.app-section-heading-title {
    margin: 0;
    color: var(--app-text);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.app-section-heading-description {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 0.84rem;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 800;
}

.page-summary {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--app-muted);
}

.product-edit-presentation {
    margin: 4px 0 0;
    color: var(--app-text);
    font-size: 1.25rem;
    font-weight: 800;
}

.app-drawer {
    --app-drawer-max-width: 540px;
    --bs-offcanvas-width: min(100vw, var(--app-drawer-max-width));
    --bs-offcanvas-zindex: 1060;

    border-color: var(--app-border);
    background: var(--app-surface);
}

.offcanvas-backdrop {
    z-index: 1055;
    touch-action: none;
}

.app-drawer-sm {
    --app-drawer-max-width: 420px;
}

.app-drawer-lg {
    --app-drawer-max-width: 720px;
}

.offcanvas.app-drawer-floating {
    --app-drawer-gap: 10px;
    --app-drawer-available-width: calc(100% - 20px);
    --bs-offcanvas-width: min(var(--app-drawer-available-width), var(--app-drawer-max-width));

    top: var(--app-drawer-gap);
    bottom: var(--app-drawer-gap);
    height: auto;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgb(23 59 58 / 24%);
}

.app-drawer-floating.offcanvas-end {
    right: var(--app-drawer-gap);
}

.app-drawer-floating.offcanvas-start {
    left: var(--app-drawer-gap);
}

.app-drawer-floating.offcanvas-end:not(.show):not(.showing) {
    transform: translateX(calc(100% + var(--app-drawer-gap)));
}

.app-drawer-floating.offcanvas-start:not(.show):not(.showing) {
    transform: translateX(calc(-100% - var(--app-drawer-gap)));
}

.app-drawer-header {
    flex: 0 0 auto;
    align-items: flex-start;
    position: sticky;
    z-index: 4;
    top: 0;
    padding: 22px 24px;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface);
}

.app-drawer-header .eyebrow {
    margin-bottom: 3px;
}

.app-drawer-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.appointment-workspace-title-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.appointment-workspace-title-badge {
    padding: 0.3em 0.6em;
    border: 0;
    font-size: 0.6875rem;
    font-weight: 750;
}

.app-drawer-body {
    min-height: 0;
    padding: 24px;
    overscroll-behavior: contain;
}

.app-drawer-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    z-index: 4;
    bottom: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--app-border);
    background: #f4f9f8;
}

.app-form label,
.app-form .form-label {
    margin-bottom: 6px;
    color: var(--app-text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
}

.form-label-optional {
    margin-left: 4px;
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.person-lookup-control {
    position: relative;
}

.person-lookup-control .form-control {
    padding-right: 42px;
}

.person-lookup-clear {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: absolute;
    top: 50%;
    right: 6px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--app-muted);
    transform: translateY(-50%);
}

.person-lookup-clear:hover,
.person-lookup-clear:focus-visible {
    background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
    color: var(--app-primary-dark);
}

.person-lookup-results {
    max-height: 240px;
    margin-top: 8px;
    overflow-y: auto;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgb(18 49 74 / 12%);
}

.appointment-attendee-results-transition {
    transform-origin: top;
    transition: opacity 140ms ease, transform 160ms ease;
}

.appointment-attendee-results-transition--hidden {
    opacity: 0;
    transform: translateY(-7px);
}

.appointment-attendee-results-transition--visible {
    opacity: 1;
    transform: translateY(0);
}

.person-lookup-option {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--app-border);
    background: transparent;
    color: var(--app-text);
    text-align: left;
}

.person-lookup-option:last-child {
    border-bottom: 0;
}

.person-lookup-option:hover,
.person-lookup-option:focus-visible,
.person-lookup-option.is-active {
    background: color-mix(in srgb, var(--app-primary) 9%, var(--app-surface));
    outline: 0;
}

.person-lookup-option-details {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.person-lookup-option-details strong,
.person-lookup-option-details small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-lookup-option-details small {
    color: var(--app-muted);
    font-size: 0.76rem;
}

.product-lookup-option-title {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 7px;
    white-space: nowrap;
}

.product-lookup-option-title > strong,
.product-lookup-option-presentation {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-lookup-option-title > strong {
    flex: 0 1 auto;
}

.product-lookup-option-title > .product-lookup-option-presentation {
    flex: 1 1 auto;
    color: var(--app-text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
}

.product-lookup-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--app-primary-dark);
}

.product-lookup-option-icon .ti {
    width: 1em;
    height: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1;
}

.product-lookup-option-icon .ti::before {
    display: block;
    line-height: 1;
}

.product-lookup-results {
    max-height: 300px;
}

.person-lookup-state {
    margin: 0;
    padding: 13px;
    color: var(--app-muted);
    font-size: 0.84rem;
}

.person-lookup-state--error {
    color: var(--app-red);
}

.person-lookup-locked-value {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: color-mix(in srgb, var(--app-primary) 5%, var(--app-surface));
    color: var(--app-text-secondary);
    font-size: 0.86rem;
    font-weight: 700;
}

.person-lookup-locked-value > .ti {
    flex: 0 0 auto;
    color: var(--app-primary-dark);
}

.person-lookup-locked-value > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-lookup-selected-value .person-lookup-clear {
    flex: 0 0 auto;
    position: static;
    margin-left: auto;
    transform: none;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--app-primary-hover);
    box-shadow: 0 0 0 0.25rem rgb(var(--app-primary-hover-rgb) / 22%);
}

.form-check-input:checked {
    border-color: var(--app-primary);
    background-color: var(--app-primary);
}

.flatpickr-wrapper {
    display: block;
    width: 100%;
}

.flatpickr-calendar {
    border: 1px solid var(--app-border);
    border-radius: 10px;
    color: var(--app-text);
    font-family: inherit;
    box-shadow: 0 14px 38px rgb(22 48 71 / 18%);
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year,
span.flatpickr-weekday {
    color: var(--app-text-secondary);
    font-weight: 700;
}

.flatpickr-day {
    color: var(--app-text);
}

.flatpickr-day.today {
    border-color: var(--app-primary);
}

.flatpickr-day:hover,
.flatpickr-day:focus,
.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
    border-color: var(--app-primary-dark);
    background: var(--app-primary-dark);
    color: #ffffff;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    border-color: var(--app-primary-dark);
    background: var(--app-primary-dark);
    color: #ffffff;
}

.flatpickr-time {
    border-top-color: var(--app-border);
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
}

:where(.app-content form) .form-error {
    border-color: var(--app-red);
}

:where(.app-content form) .form-error:focus {
    border-color: var(--app-red);
    box-shadow: 0 0 0 0.25rem rgb(185 28 28 / 16%);
}

.input > .element-error {
    position: relative;
    width: 100%;
    clear: both;
    margin-top: 10px;
    line-height: 24px;
}

.input > .element-error::before {
    position: absolute;
    z-index: 0;
    top: -7px;
    left: 12px;
    display: block;
    width: 15px;
    height: 15px;
    border-radius: 2px 0 2px;
    background: var(--app-error-bg);
    content: "";
    transform: rotate(45deg);
}

.input > .element-error .error-message {
    position: relative;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px 13px;
    border: 0;
    border-radius: 4px;
    background: var(--app-error-bg);
    color: var(--app-error-text);
    font-size: 0.875rem;
    line-height: 24px;
}

.input > .element-error div.error-message,
.input > .element-error .error-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.input > .element-error .error-message .icon {
    flex: 0 0 auto;
    color: inherit;
    font-size: 1.125rem;
    line-height: 24px;
    transform: translateX(-2px);
}

.input > .element-error .error-message-text {
    min-width: 0;
    flex: 1 1 auto;
}

.input > .element-error .error-list {
    list-style: none;
}

.input > .element-error .error-list li {
    margin: 0 0 6px;
    padding: 0;
}

.input > .element-error .error-list li:last-child {
    margin-bottom: 0;
}

@media (min-width: 576px) {
    .offcanvas.app-drawer-floating {
        --app-drawer-gap: 16px;
        --app-drawer-available-width: calc(100% - 32px);
    }
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: var(--app-content-gap);
    margin-bottom: var(--app-content-gap);
}

.dashboard-heading-frame {
    margin-bottom: var(--app-content-gap);
}

.dashboard-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--app-content-gap);
}

.metric-card-frame > .metric-card,
.dashboard-panel-frame > .dashboard-panel {
    height: 100%;
}

.metric-card,
.dashboard-panel {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.metric-card {
    min-height: 136px;
    padding: 18px;
    display: grid;
    align-content: space-between;
    gap: 8px;
}

.metric-card strong {
    font-size: 2rem;
    line-height: 1;
}

.metric-label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-note {
    font-size: 0.9rem;
}

.dashboard-panel {
    padding: 18px;
}

@media (min-width: 992px) {
    .dashboard-panel-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .dashboard-panel-frame--pipeline,
    .dashboard-panel-frame--learning {
        grid-column: 1 / -1;
    }

    .dashboard-panel-frame--status {
        grid-column: span 5;
    }

    .dashboard-panel-frame--build {
        grid-column: span 7;
    }
}

@media (min-width: 1200px) {
    .dashboard-panel-frame--pipeline {
        grid-column: span 8;
    }

    .dashboard-panel-frame--learning {
        grid-column: span 4;
    }
}

.directory-card {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.directory-table {
    min-width: 780px;
    border-collapse: separate;
    border-spacing: 0;
}

.directory-table > :not(caption) > * > * {
    padding: 25px 18px;
    border-top: 0;
    border-bottom: 1px solid #dcebea;
}

.directory-table thead th {
    position: sticky;
    z-index: var(--app-z-sticky-surface);
    top: var(--app-topbar-height);
    color: var(--app-text);
    background: #ffffff;
    box-shadow: none;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.directory-table thead th:first-child {
    border-top-left-radius: 8px;
}

.directory-table thead th:last-child {
    border-top-right-radius: 8px;
}

.directory-table thead a {
    color: inherit;
    text-decoration: none;
}

.directory-table thead a:hover,
.directory-table thead a:focus-visible {
    color: var(--app-primary-dark);
}

.directory-table tbody tr:last-child > * {
    border-bottom: 0;
}

.directory-card:not(:has(.directory-pagination)) .directory-table tbody tr:last-child > :first-child {
    border-bottom-left-radius: 8px;
}

.directory-card:not(:has(.directory-pagination)) .directory-table tbody tr:last-child > :last-child {
    border-bottom-right-radius: 8px;
}

.table tbody tr > * {
    transition: background-color 140ms ease;
}

.table tbody tr:hover > * {
    background-color: #f0f7f6;
}

.directory-person {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 180px;
}

.directory-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #b8ddd8;
    color: #115e59;
    font-size: 0.78rem;
    font-weight: 800;
}

.app-color-pair--1 {
    background: #b6dfe7;
    color: #155e75;
}

.app-color-pair--2 {
    background: #b9dcf0;
    color: #075985;
}

.app-color-pair--3 {
    background: #c3d2f7;
    color: #1e40af;
}

.app-color-pair--4 {
    background: #cfcef2;
    color: #3730a3;
}

.app-color-pair--5 {
    background: #ddc9ef;
    color: #6b21a8;
}

.app-color-pair--6 {
    background: #efc6d5;
    color: #9d174d;
}

.app-color-pair--7 {
    background: #f1ccb8;
    color: #9a3412;
}

.directory-email {
    color: var(--app-text-secondary);
    text-decoration: none;
}

.directory-email:hover {
    color: var(--app-primary-dark);
    text-decoration: underline;
}

.directory-email-copy {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
}

.directory-email-copy.is-copied {
    color: var(--app-green);
}

.directory-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.directory-role-badge {
    border: 1px solid #b8ddd8;
    background: #e6f3f1;
    color: var(--app-primary-dark);
    font-weight: 700;
}

.status-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--app-text-secondary);
    font-size: 0.88rem;
    font-weight: 650;
    white-space: nowrap;
}

.status-label .status-dot {
    width: 7px;
    height: 7px;
    margin-right: 0;
}

.status-label-active .status-dot {
    background: var(--app-green);
}

.status-label-inactive .status-dot {
    background: var(--app-muted);
}

.status-label-published .status-dot {
    background: var(--app-green);
}

.status-label-unpublished .status-dot {
    background: var(--app-muted);
}

.status-label-available .status-dot,
.status-label-posted .status-dot,
.status-label-received .status-dot {
    background: var(--app-green);
}

.status-label-draft .status-dot,
.status-label-partially_received .status-dot,
.status-label-quarantined .status-dot {
    background: var(--app-amber);
}

.status-label-ordered .status-dot,
.status-label-returned .status-dot {
    background: var(--app-blue);
}

.status-label-voided .status-dot,
.status-label-cancelled .status-dot,
.status-label-recalled .status-dot,
.status-label-expired .status-dot,
.status-label-depleted .status-dot,
.status-label-discontinued .status-dot {
    background: var(--app-red);
}

.status-label-inactive .status-dot,
.status-label-closed .status-dot {
    background: var(--app-violet-accent);
}

.directory-date {
    color: var(--app-muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.directory-phone {
    color: var(--app-muted);
}

.directory-actions-heading {
    width: 1%;
    text-align: right;
}

.directory-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.directory-action {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    background: var(--app-surface);
    color: var(--app-text-secondary);
    font-size: 1rem;
}

.directory-action:not(:disabled):hover,
.directory-action:not(:disabled):focus-visible {
    border-color: #f1aeb5;
    background: #fff5f5;
    color: var(--app-red);
}

.directory-action:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.directory-action-edit,
.directory-action-edit:disabled {
    border: 0;
    background: #b9dcf0;
    color: #075985;
    opacity: 1;
    text-decoration: none;
}

.directory-action-edit:not(:disabled):hover,
.directory-action-edit:not(:disabled):focus-visible {
    border-color: transparent;
    background: #a7d3ec;
    color: #075985;
}

.directory-action-delete {
    border: 0;
    background: #efc6d5;
    color: #9d174d;
}

.directory-action-delete:not(:disabled):hover,
.directory-action-delete:not(:disabled):focus-visible {
    border-color: transparent;
    background: #e7b5c7;
    color: #831843;
}

.app-confirm-backdrop {
    position: fixed;
    z-index: 1090;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgb(23 59 58 / 55%);
}

.app-confirm-dialog {
    width: min(100%, 440px);
    padding: 28px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow-hover);
    text-align: center;
}

.app-confirm-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--app-coral-accent) 16%, var(--app-surface));
    color: var(--app-red);
    font-size: 1.35rem;
}

.app-confirm-icon--warning {
    background: var(--app-amber-soft-background);
    color: var(--app-amber);
}

.app-confirm-icon--primary {
    background: color-mix(in srgb, var(--app-primary) 16%, var(--app-surface));
    color: var(--app-primary-dark);
}

.app-confirm-dialog h2 {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 800;
}

.app-confirm-dialog p {
    margin: 0;
    color: var(--app-muted);
}

.app-confirm-error {
    margin-top: 12px !important;
    color: var(--app-red) !important;
    font-weight: 650;
}

.app-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.directory-empty {
    padding: 48px 18px !important;
    color: var(--app-muted) !important;
    text-align: center;
}

.directory-table-meta {
    margin: 10px 0 0;
    color: var(--app-muted);
    font-size: 14px;
}

.directory-card-listing {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: var(--app-content-gap);
}

.directory-card-workspace {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: var(--app-content-gap);
}

.directory-card-workspace--fill {
    grid-template-rows: auto auto minmax(min-content, 1fr);
    align-content: stretch;
}

.directory-card-listing--fill {
    grid-template-rows: minmax(min-content, 1fr);
    align-content: stretch;
}

.directory-card-listing--fill.directory-card-listing--paginated {
    grid-template-rows: minmax(min-content, 1fr) auto;
}

.directory-card-listing--fill > .directory-card-empty {
    align-content: center;
}

.directory-workspace-toolbar {
    min-width: 0;
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.app-workspace-toolbar-panel {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 11px;
    padding: 14px;
    border-radius: 12px;
    border: 0;
    background: var(--app-toolbar-panel-background);
}

.app-workspace-toolbar-panel .app-workspace-toolbar-panel-label {
    margin: 0;
    color: var(--app-text);
}

.app-workspace-toolbar-panel .app-workspace-toolbar-panel-label > .ti {
    color: var(--app-primary-dark);
}

.app-workspace-toolbar-panel .app-workspace-toolbar-panel-heading > small {
    color: var(--app-text);
}

.app-workspace-toolbar-panel .directory-sort-links {
    justify-content: flex-start;
}

.directory-workspace-toolbar::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--app-primary);
    content: "";
}

.directory-workspace-toolbar-heading {
    grid-column: 1 / -1;
    margin-bottom: 20px;
}

.directory-workspace-filter {
    min-width: 0;
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.directory-workspace-filter-control {
    min-width: 150px;
    flex: 1 1 170px;
}

.directory-workspace-filter-control .input {
    margin: 0;
}

.directory-workspace-filter-control .form-select {
    min-height: 44px;
    padding-inline: 12px;
    border: 1px solid color-mix(in srgb, var(--app-primary) 28%, var(--app-border));
    border-radius: 8px;
    background-color: var(--app-surface);
    color: var(--app-text);
    font-size: 0.79rem;
}

.directory-workspace-refine-panel {
    align-content: start;
}

.directory-advanced-filter-button {
    flex: 0 0 auto;
}

.directory-filter-drawer-form > .input {
    margin: 0;
}

.directory-sort-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 0;
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.directory-sort-row-label {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    color: var(--app-text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
}

.directory-sort-row-label > .ti {
    color: var(--app-primary-dark);
    font-size: 1rem;
}

.directory-sort-links {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.directory-sort-button {
    min-height: 38px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-button-border-radius);
    background: var(--app-surface);
    color: var(--app-text-secondary);
    font-size: 0.79rem;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.directory-sort-button:hover,
.directory-sort-button:focus-visible {
    border-color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 16%, var(--app-surface));
    color: var(--app-primary-dark);
}

.directory-sort-button:focus-visible {
    outline: 2px solid var(--app-primary);
    outline-offset: 1px;
}

.directory-sort-button.is-active {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: var(--app-nav-active-foreground);
}

.directory-sort-button.asc::after {
    content: "\2191";
}

.directory-sort-button.desc::after {
    content: "\2193";
}

.directory-sort-button.asc::after,
.directory-sort-button.desc::after,
.task-sort-links .task-sort-button.asc::after,
.task-sort-links .task-sort-button.desc::after {
    min-width: 22px;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-size: 0.68rem;
    line-height: 1;
}

.directory-sort-button.is-active::after,
.task-sort-links .task-sort-button.is-active::after {
    background: rgb(255 255 255 / 17%);
}

.directory-results-heading-frame {
    --app-surface-frame-gap: var(--app-content-gap);
}

.directory-results-heading {
    min-width: 0;
    min-height: 69px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 16px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: var(--app-chrome-background);
    color: #ffffff;
    box-shadow: var(--app-surface-shadow);
}

.directory-results-heading-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.directory-results-heading-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 10px;
    background: rgb(255 255 255 / 7%);
    color: #ffffff;
    font-size: 1.05rem;
}

.directory-results-heading-main > div {
    min-width: 0;
    display: grid;
    gap: 2px;
    overflow: hidden;
}

.directory-results-heading h2 {
    margin: 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 1.03rem;
    font-weight: 850;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.directory-results-heading-main > div > span {
    overflow: hidden;
    color: rgb(255 255 255 / 62%);
    font-size: 0.73rem;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.directory-results-heading-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding-left: 16px;
    border-left: 1px solid rgb(255 255 255 / 14%);
    white-space: nowrap;
}

.directory-results-heading-meta strong {
    color: var(--app-primary);
    font-size: 1.38rem;
    font-weight: 850;
    line-height: 1;
}

.directory-results-heading-meta span {
    color: rgb(255 255 255 / 88%);
    font-size: 0.75rem;
    font-weight: 750;
}

.directory-results-heading-count-compact {
    display: none;
}

.directory-results-heading-meta small {
    margin-left: 3px;
    color: rgb(255 255 255 / 58%);
    font-size: 0.67rem;
    font-weight: 650;
}

.directory-card-list {
    min-width: 0;
    display: grid;
    gap: var(--app-content-gap);
}

.app-data-row {
    --app-data-row-leading-track: 72px;
    --app-data-row-accent: var(--app-primary);
    --app-data-row-background: var(--app-surface);

    min-width: 0;
    position: relative;
    display: grid;
    grid-template-columns: var(--app-data-row-leading-track) minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
    padding: 20px 20px 20px 24px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--app-data-row-background);
    box-shadow: var(--app-surface-shadow);
    transition: box-shadow 150ms ease, transform 150ms ease;
}

.app-data-row--status {
    --app-data-row-leading-track: 86px;
}

.app-data-row::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--app-data-row-accent);
    content: "";
}

.app-data-row:hover {
    box-shadow: var(--app-surface-shadow-hover);
    transform: translateY(-1px);
}

.app-data-row-leading {
    min-width: 0;
    display: flex;
    align-self: start;
    justify-content: center;
}

.app-data-row-leading--avatar .directory-avatar {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    font-size: 0.95rem;
}

.app-data-row-leading--status .directory-avatar {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    border-radius: 11px;
}

.app-data-row-main {
    min-width: 0;
}

.app-data-row-title {
    margin: 0 0 4px;
    color: var(--app-text);
    font-size: 1.12rem;
    font-weight: 850;
    line-height: 1.3;
}

.app-data-row-title a {
    color: inherit;
    text-decoration: none;
}

.app-data-row-title a:hover,
.app-data-row-title a:focus-visible {
    color: var(--app-primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.app-data-row-subtitle {
    margin: 3px 0 0;
    color: var(--app-text-secondary);
    font-size: 0.83rem;
    line-height: 1.45;
}

.directory-work-item-main > .directory-email {
    color: var(--app-text-secondary);
    font-size: 0.87rem;
    line-height: 1.52;
}

.app-data-row-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px 20px;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--app-border) 72%, transparent);
}

.app-data-row-field,
.app-data-row-fields > div {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 6px;
}

.app-data-row-field small,
.app-data-row-fields > div > small {
    color: var(--app-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    line-height: 1;
    text-transform: uppercase;
}

.app-data-row-field > strong,
.app-data-row-fields > div > strong,
.app-data-row-fields > div > span {
    min-width: 0;
    overflow: hidden;
    color: var(--app-text-secondary);
    font-size: 0.77rem;
    font-weight: 750;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.app-data-row-actions {
    display: grid;
    align-self: start;
    gap: 6px;
}

.directory-card-empty {
    position: relative;
    display: grid;
    justify-items: center;
    overflow: hidden;
    padding: clamp(42px, 8vw, 72px) 24px;
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
    text-align: center;
}

.directory-card-empty--accent {
    border: 1px solid rgb(32 40 58 / 8%);
}

.directory-card-empty--accent::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--app-primary);
    content: "";
}

.directory-card-empty-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--app-primary) 13%, var(--app-surface));
    color: var(--app-primary-dark);
    font-size: 1.35rem;
}

.directory-card-empty h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.directory-card-empty p {
    max-width: 520px;
    margin: 8px 0 0;
    color: var(--app-muted);
}

.directory-card-listing > .directory-pagination {
    margin-top: 0;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-surface-shadow);
}

@media (max-width: 767.98px) {
    .directory-workspace-toolbar {
        grid-template-columns: 1fr;
    }

    .directory-results-heading {
        padding-inline: 18px;
    }

    .directory-results-heading-meta {
        flex: 0 0 auto;
        max-width: calc(50% - 9px);
    }

    .app-data-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
        align-items: start;
        padding: 18px 18px 18px 22px;
    }

    .app-data-row-leading {
        grid-column: 1;
        grid-row: 1;
        justify-content: flex-start;
    }

    .app-data-row-leading--avatar .directory-avatar {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .app-data-row-actions {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        justify-content: flex-end;
    }

    .app-data-row-main {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .directory-work-item-meta-block--role {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .directory-workspace-toolbar {
        padding: 12px;
    }

    .directory-workspace-filter {
        display: grid;
        grid-template-columns: 1fr;
    }

    .directory-workspace-filter-control {
        min-width: 0;
    }

    .app-data-row-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .directory-work-item-meta .directory-date {
        white-space: normal;
    }

    .directory-results-heading {
        min-height: 82px;
        gap: 10px;
        padding: 10px 12px;
    }

    .directory-results-heading-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .directory-results-heading h2 {
        display: -webkit-box;
        font-size: 0.9rem;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .directory-results-heading-main > div > span {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.65rem;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .directory-results-heading-meta small {
        display: none;
    }

    .directory-results-heading-meta {
        gap: 5px;
        padding-left: 10px;
    }

    .directory-results-heading-meta strong {
        font-size: 1.2rem;
    }

    .directory-results-heading-meta span {
        font-size: 0.67rem;
    }

    .directory-results-heading-count-full {
        display: none;
    }

    .directory-results-heading-count-compact {
        display: inline;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-data-row {
        transition: none;
    }

    .app-data-row:hover {
        transform: none;
    }
}

/* Directory stack: scroll mask, information card, then sticky table heading. */
.directory-information-frame {
    position: relative;
    z-index: var(--app-z-sticky-surface);
}

@media (max-width: 1099.98px) {
    .directory-workspace > .directory-information-frame {
        margin-bottom: var(--app-content-gap);
    }
}

.directory-information-frame .page-heading {
    align-items: flex-end;
    margin-bottom: 0;
}

.directory-heading-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}

.task-filter-form {
    margin: 0;
}

.task-due-filter {
    width: auto;
    min-width: 190px;
    min-height: 44px;
    border-color: var(--app-border);
    border-radius: 8px;
    background-color: #ffffff;
    color: var(--app-text-secondary);
    font-weight: 700;
}

.task-category-directory-table {
    min-width: 800px;
}

.task-category-publication-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.vendor-publication-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.task-category-publication-switch,
.vendor-publication-switch,
.task-completion-switch {
    min-height: 0;
    margin: 0;
}

.task-category-publication-switch .form-check-input,
.vendor-publication-switch .form-check-input,
.task-completion-switch .form-check-input {
    margin-top: 0;
    cursor: pointer;
}

.task-category-edit-publication,
.task-edit-completion {
    min-width: 120px;
}

.task-category-edit-publication .task-category-publication-switch,
.task-edit-completion .task-completion-switch {
    display: flex;
    align-items: center;
    min-height: 42px;
}

.app-form .task-edit-completion > .form-label {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--app-text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
}

.task-category-description,
.directory-muted {
    color: var(--app-muted);
    font-size: 0.86rem;
}

.visit-type-directory {
    margin-top: var(--app-content-gap);
}

.visit-type-work-item .directory-avatar {
    font-size: 1.35rem;
}

.visit-type-description {
    max-width: 760px;
    margin: 0;
    color: var(--app-text-secondary);
    font-size: 0.87rem;
    line-height: 1.52;
}

.task-directory-related-user {
    max-width: 440px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--app-primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.task-directory-related-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-directory-related-user:hover,
.task-directory-related-user:focus-visible {
    color: var(--app-primary);
    text-decoration: underline;
}

.task-identity-details {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.task-identity-details small {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.task-category-description {
    max-width: 520px;
}

.task-card-directory {
    min-width: 0;
    margin-top: var(--app-content-gap);
}

.task-list-toolbar {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    margin-bottom: var(--app-content-gap);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.task-list-toolbar-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--app-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.task-list-toolbar-label .ti {
    color: var(--app-primary-dark);
    font-size: 1rem;
}

.task-sort-links {
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.task-sort-links a {
    flex: 0 0 auto;
    justify-content: center;
    line-height: 1;
}

.task-sort-links .task-sort-button {
    min-height: 38px;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-button-border-radius);
    font-size: 0.79rem;
    font-weight: 750;
}

.task-sort-links a.asc::after {
    content: "\2191";
}

.task-sort-links a.desc::after {
    content: "\2193";
}

.task-card-list {
    min-width: 0;
    display: grid;
    gap: var(--app-content-gap);
}

.task-row-card {
    min-width: 0;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 20px;
    align-items: start;
    padding: 20px 22px;
    overflow: hidden;
    border: 1px solid rgb(32 40 58 / 8%);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.task-row-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--app-primary);
    content: "";
}

.task-row-card:hover {
    border-color: color-mix(in srgb, var(--app-primary) 32%, var(--app-border));
    box-shadow: var(--app-surface-shadow-hover);
    transform: translateY(-1px);
}

.task-row-card:focus-within {
    border-color: var(--app-primary);
    box-shadow: var(--app-surface-shadow);
    outline: 3px solid rgb(var(--app-primary-hover-rgb) / 16%);
    outline-offset: 2px;
}

.task-row-card-main {
    min-width: 0;
}

.task-row-card-context {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 10px;
}

.task-row-category {
    flex: 0 0 auto;
}

.task-row-category--empty {
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.task-row-card-context .task-directory-related-user {
    min-width: 0;
    max-width: 100%;
}

.task-row-card-title {
    margin: 9px 0 5px;
    color: var(--app-text);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.3;
}

.task-row-card-title a {
    color: inherit;
    text-decoration: none;
}

.task-row-card-title a:hover,
.task-row-card-title a:focus-visible {
    color: var(--app-primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.task-row-card-description {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--app-text-secondary);
    font-size: 0.86rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.task-row-card-description--empty {
    color: var(--app-muted);
    font-style: italic;
}

.task-row-card-dates {
    min-width: 0;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 0 0;
    margin: 0;
    border-top: 1px solid color-mix(in srgb, var(--app-border) 72%, transparent);
}

.task-row-card-date {
    min-width: 0;
}

.task-row-card-date dt,
.task-row-card-label {
    display: block;
    margin-bottom: 6px;
    color: var(--app-muted);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.2;
    text-transform: uppercase;
}

.task-row-card-date dd {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0;
    color: var(--app-text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
}

.task-row-card-date dd .ti {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--app-primary-dark);
    font-size: 0.95rem;
}

.task-row-card-date time {
    min-width: 0;
}

.task-row-card-people {
    min-width: 0;
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--app-border) 72%, transparent);
}

.task-row-card-person {
    min-width: 0;
}

.task-row-card-person .directory-person {
    min-width: 0;
    gap: 9px;
}

.task-row-card-person .directory-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 0.7rem;
}

.task-row-card-person .task-identity-details strong,
.task-row-card-person .task-identity-details small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-row-card-person .task-identity-details strong {
    color: var(--app-text-secondary);
    font-size: 0.8rem;
}

.task-row-card-actions {
    align-self: start;
}

.task-card-empty {
    display: grid;
    justify-items: center;
    padding: clamp(42px, 8vw, 72px) 24px;
    border: 1px solid rgb(32 40 58 / 8%);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
    text-align: center;
}

.task-card-empty-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--app-primary) 13%, var(--app-surface));
    color: var(--app-primary-dark);
    font-size: 1.35rem;
}

.task-card-empty h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 800;
}

.task-card-empty p {
    margin: 0;
    color: var(--app-muted);
}

.task-card-directory > .directory-pagination {
    margin-top: var(--app-content-gap);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

@media (min-width: 768px) {
    .task-row-card {
        grid-template-columns: minmax(190px, 0.7fr) minmax(280px, 1.3fr) auto;
    }

    .task-row-card-main {
        grid-column: 1 / 3;
    }

    .task-row-card-dates {
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: 1fr;
    }

    .task-row-card-people {
        grid-column: 2;
        grid-row: 2;
    }

    .task-row-card-actions {
        grid-column: 3;
        grid-row: 1;
    }
}

@media (min-width: 1200px) {
    .task-row-card {
        grid-template-columns: minmax(280px, 1.35fr) minmax(160px, 0.62fr) minmax(220px, 0.85fr) auto;
        align-items: center;
    }

    .task-row-card-main,
    .task-row-card-dates,
    .task-row-card-people,
    .task-row-card-actions {
        grid-row: 1;
    }

    .task-row-card-main {
        grid-column: 1;
    }

    .task-row-card-dates {
        grid-column: 2;
    }

    .task-row-card-people {
        grid-column: 3;
    }

    .task-row-card-dates,
    .task-row-card-people {
        padding: 0 0 0 18px;
        border-top: 0;
        border-left: 1px solid color-mix(in srgb, var(--app-border) 72%, transparent);
    }

    .task-row-card-actions {
        grid-column: 4;
        align-self: center;
    }
}

@media (max-width: 575.98px) {
    .task-list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .task-row-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 18px;
    }

    .task-row-card-main,
    .task-row-card-dates,
    .task-row-card-people,
    .task-row-card-actions {
        grid-column: 1;
        grid-row: auto;
    }

    .task-row-card-people {
        grid-template-columns: 1fr;
    }

    .task-row-card-actions {
        justify-content: flex-end;
        padding-top: 14px;
        border-top: 1px solid color-mix(in srgb, var(--app-border) 72%, transparent);
    }
}

.task-status-incomplete .status-dot {
    background: var(--app-blue);
}

.task-status-completed .status-dot {
    background: var(--app-green);
}

.task-edit-summary-title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.task-edit-summary-heading .patient-edit-summary-label,
.task-edit-summary-details > div > span:first-child {
    color: var(--app-primary-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.task-edit-summary-details > .task-edit-summary-identity {
    padding-bottom: 15px;
    border-bottom: 1px solid var(--app-border);
}

.task-edit-summary-details > .task-edit-summary-related-user {
    padding-bottom: 15px;
    border-bottom: 1px solid var(--app-border);
}

.task-edit-summary-status {
    margin-top: 16px;
}

.patient-edit-summary .task-edit-summary-heading > .task-edit-summary-title {
    color: var(--app-text);
}

.directory-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    overflow-x: auto;
    border-top: 1px solid #dcebea;
    border-radius: 0 0 8px 8px;
    background: #ffffff;
}

.directory-pagination .directory-table-meta {
    margin: 0;
    text-align: center;
}

.directory-pagination .pagination {
    flex-wrap: nowrap;
    gap: 6px;
}

.directory-pagination .page-link {
    min-width: 38px;
    padding: 7px 11px;
    border: 1px solid var(--app-border);
    border-radius: 999px !important;
    background: #ffffff;
    color: var(--app-primary-dark);
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 1px 2px rgb(23 59 58 / 4%);
}

.directory-pagination .page-number .page-link {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50% !important;
}

.directory-pagination .page-prev .page-link,
.directory-pagination .page-next .page-link {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50% !important;
}

.directory-pagination .page-link:hover,
.directory-pagination .page-link:focus-visible {
    border-color: #a7c8c4;
    background: #edf7f5;
    color: var(--app-primary-dark);
}

.directory-pagination .active > .page-link {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #ffffff;
}

.directory-pagination .disabled > .page-link {
    border-color: #d7e7e5;
    background: #eff6f5;
    color: var(--app-sidebar-muted);
    box-shadow: none;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.panel-heading p {
    margin: 4px 0 0;
    font-size: 0.92rem;
}

.pipeline-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: var(--app-content-gap);
    overflow-x: auto;
    padding-bottom: 4px;
}

.pipeline-column {
    min-height: 230px;
    padding: 12px;
    border: 1px solid #dcebea;
    border-radius: 8px;
    background: #f2f8f7;
}

.pipeline-title {
    margin-bottom: 10px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--app-text-secondary);
    text-transform: uppercase;
}

.pipeline-item {
    min-height: 54px;
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #ffffff;
    font-weight: 650;
}

.learning-list,
.build-list,
.status-stack {
    display: grid;
    gap: var(--app-content-gap);
}

.toggle-list {
    display: grid;
    gap: 12px;
    margin-bottom: var(--app-content-gap);
}

.learning-row,
.build-row,
.status-row,
.status-details div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #f4f9f8;
}

.learning-row {
    align-items: flex-start;
    flex-direction: column;
}

.learning-row:nth-child(1) {
    border-color: #cfcef2;
    background: #f3f1fb;
}

.learning-row:nth-child(2) {
    border-color: #b9dcf0;
    background: #eef7fb;
}

.form-check-input {
    border-color: #a7c8c4;
}

.input.checkbox,
.input.radio {
    margin: 0;
}

/* Global form choices: Cake controls and Bootstrap form checks, excluding switches. */
.input.checkbox > label:has(> input[type="checkbox"]),
.input.radio > label:has(> input[type="radio"]),
.form-check:not(.form-switch) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-block: 7px;
    color: var(--app-text-secondary);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.35;
    cursor: pointer;
    user-select: none;
}

:is(.input.checkbox, .input.radio, .form-check:not(.form-switch)) input:is(
    [type="checkbox"],
    [type="radio"]
) {
    --app-choice-accent: var(--app-primary);

    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    float: none;
    margin: 0;
    appearance: none;
    border: 1px solid var(--app-border);
    background-color: #ffffff;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: none;
    cursor: pointer;
    transition:
        border-color 140ms ease,
        background-color 140ms ease,
        box-shadow 140ms ease,
        transform 140ms ease;
}

:is(.input.checkbox, .form-check:not(.form-switch)) input[type="checkbox"] {
    border-radius: 7px;
}

:is(.input.radio, .form-check:not(.form-switch)) input[type="radio"] {
    border-radius: 50%;
}

:is(.input.checkbox, .input.radio, .form-check:not(.form-switch)) input:is(
    [type="checkbox"],
    [type="radio"]
):hover:not(:disabled) {
    border-color: var(--app-choice-accent);
    background-color: #ffffff;
    box-shadow: none;
}

:is(.input.checkbox, .input.radio, .form-check:not(.form-switch)) input:is(
    [type="checkbox"],
    [type="radio"]
):checked {
    border-color: var(--app-choice-accent);
    background-color: var(--app-choice-accent);
    box-shadow: 0 3px 8px rgb(var(--app-primary-rgb) / 18%);
}

:is(.input.checkbox, .input.radio, .form-check:not(.form-switch)) input:is(
    [type="checkbox"],
    [type="radio"]
):checked:hover:not(:disabled) {
    border-color: var(--app-primary-hover);
    background-color: var(--app-primary-hover);
}

:is(.input.checkbox, .form-check:not(.form-switch)) input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8.5 6.5 12 13 4.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 16px 16px;
}

:is(.input.radio, .form-check:not(.form-switch)) input[type="radio"]:checked {
    background-image: radial-gradient(circle, #ffffff 0 30%, transparent 34%);
    background-size: 100% 100%;
}

:is(.input.checkbox, .input.radio, .form-check:not(.form-switch)) input:is(
    [type="checkbox"],
    [type="radio"]
):focus-visible {
    outline: 2px solid var(--app-choice-accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgb(var(--app-primary-hover-rgb) / 13%);
}

:is(.input.checkbox, .input.radio, .form-check:not(.form-switch)) input:is(
    [type="checkbox"],
    [type="radio"]
):active:not(:disabled) {
    transform: scale(0.94);
}

.input.checkbox > label:has(> input[type="checkbox"]:disabled),
.input.radio > label:has(> input[type="radio"]:disabled),
.form-check:not(.form-switch):has(input:disabled) {
    color: var(--app-muted);
    cursor: not-allowed;
}

:is(.input.checkbox, .input.radio, .form-check:not(.form-switch)) input:is(
    [type="checkbox"],
    [type="radio"]
):disabled {
    border-color: color-mix(in srgb, var(--app-muted) 30%, var(--app-border));
    background-color: var(--bs-secondary-bg, #e9ecef);
    box-shadow: none;
    cursor: not-allowed;
}

.form-switch {
    --app-switch-accent: #c96832;
    --app-switch-border: #dfa77f;
    --app-switch-off-background: #f9e8dc;

    padding-left: 3.25rem;
}

/* Optional variants: orange, primary/teal, blue, green, amber, red, violet, or coral. */
.form-switch[data-switch-color] {
    --app-switch-border: color-mix(in srgb, var(--app-switch-accent) 48%, #ffffff);
    --app-switch-off-background: color-mix(in srgb, var(--app-switch-accent) 14%, #ffffff);
}

.form-switch[data-switch-color="orange"] {
    --app-switch-accent: #c96832;
}

.form-switch[data-switch-color="teal"],
.form-switch[data-switch-color="primary"] {
    --app-switch-accent: var(--app-primary-dark);
}

.form-switch[data-switch-color="blue"] {
    --app-switch-accent: var(--app-blue);
}

.form-switch[data-switch-color="green"] {
    --app-switch-accent: var(--app-green);
}

.form-switch[data-switch-color="amber"] {
    --app-switch-accent: var(--app-amber);
}

.form-switch[data-switch-color="red"] {
    --app-switch-accent: var(--app-red);
}

.form-switch[data-switch-color="violet"] {
    --app-switch-accent: var(--app-violet-accent);
}

.form-switch[data-switch-color="coral"] {
    --app-switch-accent: var(--app-coral-accent);
}

.form-switch .form-check-input {
    width: 44px;
    height: 22px;
    margin-top: 0;
    margin-left: -3.25rem;
    border-radius: 11px;
    border-color: var(--app-switch-border);
    background-color: var(--app-switch-off-background);
    background-image: radial-gradient(circle, var(--app-switch-accent) 0 68%, transparent 72%);
    background-position: left center;
    background-size: 20px 20px;
    transform: translateY(2px);
}

.form-switch .form-check-input:checked {
    border-color: var(--app-switch-accent);
    background-color: var(--app-switch-accent);
    background-image: radial-gradient(circle, #ffffff 0 68%, transparent 72%);
}

.form-switch .form-check-input:focus {
    border-color: var(--app-switch-accent);
    background-image: radial-gradient(circle, var(--app-switch-accent) 0 68%, transparent 72%);
    box-shadow: none;
}

.form-switch .form-check-input:checked:focus {
    background-image: radial-gradient(circle, #ffffff 0 68%, transparent 72%);
}

.form-switch .form-check-input:focus-visible {
    outline: 2px solid var(--app-switch-accent);
    outline-offset: 2px;
}

.system-status-badge-connected {
    border: 1px solid #397d68;
    background: #397d68;
    color: #ffffff;
}

.build-list {
    margin-top: 14px;
}

.status-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--app-muted);
}

.status-dot-success {
    background: var(--app-green);
}

.status-dot-danger {
    background: var(--app-red);
}

.status-details {
    display: grid;
    gap: 10px;
    margin: 0;
}

.status-details dt {
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-details dd {
    margin: 0;
    font-weight: 700;
}

.htmx-request {
    opacity: 0.68;
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-hover);
    --bs-btn-hover-border-color: var(--app-primary-hover);
    --bs-btn-hover-color: var(--app-primary-hover-foreground);
    --bs-btn-focus-shadow-rgb: var(--app-primary-hover-rgb);
    --bs-btn-active-bg: var(--app-primary-hover);
    --bs-btn-active-border-color: var(--app-primary-hover);
    --bs-btn-active-color: var(--app-primary-hover-foreground);
}

.btn-primary:focus-visible {
    border-color: var(--app-primary-hover);
    background: var(--app-primary-hover);
    color: var(--app-primary-hover-foreground);
}

.btn-app-warning {
    --bs-btn-color: color-mix(in srgb, var(--app-amber) 80%, var(--app-text));
    --bs-btn-bg: color-mix(in srgb, var(--app-amber) 28%, var(--app-surface));
    --bs-btn-border-color: color-mix(in srgb, var(--app-amber) 40%, var(--app-surface));
    --bs-btn-hover-color: color-mix(in srgb, var(--app-amber) 74%, var(--app-text));
    --bs-btn-hover-bg: color-mix(in srgb, var(--app-amber) 34%, var(--app-surface));
    --bs-btn-hover-border-color: color-mix(in srgb, var(--app-amber) 48%, var(--app-surface));
    --bs-btn-active-color: color-mix(in srgb, var(--app-amber) 74%, var(--app-text));
    --bs-btn-active-bg: color-mix(in srgb, var(--app-amber) 38%, var(--app-surface));
    --bs-btn-active-border-color: color-mix(in srgb, var(--app-amber) 52%, var(--app-surface));
}

.btn-app-warning:focus-visible {
    border-color: color-mix(in srgb, var(--app-amber) 52%, var(--app-surface));
    background: color-mix(in srgb, var(--app-amber) 34%, var(--app-surface));
    color: color-mix(in srgb, var(--app-amber) 74%, var(--app-text));
    box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--app-amber) 28%, transparent);
}

.btn-outline-danger {
    --bs-btn-color: var(--app-red);
    --bs-btn-bg: color-mix(in srgb, var(--app-coral-accent) 8%, var(--app-surface));
    --bs-btn-border-color: color-mix(in srgb, var(--app-red) 34%, var(--app-border));
    --bs-btn-hover-color: color-mix(in srgb, var(--app-red) 88%, var(--app-text));
    --bs-btn-hover-bg: color-mix(in srgb, var(--app-coral-accent) 20%, var(--app-surface));
    --bs-btn-hover-border-color: color-mix(in srgb, var(--app-red) 48%, var(--app-border));
    --bs-btn-active-color: color-mix(in srgb, var(--app-red) 84%, var(--app-text));
    --bs-btn-active-bg: color-mix(in srgb, var(--app-coral-accent) 26%, var(--app-surface));
    --bs-btn-active-border-color: color-mix(in srgb, var(--app-red) 54%, var(--app-border));
}

.btn-outline-danger:focus-visible {
    border-color: color-mix(in srgb, var(--app-red) 48%, var(--app-border));
    background: color-mix(in srgb, var(--app-coral-accent) 20%, var(--app-surface));
    color: color-mix(in srgb, var(--app-red) 88%, var(--app-text));
    box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--app-coral-accent) 24%, transparent);
}

.btn-danger {
    --bs-btn-color: #ffffff;
    --bs-btn-bg: var(--app-red);
    --bs-btn-border-color: var(--app-red);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: color-mix(in srgb, var(--app-red) 82%, var(--app-text));
    --bs-btn-hover-border-color: color-mix(in srgb, var(--app-red) 82%, var(--app-text));
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: color-mix(in srgb, var(--app-red) 76%, var(--app-text));
    --bs-btn-active-border-color: color-mix(in srgb, var(--app-red) 76%, var(--app-text));
}

.btn-danger:focus-visible {
    border-color: color-mix(in srgb, var(--app-red) 82%, var(--app-text));
    background: color-mix(in srgb, var(--app-red) 82%, var(--app-text));
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--app-coral-accent) 28%, transparent);
}

.btn {
    --bs-btn-border-radius: var(--app-button-border-radius);
}

@media (min-width: 640px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .auth-access-card {
        padding: 28px 24px;
    }

    .auth-access-links {
        text-align: center;
    }
}

/* Application visual system. */

.app-sidebar {
    border-right: 0;
    background: var(--app-sidebar);
    color: #f8fafc;
    box-shadow: var(--app-surface-shadow);
}

.app-brand {
    position: sticky;
    z-index: 1;
    top: -24px;
    margin: -24px -18px 18px;
    padding: 24px 18px 18px;
    border-bottom: 1px solid rgb(255 255 255 / 10%);
    background: var(--app-sidebar);
}

.app-nav {
    gap: 7px;
}

.app-nav-link {
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--app-nav-foreground);
}

.app-nav-link:hover,
.app-nav-link.has-flyout-hover {
    border-color: rgb(255 255 255 / 8%);
    background: var(--app-nav-hover-background);
    color: var(--app-nav-active-foreground);
}

.app-nav-link.active {
    background: var(--app-primary);
    color: var(--app-nav-active-foreground);
}

.app-nav-link .ti {
    color: var(--app-nav-icon);
}

.app-topbar {
    border-color: rgb(255 255 255 / 10%);
    background: var(--app-chrome-background);
    box-shadow: var(--app-surface-shadow);
    backdrop-filter: none;
}

.page-heading h1 {
    letter-spacing: -0.035em;
}

.metric-card,
.dashboard-panel,
.directory-card,
.page-heading {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-color: rgb(32 40 58 / 8%);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.page-heading {
    position: relative;
    overflow: hidden;
}

.directory-card > .table-responsive {
    width: 100%;
    max-width: 100%;
    overscroll-behavior-x: none;
    overscroll-behavior-inline: none;
}

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 21px;
}

.metric-card::after,
.page-heading::after {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--app-primary);
    content: "";
}

.metric-card--pipeline::after {
    background: var(--app-blue);
}

.metric-card--learning::after {
    background: var(--app-sage-accent);
}

.metric-card--workflow::after {
    background: var(--app-coral-accent);
}

.metric-card strong {
    color: var(--app-text);
    letter-spacing: -0.04em;
}

.directory-table > :not(caption) > * > * {
    border-bottom-color: #dcebea;
}

.directory-table thead th {
    color: #f7f4ee;
    background: #26344d;
}

.directory-table thead a:hover,
.directory-table thead a:focus-visible {
    color: #9fe3dc;
}

.table tbody tr:hover > * {
    background-color: #fff2ed;
}

.directory-role-badge {
    border-color: #cbd8e8;
    background: #eaf1f8;
    color: #315b89;
}

.pipeline-column {
    border-color: var(--app-panel-neutral-border);
    background: var(--app-panel-neutral-background);
}

.pipeline-column:nth-child(2) {
    border-color: var(--app-panel-blue-border);
    background: var(--app-panel-blue-background);
}

.pipeline-column:nth-child(3) {
    border-color: var(--app-panel-green-border);
    background: var(--app-panel-green-background);
}

.pipeline-column:nth-child(4) {
    border-color: var(--app-panel-amber-border);
    background: var(--app-panel-amber-background);
}

.pipeline-item {
    border-color: rgb(32 40 58 / 9%);
    border-radius: 10px;
    background: #fffdf9;
    box-shadow: var(--app-surface-shadow);
}

.learning-row,
.build-row,
.status-row,
.status-details div {
    border-color: #e2dcd1;
    border-radius: 10px;
    background: #faf7f1;
}

.learning-row:nth-child(1) {
    border-color: #d4dfeb;
    background: #edf3f8;
}

.learning-row:nth-child(2) {
    border-color: #e8d6bf;
    background: #fbf2e5;
}

.system-status-badge-connected {
    border-color: #4f7d68;
    background: #4f7d68;
}

@media (min-width: 992px) {
    .app-content {
        padding: 36px 32px 56px;
    }
}

@media (min-width: 992px) {
    .app-shell:not(.auth-shell) {
        display: grid;
        grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
        grid-template-rows: var(--app-topbar-height) minmax(0, 1fr);
        transition: grid-template-columns 160ms ease;
    }

    .app-shell:not(.auth-shell).sidebar-collapsed,
    html.sidebar-collapsed-preload .app-shell:not(.auth-shell) {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    .app-shell:not(.auth-shell) .app-chrome {
        grid-column: 1 / -1;
        grid-row: 1 / -1;
        display: grid;
        grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
        grid-template-rows: var(--app-topbar-height) minmax(0, 1fr);
        pointer-events: none;
        transition: grid-template-columns 160ms ease;
    }

    .app-shell:not(.auth-shell).sidebar-collapsed .app-chrome,
    html.sidebar-collapsed-preload .app-shell:not(.auth-shell) .app-chrome {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    .app-shell:not(.auth-shell) .app-topbar {
        grid-column: 2;
        grid-row: 1;
        pointer-events: auto;
    }

    .app-drawer-md {
        --app-drawer-max-width: clamp(600px, 34vw, 760px);
    }

    .app-shell:not(.auth-shell) .app-sidebar {
        grid-column: 1;
        grid-row: 1 / -1;
        height: auto;
        min-height: 100vh;
        position: relative;
        top: auto;
        align-self: start;
        display: flex;
        flex-direction: column;
        transform: none;
        overflow: visible;
        pointer-events: auto;
        transition:
            width 160ms ease,
            padding 160ms ease,
            transform 160ms ease;
    }

    .app-shell:not(.auth-shell) .app-sidebar.is-collapsed,
    html.sidebar-collapsed-preload .app-shell:not(.auth-shell) .app-sidebar {
        width: 0;
        padding-right: 0;
        padding-left: 0;
        border-right: 0;
        transform: translateX(-100%);
    }

    .app-shell:not(.auth-shell) .app-main {
        grid-column: 2;
        grid-row: 2;
        width: auto;
    }

    .app-content {
        padding: 34px 32px 56px;
    }
}

@media (min-width: 1320px) {
    .directory-card,
    .directory-card > .table-responsive {
        overflow: visible;
    }
}

@media (min-width: 1200px) {
    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

body {
    background: var(--app-body-background);
}

.app-nav-link.active {
    background: var(--app-primary);
}

.metric-card::after {
    background: var(--app-primary);
}

.metric-card--pipeline::after {
    background: #287bb5;
}

.metric-card--learning::after {
    background: var(--app-sage-accent);
}

.metric-card--workflow::after {
    background: var(--app-coral-accent);
}

.directory-table thead th {
    background: var(--app-chrome-background);
}

/* Cover WebKit subpixel seams without casting horizontal cell shadows. */
.directory-table thead th:not(:last-child) {
    border-right: 1px solid var(--app-chrome-background);
}

.table tbody tr:hover > * {
    background: #eaf8f6;
}

.directory-role-badge {
    border-color: #b9dfda;
    background: #e2f5f2;
    color: #0b6b66;
}

.app-shell:not(.auth-shell)::before {
    position: fixed;
    z-index: 1039;
    inset: 0 0 auto;
    height: var(--app-chrome-inset);
    background: var(--app-body-background);
    content: "";
}

@media (min-width: 992px) {
    .app-shell:not(.auth-shell)::before {
        z-index: 1049;
        pointer-events: none;
    }

    .directory-card {
        --directory-heading-height: calc(51px + 1.14rem);
        position: relative;
        margin-top: var(--app-content-gap);
        border: 0;
        background: transparent;
    }

    .directory-card::before {
        position: absolute;
        z-index: 10;
        top: var(--directory-heading-height);
        right: 0;
        bottom: 0;
        left: 0;
        border: 1px solid var(--app-border);
        border-top: 0;
        border-radius: 0 0 14px 14px;
        content: "";
        pointer-events: none;
    }

    .directory-card:not(:has(.directory-pagination)) .directory-table tbody tr:last-child > :first-child {
        border-bottom-left-radius: 14px;
    }

    .directory-card:not(:has(.directory-pagination)) .directory-table tbody tr:last-child > :last-child {
        border-bottom-right-radius: 14px;
    }

    .directory-pagination {
        border-radius: 0 0 14px 14px;
    }

    .app-shell:not(.auth-shell) {
        grid-template-columns: 280px minmax(0, 1fr);
        grid-template-rows: 78px minmax(0, 1fr);
    }

    .app-shell:not(.auth-shell) .app-chrome {
        height: calc(100vh - var(--app-chrome-inset) - var(--app-chrome-inset));
        position: sticky;
        z-index: 1050;
        top: var(--app-chrome-inset);
        align-self: start;
        grid-template-columns: 280px minmax(0, 1fr);
        grid-template-rows: var(--app-desktop-topbar-height) minmax(0, 1fr);
    }

    .app-shell:not(.auth-shell) .app-sidebar {
        width: 248px;
        height: 100%;
        min-height: 0;
        margin: 0 var(--app-chrome-inset);
        position: relative;
        z-index: auto;
        inset: auto;
        align-self: start;
        border-radius: 14px;
    }

    .app-shell:not(.auth-shell) .app-brand {
        height: 88px;
        flex: 0 0 88px;
        position: relative;
        top: auto;
        overflow: hidden;
        border-radius: 14px 14px 0 0;
    }

    .app-shell:not(.auth-shell) .app-nav {
        position: static;
        min-height: 0;
        flex: 1 1 auto;
        margin-inline: -18px;
        padding-inline: 18px;
        align-content: start;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scrollbar-width: none;
    }

    .app-shell:not(.auth-shell) .app-nav::-webkit-scrollbar {
        display: none;
    }

    .app-shell:not(.auth-shell) .sidebar-foot {
        position: static;
        margin-top: auto;
        padding-top: 24px;
    }

    .app-shell:not(.auth-shell).sidebar-collapsed,
    html.sidebar-collapsed-preload .app-shell:not(.auth-shell) {
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .app-shell:not(.auth-shell).sidebar-collapsed .app-chrome,
    html.sidebar-collapsed-preload .app-shell:not(.auth-shell) .app-chrome {
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .app-shell:not(.auth-shell) .app-sidebar.is-collapsed,
    html.sidebar-collapsed-preload .app-shell:not(.auth-shell) .app-sidebar {
        width: 80px;
        padding: 24px 18px;
        border-right: 0;
        transform: none;
    }

    .app-sidebar.is-collapsed .app-brand,
    html.sidebar-collapsed-preload .app-sidebar .app-brand {
        justify-content: center;
        margin: -24px -18px 18px;
        padding: 24px 18px 18px;
    }

    .app-sidebar.is-collapsed .app-nav-link > span,
    .app-sidebar.is-collapsed .sidebar-foot > span:last-child,
    html.sidebar-collapsed-preload .app-sidebar .app-nav-link > span,
    html.sidebar-collapsed-preload .app-sidebar .sidebar-foot > span:last-child {
        display: none;
    }

    .app-sidebar.is-collapsed .app-brand-logo-link,
    html.sidebar-collapsed-preload .app-sidebar .app-brand-logo-link {
        width: 44px;
        flex-basis: 44px;
    }

    .app-sidebar.is-collapsed .app-brand-logo,
    html.sidebar-collapsed-preload .app-sidebar .app-brand-logo {
        left: -16px;
    }

    .app-sidebar.is-collapsed .app-nav-link,
    html.sidebar-collapsed-preload .app-sidebar .app-nav-link {
        min-height: 50px;
        justify-content: center;
        padding: 10px;
        border-radius: 12px;
    }

    .app-sidebar.is-collapsed .app-nav-link .ti,
    html.sidebar-collapsed-preload .app-sidebar .app-nav-link .ti {
        width: auto;
        flex-basis: auto;
        font-size: 1.35rem;
    }

    .app-sidebar.is-collapsed .sidebar-foot,
    html.sidebar-collapsed-preload .app-sidebar .sidebar-foot {
        justify-content: center;
    }

    .app-shell:not(.auth-shell) .app-topbar {
        width: auto;
        height: var(--app-desktop-topbar-height);
        margin: 0 20px 4px 8px;
        position: relative;
        top: auto;
        border: 1px solid rgb(255 255 255 / 10%);
        border-radius: 14px;
        background: var(--app-chrome-background);
        box-shadow: var(--app-surface-shadow);
        backdrop-filter: none;
    }

    .app-shell:not(.auth-shell) .app-main {
        margin-left: 8px;
    }

    .app-content {
        padding: 12px 34px 16px 14px;
    }
}

@media (min-width: 1320px) {
    .directory-card > .table-responsive::before {
        position: sticky;
        z-index: var(--app-z-sticky-mask);
        top: var(--app-desktop-topbar-bottom);
        height: calc(var(--app-content-gap) + var(--directory-heading-height));
        display: block;
        margin-top: calc(0px - var(--app-content-gap));
        margin-bottom: calc(0px - var(--directory-heading-height));
        background: var(--app-body-background);
        box-shadow: 0 0 0 100vmax var(--app-body-background);
        clip-path: inset(0 -100vmax);
        content: "";
        pointer-events: none;
    }

    .directory-table thead {
        position: sticky;
        z-index: var(--app-z-sticky-heading);
        top: var(--app-sticky-content-top);
        box-shadow: var(--app-surface-shadow);
    }

    .directory-table thead th {
        position: relative;
        z-index: var(--app-z-sticky-surface);
        top: auto;
    }
}

@media (max-width: 1319.98px) {
    .directory-table thead th {
        position: static;
        top: auto;
    }
}

@media (max-width: 991.98px) {
    .app-shell:not(.auth-shell)::before {
        z-index: 1029;
    }

    .app-shell:not(.auth-shell) .app-main {
        padding-top: calc(
            var(--app-chrome-inset) + var(--app-desktop-topbar-height) + var(--app-chrome-inset)
        );
    }

    .app-content {
        padding-top: 0;
        padding-right: 30px;
        padding-left: 30px;
    }

    .app-shell:not(.auth-shell) .app-topbar {
        width: auto;
        height: var(--app-desktop-topbar-height);
        flex-basis: var(--app-desktop-topbar-height);
        right: var(--app-chrome-inset);
        left: var(--app-chrome-inset);
        margin: 0;
        position: fixed;
        top: var(--app-chrome-inset);
        border: 1px solid rgb(255 255 255 / 10%);
        border-radius: 14px;
        background: var(--app-chrome-background);
        box-shadow: none;
        backdrop-filter: none;
    }

    .app-shell:not(.auth-shell) .app-sidebar {
        width: min(280px, calc(100vw - var(--app-chrome-inset) - var(--app-chrome-inset)));
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        inset: var(--app-sticky-content-top) auto var(--app-chrome-inset) var(--app-chrome-inset);
        overflow-y: auto;
        border-right: 0;
        border-radius: 14px;
        transform: translateX(calc(-100% - var(--app-chrome-inset) - var(--app-chrome-inset)));
    }

    .app-shell:not(.auth-shell) .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-shell:not(.auth-shell) .sidebar-foot {
        position: static;
        margin-top: auto;
        padding-top: 24px;
    }

    .app-backdrop {
        inset: 0;
    }

}

@media (max-width: 600px) {
    .app-shell:not(.auth-shell) .app-sidebar {
        width: auto;
        right: var(--app-chrome-inset);
    }
}

.directory-pagination {
    border-top-color: color-mix(in srgb, var(--app-primary) 16%, var(--app-border));
    background: #ffffff;
}

.directory-pagination .page-link {
    border-color: var(--app-border);
    background: var(--app-surface);
    color: var(--app-primary-dark);
    box-shadow: 0 3px 5px -4px color-mix(in srgb, var(--app-text) 68%, transparent);
}

.directory-pagination .page-link:hover,
.directory-pagination .page-link:focus-visible {
    border-color: color-mix(in srgb, var(--app-primary) 38%, var(--app-border));
    background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
    color: var(--app-primary-dark);
}

.directory-pagination .active > .page-link {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: var(--app-primary-hover-foreground);
}

.directory-pagination .disabled > .page-link {
    border-color: var(--app-border);
    background: color-mix(in srgb, var(--app-muted) 7%, var(--app-surface));
    color: var(--app-muted);
}

/* Shared edit workspace. */
.edit-workspace-heading-frame {
    z-index: var(--app-z-sticky-heading);
    margin-bottom: var(--app-content-gap);
}

.patient-edit-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 0;
}

.patient-edit-heading h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.patient-edit-heading-actions,
.app-edit-footer > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-save-button {
    white-space: nowrap;
}

.edit-workspace-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    align-items: start;
    gap: var(--app-content-gap);
}

.patient-edit-heading,
.patient-edit-summary,
.patient-edit-card {
    border: 1px solid rgb(32 40 58 / 8%);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.patient-edit-summary,
.patient-edit-card,
.app-edit-footer {
    --patient-card-accent: var(--app-primary);
}

.patient-edit-summary::before,
.patient-edit-card::before,
.app-edit-footer::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--patient-card-accent);
    content: "";
}

.patient-edit-summary {
    --patient-card-accent: var(--app-coral-accent);
    min-height: 100%;
    height: auto;
    position: relative;
    overflow: hidden;
    padding: 25px;
}

.edit-workspace-summary-frame {
    grid-column: 2;
    grid-row: 1;
    min-height: calc(100vh - var(--app-sticky-content-top) - var(--app-content-gap));
    height: auto;
}

.edit-workspace-summary-frame.app-surface-frame--sticky::before {
    opacity: 0;
}

.edit-workspace-summary-frame.app-surface-frame--sticky.edit-workspace-summary-frame--stuck::before {
    opacity: 1;
}

.edit-workspace-summary-frame > .app-surface {
    min-height: 100%;
}

.edit-workspace-sections {
    grid-column: 1;
    grid-row: 1;
}

.edit-workspace-summary-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 19px;
    border-radius: 20px 8px 20px 8px;
    background: color-mix(in srgb, var(--app-primary) 18%, var(--app-surface));
    color: var(--app-primary-dark);
    font-size: 1.1rem;
    font-weight: 850;
}

.patient-edit-summary-label {
    margin: 0 0 4px;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.patient-edit-summary h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.patient-edit-summary > div > p:last-child {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    color: var(--app-muted);
    font-size: 0.88rem;
}

.patient-edit-summary-details {
    display: grid;
    gap: 15px;
    margin-top: 23px;
    padding-top: 20px;
    border-top: 1px solid var(--app-border);
}

.patient-edit-summary-details > div {
    display: grid;
    gap: 4px;
}

.patient-edit-summary-details > div > span:first-child {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-edit-summary-details strong {
    color: var(--app-text-secondary);
    font-size: 0.87rem;
    font-weight: 700;
}

.task-edit-summary-person {
    min-width: 0;
}

.task-edit-summary-person .task-identity-details {
    overflow: hidden;
}

.task-edit-summary-person .task-identity-details small {
    white-space: normal;
    overflow-wrap: anywhere;
}

.task-related-user-link {
    color: var(--app-text-secondary);
    font-size: 0.87rem;
    font-weight: 700;
    text-decoration: none;
}

.task-related-user-link:hover,
.task-related-user-link:focus-visible {
    color: var(--app-primary);
    text-decoration: underline;
}

.edit-workspace-sections {
    display: grid;
    gap: var(--app-content-gap);
}

.patient-edit-card {
    position: relative;
    overflow: hidden;
    padding: 25px;
}

.patient-edit-card--identity {
    --patient-card-accent: var(--app-teal-accent);
}

.patient-edit-card--blue {
    --patient-card-accent: var(--app-blue-accent);
}

.patient-edit-card--amber {
    --patient-card-accent: var(--app-amber-accent);
}

.patient-edit-card--emergency {
    --patient-card-accent: var(--app-blue-accent);
}

.patient-edit-card--care {
    --patient-card-accent: var(--app-amber-accent);
}

.patient-edit-card--pharmacy {
    --patient-card-accent: var(--app-sage-accent);
}

.patient-edit-card--tasks {
    --patient-card-accent: var(--app-violet-accent);
}

.patient-edit-card--history {
    --patient-card-accent: var(--app-blue-accent);
}

.app-details-list,
.appointment-details-list {
    min-width: 0;
}

.app-details-row,
.appointment-details-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(180px, 28%) minmax(0, 1fr);
}

.app-details-row + .app-details-row,
.appointment-details-row + .appointment-details-row {
    border-top: 1px solid var(--app-border);
}

.app-details-label,
.app-details-value,
.appointment-details-label,
.appointment-details-value {
    min-width: 0;
    padding: 12px 16px;
}

.app-details-label,
.appointment-details-label {
    padding-left: 0;
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-details-value,
.appointment-details-value {
    padding-right: 0;
    border-left: 1px solid var(--app-border);
    color: var(--app-text-secondary);
    font-size: 0.84rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.app-details-value a,
.appointment-details-value a {
    color: inherit;
}

.app-details-value a:hover,
.app-details-value a:focus-visible,
.appointment-details-value a:hover,
.appointment-details-value a:focus-visible {
    color: var(--app-primary-dark);
}

@media (max-width: 575.98px) {
    .app-details-row,
    .appointment-details-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
        padding-block: 12px;
    }

    .app-details-label,
    .app-details-value,
    .appointment-details-label,
    .appointment-details-value {
        padding: 0;
    }

    .app-details-value,
    .appointment-details-value {
        border-left: 0;
    }
}

.form-submission-audit-list {
    margin-top: 18px;
}

.form-submission-profile-change-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-submission-profile-change-cell {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 12px 16px;
}

.form-submission-profile-change-cell:first-child {
    padding-left: 0;
}

.form-submission-profile-change-cell + .form-submission-profile-change-cell {
    padding-right: 0;
    border-left: 1px solid var(--app-border);
}

.form-submission-profile-change-cell span {
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.form-submission-profile-change-cell strong {
    color: var(--app-text-secondary);
    font-size: 0.84rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.form-submission-notification-recipient {
    color: var(--app-text-secondary);
    font-size: 0.84rem;
    overflow-wrap: anywhere;
    text-transform: none;
}

.form-submission-notification-row {
    grid-template-columns: minmax(230px, 36%) minmax(0, 1fr);
}

.form-submission-notification-details {
    display: grid;
    gap: 3px;
    font-weight: 500;
}

.form-submission-notification-details strong {
    color: var(--app-text-secondary);
    font-weight: 800;
}

@media (max-width: 575.98px) {
    .form-submission-notification-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.patient-task-heading .app-section-heading-copy {
    flex: 1 1 auto;
}

.patient-task-heading-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.patient-task-counts {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.patient-task-counts > span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 6px 9px;
    border: 1px solid color-mix(in srgb, var(--app-border) 78%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-muted) 5%, var(--app-surface));
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 750;
    white-space: nowrap;
}

.patient-task-counts strong {
    color: var(--app-text-secondary);
    font-size: 0.8rem;
}

.patient-task-add {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.patient-task-list {
    display: grid;
    gap: 12px;
}

.app-data-row-status {
    width: 86px;
    height: 86px;
    aspect-ratio: 1;
    display: grid;
    flex: 0 0 86px;
    align-self: start;
    align-content: center;
    justify-items: center;
    gap: 5px;
    padding: 9px 7px;
    border-radius: 11px;
    background: color-mix(
        in srgb,
        var(--app-data-row-status-accent, var(--app-primary)) 10%,
        var(--app-surface)
    );
    color: var(--app-data-row-status-color, var(--app-primary-dark));
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.app-data-row-status > .ti,
.app-data-row-status-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.app-data-row-status-label {
    font: inherit;
}

.app-data-row-state-badge {
    background: var(--app-data-row-status-color, var(--app-primary-dark));
    color: color-mix(
        in srgb,
        var(--app-data-row-status-accent, var(--app-primary)) 10%,
        var(--app-surface)
    );
}

.patient-task-item {
    --patient-task-accent: var(--app-violet-accent);
    --patient-task-color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
    --app-data-row-status-accent: var(--patient-task-accent);
    --app-data-row-status-color: var(--patient-task-color);
    min-width: 0;
    position: relative;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    gap: 16px;
    padding: 16px 17px 16px 20px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--app-border) 76%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--patient-task-accent) 2.5%, var(--app-surface));
}

.patient-task-item::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--patient-task-accent);
    content: "";
}

.patient-task-item--overdue {
    --patient-task-accent: var(--app-coral-accent);
    --patient-task-color: var(--app-red);
}

.patient-task-item--today {
    --patient-task-accent: var(--app-blue-accent);
    --patient-task-color: var(--app-blue);
}

.patient-task-item--completed {
    --patient-task-accent: var(--app-primary);
    --patient-task-color: var(--app-primary-dark);
}

.patient-task-item--completed h3 a {
    color: var(--app-text-secondary);
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--patient-task-color) 50%, transparent);
}

.patient-task-main,
.patient-task-title-row > div {
    min-width: 0;
}

.patient-task-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.patient-task-title-row h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 820;
    line-height: 1.3;
}

.patient-task-title-row h3 a {
    color: var(--app-text);
    text-decoration: none;
}

.patient-task-title-row h3 a:hover,
.patient-task-title-row h3 a:focus-visible {
    color: var(--app-primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.patient-task-category {
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 750;
}

.patient-task-manage {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    flex: 0 0 auto;
}

.patient-task-main > p {
    display: -webkit-box;
    margin: 9px 0 0;
    overflow: hidden;
    color: var(--app-text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.patient-task-meta {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(170px, auto);
    gap: 12px 18px;
    align-items: center;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid color-mix(in srgb, var(--app-border) 70%, transparent);
}

.patient-task-assignee {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.patient-task-assignee .directory-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 0.66rem;
}

.patient-task-assignee > span:last-child,
.patient-task-meta > div:not(.patient-task-assignee) {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.patient-task-meta small {
    color: var(--app-muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    line-height: 1;
    text-transform: uppercase;
}

.patient-task-meta strong {
    min-width: 0;
    color: var(--app-text-secondary);
    font-size: 0.74rem;
    font-weight: 750;
    line-height: 1.35;
}

.patient-task-empty {
    min-height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    border: 1px dashed var(--app-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-muted) 4%, var(--app-surface));
    text-align: left;
}

.patient-task-empty > span {
    width: 44px;
    height: 44px;
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-violet-accent) 13%, var(--app-surface));
    color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
    font-size: 1.2rem;
}

.patient-task-empty h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
}

.patient-task-empty p {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 0.8rem;
}

.patient-edit-card .form-label {
    margin-bottom: 7px;
    color: var(--app-text-secondary);
    font-size: 0.78rem;
    font-weight: 750;
}

.app-form-section .form-control,
.app-form-section .form-select,
.cogniveon-rendered-form .form-control:not(.ms-parent),
.cogniveon-rendered-form .form-select:not(.ms-parent),
:where(.app-content form) :where(.input) > input:not(
    [type="checkbox"],
    [type="radio"],
    [type="hidden"],
    [type="file"],
    [type="submit"],
    [type="button"],
    [type="reset"]
),
:where(.app-content form) :where(.input) > select:not(.ms-offscreen),
:where(.app-content form) :where(.input) > textarea,
.patient-edit-card .form-control,
.patient-edit-card .form-select {
    width: 100%;
    min-height: 44px;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background-color: #ffffff;
    color: var(--app-text);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
}

.app-form-section .form-control::placeholder,
.cogniveon-rendered-form .form-control::placeholder,
:where(.app-content form) :where(.input) > input::placeholder,
:where(.app-content form) :where(.input) > textarea::placeholder,
.patient-edit-card .form-control::placeholder {
    color: var(--app-control-placeholder);
    opacity: 1;
}

:where(.app-content form) :where(.input:not(.checkbox):not(.radio)) > label,
.cogniveon-rendered-form .formio-form-group:not(.checkbox):not(.radio) > .col-form-label:not(.visually-hidden) {
    display: inline-block;
    padding: 0;
    margin-bottom: 7px;
    color: var(--app-text-secondary);
    font-size: 0.78rem;
    font-weight: 750;
}

.app-form-label-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 7px;
}

.app-form-label-row > .app-form-label {
    margin: 0;
    color: var(--app-text-secondary);
    font-size: 0.78rem;
    font-weight: 750;
}

.app-form-label-help {
    position: relative;
    width: 22px;
    height: 22px;
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
    font-size: 22px;
    line-height: 1;
    cursor: help;
}

.app-form-label-help::before {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--app-violet-accent) 16%, var(--app-surface));
    content: "";
}

.app-form-label-help > .ti {
    position: relative;
    z-index: 1;
}

.app-form-label-help:hover,
.app-form-label-help:focus-visible {
    color: color-mix(in srgb, var(--app-violet-accent) 76%, var(--app-text));
}

.app-form-label-help:hover::before,
.app-form-label-help:focus-visible::before {
    background: color-mix(in srgb, var(--app-violet-accent) 24%, var(--app-surface));
}

.app-form-label-help:focus-visible {
    outline: 2px solid var(--app-violet-accent);
    outline-offset: 2px;
}

.app-checkbox-tooltip-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.app-form-control-with-help--checkbox > .app-checkbox-tooltip-row {
    min-height: 44px;
    gap: 8px;
    padding-block: 7px;
}

.app-form-control-with-help--checkbox .input.checkbox {
    display: inline-flex;
    align-items: center;
}

.app-form-control-with-help--checkbox .app-form-label {
    margin: 0;
    color: var(--app-text-secondary);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.35;
    cursor: pointer;
    user-select: none;
}

.app-form-section textarea.form-control,
.cogniveon-rendered-form textarea.form-control,
:where(.app-content form) :where(.input) > textarea,
.patient-edit-card textarea.form-control {
    min-height: 94px;
    resize: vertical;
}

.app-form-section .form-control:focus,
.app-form-section .form-select:focus,
.cogniveon-rendered-form .form-control:focus,
.cogniveon-rendered-form .form-select:focus,
:where(.app-content form) :where(.input) > input:not(
    [type="checkbox"],
    [type="radio"],
    [type="hidden"],
    [type="file"],
    [type="submit"],
    [type="button"],
    [type="reset"]
):focus,
:where(.app-content form) :where(.input) > select:not(.ms-offscreen):focus,
:where(.app-content form) :where(.input) > textarea:focus,
.patient-edit-card .form-control:focus,
.patient-edit-card .form-select:focus {
    outline: 0;
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.2rem rgb(var(--app-primary-hover-rgb) / 16%);
}

.app-edit-footer {
    --patient-card-accent: var(--app-violet-accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: relative;
    overflow: hidden;
    padding: 19px 21px;
    border: 1px solid rgb(32 40 58 / 8%);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.app-edit-footer p {
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
    color: var(--app-muted);
    font-size: 0.84rem;
}

.app-edit-footer > div {
    flex: 0 0 auto;
}

.app-edit-footer .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.app-edit-footer--actions-only {
    justify-content: flex-end;
}

/* Edit workspaces fill short desktop viewports and grow with longer forms. */
@media (min-width: 1100px) {
    .edit-workspace {
        min-height: calc(100vh - var(--app-sticky-content-top) - var(--app-content-gap));
        display: grid;
        grid-template-rows: auto minmax(min-content, 1fr);
        gap: var(--app-content-gap);
    }

    .directory-workspace {
        min-height: calc(100vh - var(--app-sticky-content-top) - var(--app-content-gap));
        display: grid;
        grid-template-rows: auto minmax(min-content, 1fr);
        gap: var(--app-content-gap);
    }

    .directory-workspace .directory-card {
        min-height: 100%;
        margin-top: 0;
    }

    .edit-workspace .edit-workspace-heading-frame {
        margin-bottom: 0;
    }

    .edit-workspace .patient-edit-form,
    .edit-workspace .lead-edit-form {
        min-height: 0;
    }

    .edit-workspace-layout {
        height: 100%;
        min-height: 0;
        align-items: stretch;
    }

    .edit-workspace-summary-frame {
        height: 100%;
        max-height: calc(100vh - var(--app-sticky-content-top) - var(--app-content-gap));
        min-height: 0;
        position: sticky;
        top: var(--app-sticky-content-top);
        align-self: start;
    }

    .edit-workspace-summary-frame.edit-workspace-summary-frame--overflowing {
        align-self: stretch;
        height: auto;
        max-height: none;
        position: relative;
        top: auto;
    }

    .edit-workspace-sections {
        height: 100%;
        min-height: 0;
        grid-template-rows: minmax(min-content, 1fr);
    }

    .purchase-order-detail-workspace .edit-workspace-sections {
        grid-template-rows: auto minmax(min-content, 1fr);
    }

    .purchase-order-detail-workspace--has-revisions .edit-workspace-sections {
        grid-template-rows: auto auto minmax(min-content, 1fr);
    }

    .inventory-product-manage-workspace .edit-workspace-sections {
        grid-template-rows: auto auto auto minmax(min-content, 1fr);
    }

    :is(
        .purchase-order-detail-workspace,
        .inventory-product-manage-workspace
    ) .edit-workspace-section-frame:last-child > .inventory-section-card {
        height: 100%;
    }

    .edit-workspace .edit-workspace-section-frame:first-child,
    .edit-workspace .edit-workspace-section-frame:first-child .patient-edit-card {
        height: 100%;
    }

    .form-submission-workspace .edit-workspace-section-frame:first-child > .inventory-section-card {
        height: 100%;
    }
}

@media (max-width: 1099.98px) {
    .edit-workspace-layout {
        grid-template-columns: 1fr;
    }

    .edit-workspace-summary-frame {
        grid-column: auto;
        grid-row: auto;
        min-height: 0;
        height: auto;
        position: static;
    }

    .edit-workspace-summary-frame::before,
    .edit-workspace-summary-frame::after {
        display: none;
    }

    .patient-edit-summary {
        height: auto;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 18px;
        overflow: hidden;
    }

    .edit-workspace-sections {
        grid-column: auto;
        grid-row: auto;
    }

    .edit-workspace-summary-icon {
        grid-row: 1 / span 2;
        margin-bottom: 0;
    }

    .patient-edit-summary-details {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .page-heading {
        align-items: stretch;
        padding: 22px 20px;
    }

    .page-heading > .btn {
        width: 100%;
    }

    .directory-heading-actions,
    .directory-heading-actions > .btn,
    .directory-heading-actions > form,
    .task-due-filter {
        width: 100%;
    }

    .patient-edit-heading {
        align-items: stretch;
    }

    .patient-edit-heading-actions {
        width: 100%;
    }

    .patient-edit-heading-actions .btn {
        flex: 1 1 0;
    }

    .edit-save-button {
        font-size: 0;
    }

    .edit-save-button::after {
        content: attr(data-mobile-label);
        font-size: 0.875rem;
    }

    .patient-edit-card,
    .patient-edit-summary {
        padding: 20px;
    }

    .patient-task-heading {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 16px 12px;
    }

    .patient-task-heading .app-section-heading-icon {
        grid-column: 1;
        grid-row: 1;
    }

    .patient-task-heading .app-section-heading-copy {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
    }

    .patient-task-heading-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        padding-left: 0;
        gap: 10px;
    }

    .patient-task-counts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        padding-left: 0;
    }

    .patient-task-counts > span {
        min-height: 38px;
        justify-content: center;
        padding-inline: 10px;
    }

    .patient-task-add {
        width: 100%;
        min-height: 42px;
        justify-content: center;
        margin-left: 0;
    }

    .patient-task-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 11px;
        padding: 15px 15px 15px 19px;
    }

    .patient-task-status {
        grid-column: 1;
        grid-row: 1;
    }

    .patient-task-manage {
        grid-column: 2;
        grid-row: 1;
    }

    .patient-task-main {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .patient-task-meta {
        grid-template-columns: 1fr;
    }

    .patient-edit-summary-details {
        grid-template-columns: 1fr;
    }

    .app-edit-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .app-edit-footer > div,
    .app-edit-footer .btn {
        width: 100%;
    }

    .app-edit-footer > div {
        flex-direction: column;
    }
}

/* Global searchable select controls, powered by multiple-select. */
select.app-select.ms-offscreen {
    min-width: 0 !important;
    min-height: 0 !important;
}

.ms-parent.app-select-widget {
    width: 100% !important;
    min-width: 0;
    height: auto;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.ms-parent.app-select-widget.form-select {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-image: none;
    box-shadow: none;
}

.ms-parent.app-select-widget .ms-choice {
    width: 100%;
    min-height: 44px;
    height: auto;
    display: block;
    position: relative;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: #ffffff;
    color: var(--app-text);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    white-space: nowrap;
    box-shadow: none;
    outline: 0;
}

.ms-parent.app-select-widget .ms-choice > span {
    min-width: 0;
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    position: relative;
    inset: auto;
    margin-right: 2.25rem;
    overflow: hidden;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-parent.app-select-widget .ms-choice > span.ms-placeholder {
    color: var(--app-control-placeholder);
}

.ms-parent.app-select-widget .ms-choice > div.icon-caret {
    width: 0;
    height: 0;
    position: absolute;
    top: 50%;
    right: 0.85rem;
    margin: 0;
    border-color: var(--app-muted) transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0;
    transform: translateY(-50%);
}

.ms-parent.app-select-widget .ms-choice > div.icon-caret.open {
    border-color: transparent transparent var(--app-muted);
    border-width: 0 4px 5px;
}

.ms-parent.app-select-widget .ms-choice:focus,
.ms-parent.app-select-widget.ms-parent-open .ms-choice {
    border-color: var(--app-primary-hover);
    box-shadow: 0 0 0 0.25rem rgb(var(--app-primary-hover-rgb) / 22%);
}

.ms-parent.app-select-widget.is-disabled .ms-choice,
.ms-parent.app-select-widget .ms-choice.disabled {
    border-color: var(--app-border);
    background-color: var(--bs-secondary-bg, #e9ecef);
    color: var(--app-muted);
    cursor: default;
}

.app-form .ms-parent.app-select-widget.form-error .ms-choice,
.ms-parent.app-select-widget .ms-choice[aria-invalid="true"] {
    border-color: var(--app-red);
}

.app-form .ms-parent.app-select-widget.form-error .ms-choice:focus,
.app-form .ms-parent.app-select-widget.form-error.ms-parent-open .ms-choice,
.ms-parent.app-select-widget .ms-choice[aria-invalid="true"]:focus {
    border-color: var(--app-red);
    box-shadow: 0 0 0 0.25rem rgb(185 28 28 / 16%);
}

.app-form-section .ms-parent.app-select-widget .ms-choice,
.patient-edit-card .ms-parent.app-select-widget .ms-choice {
    min-height: 44px;
    border-radius: 9px;
}

.app-form-section .ms-parent.app-select-widget .ms-choice > span,
.patient-edit-card .ms-parent.app-select-widget .ms-choice > span {
    min-height: 42px;
}

.app-form-section .ms-parent.app-select-widget .ms-choice:focus,
.app-form-section .ms-parent.app-select-widget.ms-parent-open .ms-choice,
.patient-edit-card .ms-parent.app-select-widget .ms-choice:focus,
.patient-edit-card .ms-parent.app-select-widget.ms-parent-open .ms-choice {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.2rem rgb(var(--app-primary-hover-rgb) / 16%);
}

.ms-parent.app-select-widget.task-due-filter {
    width: auto !important;
    min-width: 190px;
}

.ms-parent.app-select-widget.task-due-filter .ms-choice {
    min-height: 44px;
    border-radius: 8px;
    color: var(--app-text-secondary);
    font-weight: 700;
}

.app-select-dropdown.ms-drop {
    min-width: 0 !important;
    max-width: calc(100vw - 16px);
    overflow: hidden;
    z-index: 1110;
    border: 1px solid rgb(0 0 0 / 15%);
    border-radius: 3px;
    background: #ffffff;
    color: #212529;
    font-family: inherit;
    font-size: 0.875rem;
}

.app-select-dropdown.ms-drop.bottom {
    box-shadow: 0 4px 5px rgb(0 0 0 / 15%);
}

.app-select-dropdown.ms-drop.top {
    box-shadow: 0 -4px 5px rgb(0 0 0 / 15%);
}

.app-select-dropdown.ms-drop ul {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
    overflow-y: auto;
}

.app-select-dropdown.ms-drop ul > li {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    background: transparent;
    color: #212529;
    outline: 0;
}

.app-select-dropdown.ms-drop ul > li label {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 4px 8px;
    font-weight: 400;
    line-height: 22px;
    text-align: left;
    cursor: pointer;
}

.app-select-dropdown.ms-drop ul > li label > span {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-select-dropdown.ms-drop ul > li.option-level-1 > label,
.app-select-dropdown.ms-drop ul > li.group ~ li.option-level-1:not(.hide-radio) > label {
    padding-left: 8px !important;
}

.app-select-dropdown.ms-drop ul > li:not(.group).selected {
    background: #d3d3d3;
    color: #000000;
}

.app-select-dropdown.ms-drop ul > li:not(.group):hover,
.app-select-dropdown.ms-drop ul > li:not(.group):focus,
.app-select-dropdown.ms-drop ul > li:not(.group):focus-within {
    background: #a9a9a9;
    color: #16181b;
}

.app-select-dropdown.ms-drop ul > li.group,
.app-select-dropdown.ms-drop ul > li.group:hover,
.app-select-dropdown.ms-drop ul > li.group:focus,
.app-select-dropdown.ms-drop ul > li.group:focus-within {
    background: var(--app-sidebar);
    color: #ffffff;
}

.app-select-dropdown.ms-drop ul > li.group label.optgroup,
.app-select-dropdown.ms-drop ul > li.group label.optgroup.disabled {
    min-height: 30px;
    display: flex;
    justify-content: flex-start;
    padding: 4px 8px !important;
    overflow: hidden;
    background: var(--app-sidebar);
    color: #ffffff !important;
    font-weight: 700 !important;
    line-height: 22px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1 !important;
    filter: none !important;
}

.app-select-dropdown.ms-drop ul > li.group label.optgroup > span:empty {
    display: none;
}

.app-select-dropdown.ms-drop ul > li.ms-select-all label {
    font-weight: 700;
}

.app-select-dropdown.ms-drop input[type="checkbox"],
.app-select-dropdown.ms-drop input[type="radio"] {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    position: static;
    margin: 0;
}

.app-select-dropdown.ms-drop input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #767676;
    border-radius: 2px;
    background: #ffffff;
    box-shadow: none;
}

.app-select-dropdown.ms-drop input[type="checkbox"]:checked {
    border-color: var(--app-primary);
    background-color: var(--app-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'%3E%3Cpath d='M2.8 6.5 5.2 8.8 10.2 3.9' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 13px 13px;
}

.app-select-dropdown.ms-drop input[type="checkbox"]:indeterminate {
    border-color: var(--app-primary);
    background-color: var(--app-primary);
    background-image: linear-gradient(#ffffff, #ffffff);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 7px 2px;
}

.app-select-dropdown.ms-drop input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #767676;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: none;
}

.app-select-dropdown.ms-drop input[type="radio"]:checked {
    border-color: var(--app-primary);
    background: radial-gradient(
        circle at center,
        var(--app-primary) 0 4px,
        #ffffff 4px 100%
    );
}

.app-select-dropdown.ms-drop input[type="checkbox"]:focus-visible,
.app-select-dropdown.ms-drop input[type="radio"]:focus-visible {
    outline: 2px solid rgb(var(--app-primary-hover-rgb) / 35%);
    outline-offset: 1px;
}

.app-select-dropdown.ms-drop .ms-search {
    width: 100%;
    min-height: 45px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0;
    overflow: hidden;
    border-bottom: 1px solid #d4d4d4;
    background: #ffffff;
}

.app-select-dropdown.ms-drop .ms-search::before {
    content: "\eb1c";
    position: absolute;
    top: 50%;
    left: 10px;
    z-index: 1;
    color: var(--app-text-secondary);
    font-family: "tabler-icons" !important;
    font-size: 16px;
    font-style: normal;
    line-height: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.app-select-dropdown.ms-drop .ms-search input {
    width: 100%;
    min-width: 0;
    min-height: 44px !important;
    margin: 0;
    padding: 10px 10px 10px 32px;
    border: 0 !important;
    border-radius: 0;
    background: transparent;
    color: var(--app-text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 24px;
    box-shadow: none !important;
    outline: 0;
}

.app-select-dropdown.ms-drop .ms-search input:focus {
    border: 0 !important;
    box-shadow: none !important;
    outline: 0;
}

.app-select-dropdown.ms-drop .ms-no-results {
    width: 100%;
    padding: 8px;
    color: var(--app-muted);
    text-align: left;
}

@media (max-width: 575.98px) {
    .ms-parent.app-select-widget.task-due-filter {
        width: 100% !important;
    }

    .app-select-dropdown.ms-drop ul > li:not(.group) label {
        align-items: flex-start;
    }

    .app-select-dropdown.ms-drop ul > li:not(.group) label > span {
        padding-left: 8px;
        overflow: visible;
        overflow-wrap: anywhere;
        text-indent: -8px;
        text-overflow: clip;
        white-space: normal;
    }

    .app-select-dropdown.ms-drop ul > li:not(.group) input[type="checkbox"],
    .app-select-dropdown.ms-drop ul > li:not(.group) input[type="radio"] {
        margin-top: 4px;
    }
}

/* Shared foreground/background color pairs. */
.app-color-pair--0 { background: color-mix(in srgb, var(--app-primary) 18%, var(--app-surface)); color: var(--app-primary-dark); }
.app-color-pair--1 { background: color-mix(in srgb, var(--app-blue) 17%, var(--app-surface)); color: var(--app-blue); }
.app-color-pair--2 { background: color-mix(in srgb, var(--app-green) 17%, var(--app-surface)); color: var(--app-green); }
.app-color-pair--3 { background: color-mix(in srgb, var(--app-amber) 18%, var(--app-surface)); color: var(--app-amber); }
.app-color-pair--4 { background: color-mix(in srgb, var(--app-red) 16%, var(--app-surface)); color: var(--app-red); }
.app-color-pair--5 { background: color-mix(in srgb, var(--app-primary-hover) 17%, var(--app-surface)); color: var(--app-primary-dark); }
.app-color-pair--6 { background: color-mix(in srgb, var(--app-blue) 12%, var(--app-surface)); color: color-mix(in srgb, var(--app-blue) 80%, var(--app-text)); }
.app-color-pair--7 { background: color-mix(in srgb, var(--app-amber) 13%, var(--app-surface)); color: color-mix(in srgb, var(--app-amber) 82%, var(--app-text)); }

/* Task workspace dashboard. */
.task-workspace {
    min-width: 0;
    display: grid;
    gap: var(--app-content-gap);
}

.task-workspace > .task-card-directory {
    margin-top: 0;
}

.workspace-metric-grid {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--app-content-gap);
}

@media (min-width: 1200px) {
    .inventory-product-manage-workspace > .workspace-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.workspace-metric-card {
    --workspace-metric-accent: var(--app-primary);
    --workspace-metric-color: var(--app-primary-dark);
    position: relative;
    min-width: 0;
    min-height: 136px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    padding: 22px 21px 20px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: var(--app-surface-shadow);
    text-decoration: none;
    transition: box-shadow 150ms ease, transform 150ms ease;
}

.workspace-metric-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--workspace-metric-accent);
    content: "";
}

a.workspace-metric-card:hover,
a.workspace-metric-card:focus-visible {
    color: var(--app-text);
    box-shadow: var(--app-surface-shadow-hover);
    transform: translateY(-2px);
}

a.workspace-metric-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--workspace-metric-accent) 32%, transparent);
    outline-offset: 2px;
}

.workspace-metric-card--open,
.workspace-metric-card--total {
    --workspace-metric-accent: var(--app-violet-accent);
    --workspace-metric-color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.workspace-metric-card--overdue,
.workspace-metric-card--month {
    --workspace-metric-accent: var(--app-coral-accent);
    --workspace-metric-color: var(--app-red);
}

.workspace-metric-card--today {
    --workspace-metric-accent: var(--app-blue-accent);
    --workspace-metric-color: var(--app-blue);
}

.workspace-metric-card--completed,
.workspace-metric-card--tomorrow {
    --workspace-metric-accent: var(--app-primary);
    --workspace-metric-color: var(--app-primary-dark);
}

.workspace-metric-card--placeholder {
    --workspace-metric-accent: var(--app-border);
    cursor: default;
}

a.workspace-metric-card--placeholder:hover {
    box-shadow: var(--app-surface-shadow);
    transform: none;
}

.workspace-metric-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--workspace-metric-accent) 16%, var(--app-surface));
    color: var(--workspace-metric-color);
    font-size: 1.35rem;
    transition: background-color 150ms ease, transform 150ms ease;
}

a.workspace-metric-card:hover .workspace-metric-icon,
a.workspace-metric-card:focus-visible .workspace-metric-icon {
    background: color-mix(in srgb, var(--workspace-metric-accent) 22%, var(--app-surface));
    transform: scale(1.04);
}

.workspace-metric-card > span:nth-child(2) {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.workspace-metric-card strong {
    color: var(--app-text);
    font-size: clamp(1.35rem, 1.7vw, 1.65rem);
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.workspace-metric-card small {
    color: var(--app-text-secondary);
    font-size: 0.77rem;
    font-weight: 750;
}

.workspace-metric-arrow {
    color: var(--workspace-metric-color);
    font-size: 1rem;
    transition: transform 150ms ease;
}

.workspace-metric-card:hover .workspace-metric-arrow,
.workspace-metric-card:focus-visible .workspace-metric-arrow {
    transform: translateX(2px);
}

/* Inventory detail and edit surfaces mirror the established patient/task card language. */
:is(
    .product-catalog-edit-workspace,
    .inventory-location-edit-workspace,
    .inventory-movement-workspace,
    .inventory-product-manage-workspace,
    .inventory-purchase-workspace,
    .inventory-receiving-workspace,
    .inventory-stock-policy-edit-workspace,
    .opening-inventory-workspace,
    .vendor-edit-workspace
) {
    min-width: 0;
    display: grid;
    grid-template-rows: none;
    grid-auto-rows: max-content;
    align-content: start;
    gap: var(--app-content-gap);
}

:is(
    .product-catalog-edit-workspace,
    .inventory-location-edit-workspace,
    .inventory-movement-workspace,
    .inventory-product-manage-workspace,
    .inventory-purchase-workspace,
    .inventory-receiving-workspace,
    .inventory-stock-policy-edit-workspace,
    .opening-inventory-workspace,
    .vendor-edit-workspace
) > .edit-workspace-heading-frame {
    margin-bottom: 0;
}

.inventory-movement-workspace .form-text {
    font-size: 0.75rem;
}

.inventory-location-checkbox-stack .input.checkbox > label:has(> input[type="checkbox"]) {
    color: var(--app-text-secondary);
    font-size: 0.78rem;
    font-weight: 750;
}

.inventory-section-card {
    --inventory-section-accent: var(--app-teal-accent);
    --inventory-section-color: var(--app-primary-dark);
    --inventory-section-content-gap: 23px;
    min-width: 0;
    position: relative;
    padding: 25px;
    overflow: hidden;
    border: 1px solid rgb(32 40 58 / 8%);
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

.inventory-section-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--inventory-section-accent);
    content: "";
}

.inventory-section-card--blue {
    --inventory-section-accent: var(--app-blue-accent);
    --inventory-section-color: var(--app-blue);
}

.inventory-section-card--amber {
    --inventory-section-accent: var(--app-amber-accent);
    --inventory-section-color: var(--app-amber);
}

.inventory-section-card--green {
    --inventory-section-accent: var(--app-sage-accent);
    --inventory-section-color: var(--app-green);
}

.inventory-section-card--violet {
    --inventory-section-accent: var(--app-violet-accent);
    --inventory-section-color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.inventory-section-card--coral {
    --inventory-section-accent: var(--app-coral-accent);
    --inventory-section-color: var(--app-red);
}

.inventory-section-card > .app-section-heading {
    margin-bottom: var(--inventory-section-content-gap);
    padding-bottom: 19px;
    border-bottom: 1px solid var(--app-border);
}

.inventory-section-card > .app-section-heading .app-section-heading-icon,
.inventory-section-card > .inventory-advanced-summary .app-section-heading-icon {
    background: color-mix(in srgb, var(--inventory-section-accent) 16%, var(--app-surface));
    color: var(--inventory-section-color);
}

.inventory-section-card > .app-section-heading .app-section-heading-eyebrow,
.inventory-section-card > .inventory-advanced-summary .app-section-heading-eyebrow {
    color: var(--inventory-section-color);
}

.tenant-provision-runs {
    min-width: 0;
    display: grid;
    gap: 16px;
}

.tenant-management-table-wrap {
    overflow-x: auto;
    border: 1px solid color-mix(in srgb, var(--app-border) 82%, transparent);
    border-radius: 10px;
    background: var(--app-surface);
}

.tenant-practice-summary-icon {
    background: color-mix(in srgb, var(--patient-card-accent) 14%, var(--app-surface));
    color: var(--app-red);
}

.tenant-management-action-heading .app-section-heading-copy {
    flex: 1 1 auto;
}

.tenant-management-heading-action {
    flex: 0 0 auto;
    margin: 0 0 0 auto;
}

.tenant-management-heading-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.tenant-management-heading-action .btn {
    white-space: nowrap;
}

.tenant-management-heading-actions .btn {
    white-space: nowrap;
}

.tenant-management-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-text-secondary);
    min-width: 100%;
    color: var(--app-text-secondary);
    font-size: 0.8rem;
}

.tenant-management-table > :not(caption) > * > * {
    padding: 11px 10px;
    border-bottom-color: color-mix(in srgb, var(--app-border) 72%, transparent);
    line-height: 1.4;
}

.tenant-management-table thead th {
    padding-top: 9px;
    padding-bottom: 9px;
    border-bottom-width: 1px;
    background: color-mix(in srgb, var(--inventory-section-accent) 7%, var(--app-surface));
    color: var(--app-muted);
    font-size: 0.65rem;
    font-weight: 850;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tenant-management-table tbody td {
    font-weight: 600;
}

.tenant-management-table tbody tr:last-child td {
    border-bottom: 0;
}

.tenant-management-table tbody time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tenant-management-table tbody code {
    max-width: 100%;
    display: inline-block;
    padding: 3px 6px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--inventory-section-accent) 9%, var(--app-surface));
    color: var(--inventory-section-color);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.tenant-management-table .badge {
    font-size: 0.67rem;
}

.tenant-management-table .btn-sm {
    padding: 5px 9px;
    font-size: 0.72rem;
}

.tenant-provision-run {
    min-width: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--app-blue-accent) 28%, var(--app-border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-blue-accent) 3%, var(--app-surface));
}

.tenant-provision-run-header {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 18px;
    border-bottom: 1px solid color-mix(in srgb, var(--app-blue-accent) 22%, var(--app-border));
    background: color-mix(in srgb, var(--app-blue-accent) 7%, var(--app-surface));
}

.tenant-provision-run-heading {
    min-width: 0;
}

.tenant-provision-run-title {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.tenant-provision-run-title h3 {
    margin: 0;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.tenant-provision-run-heading p {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 0.8rem;
}

.tenant-provision-run-status {
    width: max-content;
    display: table;
    margin-top: 8px;
}

.tenant-provision-run-header > .badge {
    flex: 0 0 auto;
}

.tenant-provision-error {
    margin: 16px 18px 0;
    padding: 10px 12px;
    font-size: 0.82rem;
}

.tenant-provision-timeline {
    min-width: 0;
    display: grid;
    margin: 0;
    padding: 7px 18px 9px;
    list-style: none;
}

.tenant-provision-event {
    --tenant-provision-event-color: var(--app-muted);
    min-width: 0;
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.tenant-provision-event:not(:last-child)::before {
    width: 2px;
    position: absolute;
    z-index: 0;
    top: 24px;
    bottom: -10px;
    left: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-blue-accent) 20%, var(--app-border));
    content: "";
}

.tenant-provision-event--success {
    --tenant-provision-event-color: var(--app-green);
}

.tenant-provision-event--danger {
    --tenant-provision-event-color: var(--app-red);
}

.tenant-provision-event--active {
    --tenant-provision-event-color: var(--app-blue);
}

.tenant-provision-event-marker {
    width: 10px;
    height: 10px;
    position: relative;
    z-index: 1;
    justify-self: center;
    border: 2px solid var(--app-surface);
    border-radius: 50%;
    background: var(--tenant-provision-event-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tenant-provision-event-color) 24%, var(--app-border));
}

.tenant-provision-event-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.tenant-provision-event-copy strong {
    overflow-wrap: anywhere;
    color: var(--app-text-secondary);
    font-size: 0.81rem;
    font-weight: 800;
    line-height: 1.25;
}

.tenant-provision-event-copy span {
    overflow-wrap: anywhere;
    color: var(--app-muted);
    font-size: 0.72rem;
    line-height: 1.3;
}

.tenant-provision-event-time {
    color: var(--app-muted);
    font-size: 0.71rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tenant-provision-empty {
    margin: 0;
    padding: 15px 18px;
    color: var(--app-muted);
    font-size: 0.82rem;
}

@media (max-width: 575.98px) {
    .tenant-management-action-heading {
        flex-wrap: wrap;
    }

    .tenant-management-heading-action,
    .tenant-management-heading-actions {
        margin-left: 56px;
    }

    .tenant-provision-run-header {
        display: grid;
    }

    .tenant-provision-event {
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .tenant-provision-event-time {
        grid-column: 2;
    }
}

.inventory-section-card > .inventory-lot-safety-heading {
    margin-top: 16px;
}

.inventory-section-card.inventory-receipt-line > legend {
    background: color-mix(in srgb, var(--inventory-section-accent) 14%, var(--app-surface));
    color: var(--inventory-section-color);
}

.inventory-receipt-line--contained > legend {
    background: color-mix(in srgb, var(--inventory-section-accent) 14%, var(--app-surface));
    color: var(--inventory-section-color);
}

.inventory-stock-record-list {
    min-width: 0;
    margin: 0;
}

.inventory-stock-record-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(190px, 34%) minmax(0, 1fr);
}

.inventory-stock-record-row + .inventory-stock-record-row {
    border-top: 1px solid var(--app-border);
}

.inventory-stock-record-row dt,
.inventory-stock-record-row dd {
    min-width: 0;
    margin: 0;
    padding: 14px 16px;
}

.inventory-stock-record-row dt {
    padding-left: 0;
    color: var(--app-text-secondary);
    font-weight: 750;
}

.inventory-stock-record-row dd {
    padding-right: 0;
    border-left: 1px solid var(--app-border);
    color: var(--app-muted);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.inventory-stock-record-row dd a {
    color: inherit;
}

.inventory-stock-record-row dd a:hover,
.inventory-stock-record-row dd a:focus-visible {
    color: var(--app-primary-dark);
}

.inventory-product-summary-heading .patient-edit-summary-label {
    color: var(--app-primary-dark);
}

.inventory-product-summary-card {
    --inventory-section-accent: var(--app-coral-accent);
}

.inventory-product-summary-title {
    margin: 0;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.inventory-stock-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.inventory-lot-status-actions,
.inventory-lot-status-form {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.inventory-lot-status-actions {
    grid-template-columns: minmax(0, 1fr);
}

.inventory-lot-status-form {
    grid-template-columns: minmax(0, 1fr);
}

.inventory-lot-status-form .input {
    min-width: 0;
    margin: 0;
}

.inventory-lot-status-form .inventory-stock-action {
    width: 100%;
}

.inventory-stock-action {
    --inventory-stock-action-accent: var(--app-primary);
    --inventory-stock-action-color: var(--app-primary-dark);

    min-width: 0;
    min-height: 52px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 6px 8px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: transparent;
    color: var(--app-text-secondary);
    text-align: left;
    text-decoration: none;
    transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.inventory-stock-action--blue {
    --inventory-stock-action-accent: var(--app-blue-accent);
    --inventory-stock-action-color: var(--app-blue);
}

.inventory-stock-action--teal {
    --inventory-stock-action-accent: var(--app-teal-accent);
    --inventory-stock-action-color: var(--app-primary-dark);
}

.inventory-stock-action--amber {
    --inventory-stock-action-accent: var(--app-amber-accent);
    --inventory-stock-action-color: var(--app-amber);
}

.inventory-stock-action--slate {
    --inventory-stock-action-accent: var(--app-muted);
    --inventory-stock-action-color: var(--app-text-secondary);
}

.inventory-stock-action--violet {
    --inventory-stock-action-accent: var(--app-violet-accent);
    --inventory-stock-action-color:
        color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.inventory-stock-action--coral {
    --inventory-stock-action-accent: var(--app-coral-accent);
    --inventory-stock-action-color: var(--app-red);
}

.inventory-stock-action-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 11px 5px 11px 5px;
    background: color-mix(in srgb, var(--inventory-stock-action-accent) 16%, var(--app-surface));
    color: var(--inventory-stock-action-color);
    font-size: 1rem;
    transition: border-color 140ms ease;
}

.inventory-stock-action-label {
    min-width: 0;
    color: inherit;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.3;
}

.inventory-stock-action-arrow {
    color: var(--app-muted);
    font-size: 0.9rem;
    transition: color 140ms ease, transform 140ms ease;
}

.inventory-stock-action:hover,
.inventory-stock-action:focus-visible {
    border-color:
        color-mix(in srgb, var(--inventory-stock-action-accent) 32%, var(--app-border));
    background: color-mix(in srgb, var(--inventory-stock-action-accent) 8%, var(--app-surface));
    color: var(--inventory-stock-action-color);
}

.inventory-stock-action:hover .inventory-stock-action-icon,
.inventory-stock-action:focus-visible .inventory-stock-action-icon {
    border-color:
        color-mix(in srgb, var(--inventory-stock-action-accent) 32%, var(--app-border));
}

.inventory-stock-action:hover .inventory-stock-action-arrow,
.inventory-stock-action:focus-visible .inventory-stock-action-arrow {
    color: var(--inventory-stock-action-color);
    transform: translateX(2px);
}

.inventory-stock-action:focus-visible {
    outline: 2px solid var(--inventory-stock-action-accent);
    outline-offset: 2px;
}

.inventory-stock-action:active {
    transform: scale(0.985);
}

.inventory-section-group,
.inventory-detail-list {
    min-width: 0;
    display: grid;
    gap: var(--app-content-gap);
}

.inventory-location-data-list {
    min-width: 0;
    display: grid;
    gap: var(--app-content-gap);
}

.inventory-location-data-list + .directory-pagination {
    margin-top: var(--inventory-section-content-gap, var(--app-content-gap));
}

.inventory-location-data-header {
    display: none;
}

.inventory-location-data-row {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px 16px;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: var(--app-surface);
}

.inventory-location-data-identity,
.inventory-location-data-cell {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.inventory-location-data-identity {
    grid-column: 1 / -1;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--app-border);
}

.inventory-location-data-identity h3 {
    margin: 0;
    color: var(--app-text);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.35;
}

.inventory-location-data-identity small,
.inventory-location-data-cell small {
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.inventory-location-data-cell small {
    display: block;
}

.inventory-location-data-cell strong {
    min-width: 0;
    color: var(--app-text-secondary);
    font-size: 0.84rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.inventory-order-data-heading {
    min-width: 0;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--app-border);
}

.inventory-order-data-identity {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.inventory-history-data-heading-copy,
.inventory-compact-data-heading-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.inventory-history-direction-icon,
.inventory-compact-row-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--app-blue-accent) 12%, var(--app-surface));
    color: var(--app-blue);
}

.inventory-history-direction-icon--increase,
.inventory-compact-row-icon--green {
    background: color-mix(in srgb, var(--app-sage-accent) 13%, var(--app-surface));
    color: var(--app-green);
}

.inventory-history-direction-icon--decrease,
.inventory-compact-row-icon--coral {
    background: color-mix(in srgb, var(--app-coral-accent) 13%, var(--app-surface));
    color: var(--app-red);
}

.inventory-history-direction-icon--conversion {
    background: color-mix(in srgb, var(--app-violet-accent) 13%, var(--app-surface));
    color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.inventory-compact-row-icon--amber {
    background: color-mix(in srgb, var(--app-amber-accent) 13%, var(--app-surface));
    color: var(--app-amber);
}

.inventory-history-direction-icon .ti,
.inventory-compact-row-icon .ti {
    font-size: 1rem;
}

.inventory-order-data-identity h3 {
    margin: 0;
    color: var(--app-text);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.35;
}

.inventory-fefo-badge {
    width: max-content;
    max-width: 100%;
    justify-self: start;
    margin-top: 4px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 0.67rem;
    line-height: 1;
}

.purchase-order-line-data-identity h3 a {
    color: inherit;
    text-decoration: none;
}

.purchase-order-line-data-identity h3 a:hover {
    text-decoration: underline;
}

.purchase-order-receipt-data-row,
.purchase-order-revision-data-row {
    grid-template-columns: 1fr;
}

.purchase-order-receipt-lines,
.purchase-order-revision-lines {
    min-width: 0;
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
}

.purchase-order-receipt-line,
.purchase-order-revision-line {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    padding: 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--app-sage-accent) 7%, var(--app-surface));
}

.purchase-order-receipt-line-heading,
.purchase-order-revision-line-heading {
    min-width: 0;
    grid-column: 1 / -1;
    display: grid;
    gap: 2px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--app-border);
}

.purchase-order-receipt-line-heading strong,
.purchase-order-revision-line-heading strong {
    color: var(--app-text);
    font-size: 0.86rem;
    font-weight: 800;
}

.purchase-order-receipt-line-heading span,
.purchase-order-revision-line-heading span {
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.purchase-order-revision-change-list,
.purchase-order-revision-line-changes {
    min-width: 0;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.purchase-order-revision-lines > p {
    margin: 2px 0 0;
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.purchase-order-revision-line {
    background: color-mix(in srgb, var(--app-violet-accent) 7%, var(--app-surface));
}

.purchase-order-revision-story {
    min-width: 0;
    grid-column: 1 / -1;
    display: grid;
    gap: 9px;
}

.purchase-order-revision-story > p,
.purchase-order-revision-line-changes > p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.purchase-order-revision-story-flow {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.purchase-order-revision-story-state,
.purchase-order-revision-story-actions {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 11px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
}

.purchase-order-revision-story-actions {
    border-color: color-mix(in srgb, var(--app-violet-accent) 28%, var(--app-border));
    background: color-mix(in srgb, var(--app-violet-accent) 10%, var(--app-surface));
}

.purchase-order-revision-story-state small,
.purchase-order-revision-story-actions small {
    color: var(--app-muted);
    font-size: 0.66rem;
    font-weight: 850;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.purchase-order-revision-story-state strong {
    color: var(--app-text);
    font-size: 0.86rem;
    font-weight: 850;
}

.purchase-order-revision-story-state span {
    color: var(--app-text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
}

.purchase-order-revision-story-actions ul {
    display: grid;
    gap: 7px;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
}

.purchase-order-revision-story-actions li {
    display: grid;
    gap: 1px;
}

.purchase-order-revision-story-actions li strong {
    color: color-mix(in srgb, var(--app-violet-accent) 76%, var(--app-text));
    font-size: 0.84rem;
    font-weight: 900;
}

.purchase-order-revision-story-actions li span {
    color: var(--app-text-secondary);
    font-size: 0.73rem;
    font-weight: 750;
}

.purchase-order-revision-story-outcome {
    padding: 9px 11px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--app-amber-accent) 11%, var(--app-surface));
    color: var(--app-text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
}

.purchase-order-revision-story-later {
    padding: 9px 11px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--app-sage-accent) 12%, var(--app-surface));
    color: var(--app-text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
}

.purchase-order-revision-transition {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 7px;
}

.purchase-order-revision-transition > span:nth-child(2) {
    color: var(--app-muted);
    font-weight: 650;
}

.purchase-order-revision-correction {
    width: max-content;
    max-width: 100%;
    margin-top: 3px;
    padding: 4px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-violet-accent) 13%, var(--app-surface));
    color: color-mix(in srgb, var(--app-violet-accent) 75%, var(--app-text));
    font-size: 0.69rem;
    font-weight: 800;
}

@media (max-width: 575.98px) {
    .purchase-order-receipt-line,
    .purchase-order-revision-change-list,
    .purchase-order-revision-line,
    .purchase-order-revision-line-changes {
        grid-template-columns: 1fr;
    }
}

.inventory-product-stock-guidance {
    margin: 0 0 14px;
    color: var(--app-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.inventory-product-stock-search {
    min-width: 0;
    display: grid;
    gap: 7px;
    margin-bottom: var(--app-content-gap);
}

.inventory-product-stock-search > label {
    color: var(--app-text-secondary);
    font-size: 0.78rem;
    font-weight: 750;
}

.inventory-product-stock-search-controls {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.inventory-product-stock-search-controls .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .inventory-product-stock-search-controls {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 992px) {
    .inventory-product-stock-search-controls {
        width: 100%;
        max-width: 600px;
    }
}

.inventory-product-summary-actions {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding-top: 20px;
}

.inventory-product-summary-actions--standalone {
    padding-top: 0;
}

.inventory-product-summary-actions-heading {
    min-width: 0;
}

.inventory-product-summary-actions-heading .edit-workspace-summary-icon {
    margin-bottom: 19px;
}

.inventory-product-summary-actions-heading .patient-edit-summary-label {
    color: var(--app-primary-dark);
}

.inventory-product-summary-actions nav {
    display: grid;
    gap: 8px;
}

@media (min-width: 768px) {
    .inventory-product-information-data-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inventory-history-data-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inventory-history-lot-cell {
        grid-column: 1;
    }

    .inventory-receipt-line-data-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inventory-receipt-details-data-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.inventory-reversal-data-row {
    grid-template-columns: minmax(0, 1fr);
}

.inventory-reversal-data-row .inventory-reversal-form {
    grid-column: 1 / -1;
    padding-top: 0;
    margin-top: 0;
}

.inventory-product-stock-source-actions {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.inventory-product-stock-source-actions .btn {
    white-space: nowrap;
}

@media (min-width: 768px) {
    .inventory-product-stock-source-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .inventory-product-stock-source-row .inventory-order-data-heading {
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-product-stock-source-actions {
        justify-content: flex-start;
    }
}

#inventory-stock-action-drawer .app-drawer-body {
    padding: 0;
    overflow: hidden;
}

#inventory-reversal-drawer .app-drawer-body {
    padding: 0;
    overflow: hidden;
}

#inventory-reversal-drawer-content,
.inventory-reversal-drawer-form,
.inventory-reversal-drawer-form > form {
    height: 100%;
    min-height: 0;
}

.inventory-reversal-drawer-form > form {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.inventory-reversal-drawer-fields {
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.inventory-reversal-drawer-actions {
    margin: 0;
}

#inventory-stock-action-drawer-content,
.inventory-movement-drawer-form,
.inventory-movement-drawer-form-element,
.inventory-movement-drawer-content-inner {
    height: 100%;
    min-height: 0;
}

.inventory-movement-drawer-content-inner {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.inventory-movement-drawer-main {
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.inventory-movement-drawer-actions {
    margin: 0;
}

.inventory-movement-source-card {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--app-primary) 24%, var(--app-border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-primary) 6%, var(--app-surface));
    overflow: hidden;
}

.inventory-movement-source-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--app-text);
}

.inventory-movement-source-card-heading > i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--app-primary-dark);
    font-size: 1.2rem;
}

.inventory-movement-source-card-eyebrow {
    margin: 0;
    color: var(--app-primary-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.inventory-movement-source-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.inventory-movement-source-card-grid > div {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    background: var(--app-surface);
}

.inventory-movement-source-card-grid small {
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inventory-movement-source-card-grid strong {
    color: var(--app-text-secondary);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .inventory-movement-source-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.inventory-order-data-identity small,
.inventory-order-data-detail {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.inventory-order-data-heading .app-row-action-button {
    align-self: start;
    white-space: nowrap;
}

.inventory-section-intro {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.inventory-section-intro .app-section-heading-copy {
    flex: 1 1 auto;
}

.inventory-section-intro .app-section-heading-icon {
    background: color-mix(in srgb, var(--inventory-section-accent) 16%, var(--app-surface));
    color: var(--inventory-section-color);
}

.inventory-section-intro .app-section-heading-eyebrow {
    color: var(--inventory-section-color);
}

.inventory-receiving-product-summary {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--app-primary) 24%, var(--app-border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-primary) 6%, var(--app-surface));
    overflow: hidden;
}

.inventory-receiving-product-summary[hidden] {
    display: none;
}

.inventory-receiving-product-summary-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--app-text);
}

.inventory-receiving-product-summary-heading > i {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--app-primary-dark);
    font-size: 1.2rem;
}

.inventory-receiving-product-summary-heading > div {
    display: grid;
    gap: 2px;
}

.inventory-receiving-product-summary-heading small {
    color: var(--app-primary-dark);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.inventory-receiving-product-summary-heading strong {
    font-size: 0.9rem;
}

.inventory-receiving-product-settings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.inventory-receiving-product-settings > div {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
}

.inventory-receiving-product-settings dt {
    color: var(--app-muted);
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.inventory-receiving-product-settings dd {
    margin: 0;
    color: var(--app-text);
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .inventory-receiving-product-settings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.inventory-advanced-summary {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 19px;
    border-bottom: 1px solid var(--app-border);
    cursor: pointer;
    list-style: none;
}

.inventory-advanced-summary .app-section-heading-copy {
    display: grid;
}

.inventory-advanced-summary::-webkit-details-marker {
    display: none;
}

.inventory-advanced-summary::after {
    margin-left: auto;
    color: var(--inventory-section-color);
    font-family: "tabler-icons";
    font-size: 1.1rem;
    content: "\ea5f";
    transition: transform 150ms ease;
}

details[open] > .inventory-advanced-summary::after {
    transform: rotate(180deg);
}

.inventory-detail-row {
    --inventory-row-accent: var(--inventory-section-accent, var(--app-primary));
    --inventory-row-color: var(--inventory-section-color, var(--app-primary-dark));
    --app-data-row-accent: var(--inventory-row-accent);
    --app-data-row-background: color-mix(
        in srgb,
        var(--inventory-row-accent) 2.5%,
        var(--app-surface)
    );
    --app-data-row-status-accent: var(--inventory-row-accent);
    --app-data-row-status-color: var(--inventory-row-color);
    border: 1px solid color-mix(in srgb, var(--app-border) 76%, transparent);
}

.inventory-detail-row--blue {
    --inventory-row-accent: var(--app-blue-accent);
    --inventory-row-color: var(--app-blue);
}

.inventory-detail-row--amber {
    --inventory-row-accent: var(--app-amber-accent);
    --inventory-row-color: var(--app-amber);
}

.inventory-detail-row--green {
    --inventory-row-accent: var(--app-sage-accent);
    --inventory-row-color: var(--app-green);
}

.inventory-detail-row--violet {
    --inventory-row-accent: var(--app-violet-accent);
    --inventory-row-color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.inventory-detail-row--coral {
    --inventory-row-accent: var(--app-coral-accent);
    --inventory-row-color: var(--app-red);
}

.inventory-detail-row-title a {
    color: inherit;
    text-decoration: none;
}

.inventory-detail-row-title a:hover,
.inventory-detail-row-title a:focus-visible {
    color: var(--inventory-row-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.inventory-reversal-form {
    min-width: 0;
    padding-top: 13px;
    margin-top: 13px;
}

.app-input-action {
    min-width: 0;
}

.app-input-action-label {
    display: inline-block;
    margin-bottom: 7px;
    color: var(--app-text-secondary);
    font-size: 0.78rem;
    font-weight: 750;
}

.app-input-action-group {
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.app-input-action-group > .form-control {
    min-width: 0;
    flex: 1 1 auto;
    border-right: 0;
    border-radius: var(--app-button-border-radius) 0 0 var(--app-button-border-radius);
}

.app-input-action-button {
    --app-input-action-accent: var(--app-primary);
    --app-input-action-color: var(--app-primary-dark);

    min-width: 112px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 13px;
    border: 1px solid
        color-mix(in srgb, var(--app-input-action-color) 34%, var(--app-border));
    border-radius: 0 var(--app-button-border-radius) var(--app-button-border-radius) 0;
    background: color-mix(in srgb, var(--app-input-action-accent) 16%, var(--app-surface));
    color: var(--app-input-action-color);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.app-input-action-button--coral {
    --app-input-action-accent: var(--app-coral-accent);
    --app-input-action-color: var(--app-red);
}

.app-input-action-button--amber {
    --app-input-action-accent: var(--app-amber-accent);
    --app-input-action-color: var(--app-amber);
}

.app-input-action-button--blue {
    --app-input-action-accent: var(--app-blue-accent);
    --app-input-action-color: var(--app-blue);
}

.app-input-action-button--violet {
    --app-input-action-accent: var(--app-violet-accent);
    --app-input-action-color:
        color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.app-input-action-button:hover,
.app-input-action-button:focus-visible {
    border-color:
        color-mix(in srgb, var(--app-input-action-color) 48%, var(--app-border));
    background: color-mix(in srgb, var(--app-input-action-accent) 26%, var(--app-surface));
    color: color-mix(in srgb, var(--app-input-action-color) 88%, var(--app-text));
}

.app-input-action-button:focus-visible {
    z-index: 2;
    outline: 2px solid
        color-mix(in srgb, var(--app-input-action-color) 58%, var(--app-border));
    outline-offset: 2px;
}

.app-input-action-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.inventory-detail-empty {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--app-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--inventory-section-accent) 4%, var(--app-surface));
    color: var(--app-text-secondary);
}

.inventory-section-card--action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.inventory-section-card--action > .app-section-heading {
    flex: 1 1 320px;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

@media (min-width: 1200px) {
    .app-equal-height-row > [class*="col-"] {
        display: flex;
    }

    .app-equal-height-row > [class*="col-"] > .app-surface {
        width: 100%;
        flex: 1 1 auto;
    }
}

@media (max-width: 767.98px) {
    .inventory-stock-record-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
        padding: 14px 0;
    }

    .inventory-stock-record-row dt,
    .inventory-stock-record-row dd {
        padding: 0;
    }

    .inventory-stock-record-row dd {
        border-left: 0;
    }

    .inventory-section-card {
        padding: 21px 18px;
    }

}

@media (min-width: 576px) and (max-width: 1099.98px) {
    .inventory-stock-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--app-content-gap);
    }

    .inventory-lot-status-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .inventory-section-card {
        --inventory-section-content-gap: 19px;
    }

    .inventory-section-card > .app-section-heading {
        padding-bottom: 16px;
    }

}

.app-workspace-toolbar,
.task-workspace-toolbar {
    min-width: 0;
    position: relative;
    display: grid;
    gap: 12px;
    padding: 16px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
}

:is(.app-workspace-toolbar, .task-workspace-toolbar)::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--app-primary);
    content: "";
}

.task-toolbar-panel {
    --task-toolbar-accent: var(--app-primary);
    --task-toolbar-ink: var(--app-primary-dark);
    min-width: 0;
    display: grid;
    gap: 11px;
    padding: 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--task-toolbar-accent) 8%, var(--app-surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--task-toolbar-accent) 15%, transparent);
}

.task-toolbar-panel--views {
    gap: 14px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.task-toolbar-panel--views .app-section-heading {
    margin-bottom: 18px;
}

.task-toolbar-panel--search,
.task-toolbar-panel--refine-sort {
    align-content: start;
    border: 0;
    background: var(--app-toolbar-panel-background);
    color: var(--app-text);
    box-shadow: none;
}

.app-workspace-toolbar-panel-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.app-workspace-toolbar-panel-heading > small {
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-workspace-toolbar-panel-label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--app-text-secondary);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-workspace-toolbar-panel-label > .ti {
    width: 20px;
    height: auto;
    display: inline-block;
    flex: 0 0 20px;
    border-radius: 0;
    background: transparent;
    color: var(--app-nav-icon);
    font-size: 1.15rem;
    text-align: center;
}

.task-quick-views {
    min-width: 0;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.task-quick-view {
    min-height: 38px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    font-size: 0.79rem;
    font-weight: 750;
    text-decoration: none;
}

.task-quick-view-count {
    min-width: 22px;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-size: 0.68rem;
    line-height: 1;
}

.task-quick-view.is-active .task-quick-view-count {
    background: rgb(255 255 255 / 17%);
}

.app-workspace-toolbar-row,
.task-workspace-toolbar-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
    align-items: stretch;
    gap: 12px;
}

.app-workspace-toolbar-row > .app-workspace-toolbar-panel,
.task-workspace-toolbar-row > .task-toolbar-panel {
    height: 100%;
    color: var(--app-text);
}

.app-toolbar-search {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.app-toolbar-search-control {
    min-width: 180px;
    position: relative;
    flex: 1 1 auto;
}

.app-toolbar-search-control > .ti {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: var(--app-primary-dark);
    transform: translateY(-50%);
    pointer-events: none;
}

.app-toolbar-search-control .form-control {
    min-height: 44px;
    padding-inline: 12px;
    border: 0;
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
}

.app-toolbar-search-control .form-control:focus {
    border: 0;
    background: var(--app-surface);
    color: var(--app-text);
}

.app-toolbar-filter-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--app-toolbar-panel-border);
}

.app-toolbar-active-filters {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.app-toolbar-active-filters-label {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    color: var(--app-text-secondary);
    font-size: 0.7rem;
    font-weight: 750;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-toolbar-active-filters-label .ti {
    width: 18px;
    color: var(--app-primary-dark);
    font-size: 1rem;
    text-align: center;
}

.app-toolbar-filter-button,
.app-toolbar-search-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    white-space: nowrap;
}

.app-toolbar-search-button {
    height: 44px;
    min-height: 44px;
    line-height: 1;
}

.app-toolbar-filter-button {
    min-height: 38px;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-button-border-radius);
    background: var(--app-surface);
    color: var(--app-text-secondary);
    font-family: inherit;
    font-size: 0.79rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    appearance: none;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.app-toolbar-filter-button > .ti {
    color: var(--app-primary-dark);
    font-size: 1rem;
}

.app-toolbar-filter-count {
    min-width: 20px;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--app-primary);
    color: var(--app-nav-active-foreground);
    font-size: 0.67rem;
    line-height: 1;
}

.app-toolbar-clear-filters {
    flex: 0 0 auto;
    white-space: nowrap;
}

.app-toolbar-filter-chips {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.app-toolbar-filter-chip {
    flex: 0 0 auto;
    border: 0;
    white-space: nowrap;
}

.app-filter-toolbar .app-workspace-toolbar-panel-label {
    color: var(--app-text);
}

.app-filter-toolbar .app-workspace-toolbar-panel-heading > small {
    color: var(--app-text);
}

.app-filter-toolbar .app-toolbar-search-control .form-control::placeholder {
    color: var(--app-text-secondary);
    opacity: 1;
}

.app-filter-toolbar .app-workspace-toolbar-panel-label > .ti,
.app-filter-toolbar .app-nav-flyout-link .ti {
    color: var(--app-primary-dark);
}

.app-filter-toolbar .app-nav-flyout-link {
    color: var(--app-text-secondary);
}

.app-filter-toolbar .app-nav-flyout-link:hover,
.app-filter-toolbar .app-nav-flyout-link:focus-visible,
.app-filter-toolbar .app-nav-flyout-link.is-highlighted {
    background: var(--app-surface);
    color: var(--app-text);
}

.app-filter-toolbar .task-sort-button:not(.is-active) {
    border-color: var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-secondary);
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.app-filter-toolbar .task-sort-button:not(.is-active):hover,
.app-filter-toolbar .task-sort-button:not(.is-active):focus-visible {
    border-color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 16%, var(--app-surface));
    color: var(--app-primary-dark);
}

.app-filter-toolbar .app-toolbar-filter-button {
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-secondary);
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.app-filter-toolbar .app-toolbar-filter-button:hover,
.app-filter-toolbar .app-toolbar-filter-button:focus-visible {
    border-color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 16%, var(--app-surface));
    color: var(--app-primary-dark);
}

.app-filter-toolbar .app-toolbar-filter-button:focus-visible {
    outline: 2px solid var(--app-primary);
    outline-offset: 1px;
}

.task-workspace-toolbar-row .app-nav-flyout-link.is-active {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: var(--app-nav-active-foreground);
}

.task-workspace-toolbar-row .app-nav-flyout-link.is-active .ti {
    color: currentColor;
}

.task-toolbar-panel--refine-sort .task-sort-links {
    align-items: center;
    justify-content: flex-start;
}

.task-results-heading-frame {
    --app-surface-frame-gap: var(--app-content-gap);
}

.task-results-heading {
    --task-results-accent: var(--app-violet-accent);
    min-width: 0;
    min-height: 69px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 16px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: var(--app-chrome-background);
    color: #ffffff;
    box-shadow: var(--app-surface-shadow);
}

.task-results-heading--overdue {
    --task-results-accent: var(--app-coral-accent);
}

.task-results-heading--today {
    --task-results-accent: var(--app-blue-accent);
}

.task-results-heading--completed {
    --task-results-accent: var(--app-primary);
}

.task-results-heading-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.task-results-heading-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 10px;
    background: rgb(255 255 255 / 7%);
    color: #ffffff;
    font-size: 1.05rem;
}

.task-results-heading-main > div {
    min-width: 0;
    display: grid;
    gap: 2px;
    overflow: hidden;
}

.task-results-heading h2 {
    margin: 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 1.03rem;
    font-weight: 850;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-results-heading-main > div > span {
    overflow: hidden;
    color: rgb(255 255 255 / 62%);
    font-size: 0.73rem;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-results-heading-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding-left: 16px;
    border-left: 1px solid rgb(255 255 255 / 14%);
    white-space: nowrap;
}

.task-results-heading-meta strong {
    color: var(--app-primary);
    font-size: 1.38rem;
    font-weight: 850;
    line-height: 1;
}

.task-results-heading-meta span {
    color: rgb(255 255 255 / 88%);
    font-size: 0.75rem;
    font-weight: 750;
}

.task-results-heading-count-compact {
    display: none;
}

.task-results-heading-meta small {
    margin-left: 3px;
    color: rgb(255 255 255 / 58%);
    font-size: 0.67rem;
    font-weight: 650;
}

.task-card-list {
    gap: var(--app-content-gap);
}

.task-work-item {
    --task-state-accent: var(--app-primary);
    --task-state-color: var(--app-primary-dark);
    min-width: 0;
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
    padding: 20px 20px 20px 24px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--app-surface);
    box-shadow: var(--app-surface-shadow);
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.task-work-item::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--task-state-accent);
    content: "";
}

.task-work-item:hover {
    border-color: transparent;
    box-shadow: var(--app-surface-shadow-hover);
    transform: translateY(-1px);
}

.task-work-item:focus-within {
    border-color: transparent;
    box-shadow: var(--app-surface-shadow);
}

.task-work-item--upcoming {
    --task-state-accent: var(--app-violet-accent);
    --task-state-color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
}

.task-work-item--overdue {
    --task-state-accent: var(--app-coral-accent);
    --task-state-color: var(--app-red);
}

.task-work-item--today {
    --task-state-accent: var(--app-blue-accent);
    --task-state-color: var(--app-blue);
}

.task-work-item--completed {
    --task-state-accent: var(--app-primary);
    --task-state-color: var(--app-primary-dark);
    background: linear-gradient(
        115deg,
        color-mix(in srgb, var(--task-state-accent) 7%, var(--app-surface)),
        var(--app-surface) 48%
    );
}

.task-work-item--completed .task-work-item-title a {
    color: var(--app-text-secondary);
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--task-state-color) 55%, transparent);
}

.task-work-item-status {
    --task-status-accent: var(--app-violet-accent);
    --task-status-color: color-mix(in srgb, var(--app-violet-accent) 82%, var(--app-text));
    --app-data-row-status-accent: var(--task-status-accent);
    --app-data-row-status-color: var(--task-status-color);
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
}

.task-work-item-status--complete {
    --task-status-accent: var(--app-primary);
    --task-status-color: var(--app-primary-dark);
}

.task-work-item-status--overdue {
    --task-status-accent: var(--app-coral-accent);
    --task-status-color: var(--app-red);
}

.task-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-status-compact-label {
    display: none;
    color: var(--task-status-color);
    font-size: 0.69rem;
    font-weight: 850;
    letter-spacing: 0.045em;
    line-height: 1;
    text-transform: uppercase;
}

.task-work-item-main {
    min-width: 0;
}

.task-work-item-context {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 9px;
}

.task-work-item-details {
    margin-bottom: 8px;
}

.task-work-item-title {
    margin: 0 0 6px;
    color: var(--app-text);
    font-size: 1.12rem;
    font-weight: 850;
    line-height: 1.3;
}

.task-work-item-title a {
    color: inherit;
    text-decoration: none;
}

.task-work-item-title a:hover,
.task-work-item-title a:focus-visible {
    color: var(--app-primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.task-work-item-description {
    display: -webkit-box;
    max-width: 920px;
    margin: 0;
    overflow: hidden;
    color: var(--app-text-secondary);
    font-size: 0.87rem;
    line-height: 1.52;
    overflow-wrap: anywhere;
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.task-work-item-description--empty {
    color: var(--app-muted);
    font-style: italic;
}

.task-read-more {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: var(--app-primary-dark);
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
}

.task-read-more:hover,
.task-read-more:focus-visible {
    color: var(--app-primary);
    text-decoration: underline;
}

.task-work-item-meta {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) repeat(3, minmax(120px, 1fr));
    gap: 12px 18px;
    align-items: center;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid color-mix(in srgb, var(--app-border) 72%, transparent);
}

.task-work-item-person {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.task-work-item-person .directory-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 0.69rem;
}

.task-work-item-person > span:last-child,
.task-work-item-meta-block {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.task-work-item-meta small {
    color: var(--app-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    line-height: 1;
    text-transform: uppercase;
}

.task-work-item-meta strong {
    min-width: 0;
    overflow: hidden;
    color: var(--app-text-secondary);
    font-size: 0.77rem;
    font-weight: 750;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-work-item-actions {
    display: grid;
    justify-items: stretch;
    gap: 6px;
}

.app-row-action-button,
.app-row-delete-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-inline: 11px;
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
}

.app-row-delete-button {
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-red);
}

.app-row-delete-button:hover,
.app-row-delete-button:focus-visible {
    border-color: color-mix(in srgb, var(--app-red) 42%, var(--app-border));
    background: color-mix(in srgb, var(--app-red) 8%, var(--app-surface));
    color: var(--app-red);
}

@media (max-width: 767.98px) {
    .app-row-action-button span,
    .app-row-delete-button span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

.task-advanced-filter-form .person-lookup-results {
    z-index: 8;
}

.task-workspace-drawer-placeholder {
    min-height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--app-muted);
    text-align: center;
}

.appointment-workspace-drawer-placeholder {
    min-height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--app-muted);
    text-align: center;
}

.appointment-workspace-drawer-placeholder > .ti {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--app-primary) 12%, var(--app-surface));
    color: var(--app-primary-dark);
    font-size: 1.35rem;
}

.appointment-workspace-drawer-placeholder p {
    max-width: 390px;
    margin: 0;
}

.task-workspace-drawer-placeholder > .ti {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--app-primary) 12%, var(--app-surface));
    color: var(--app-primary-dark);
    font-size: 1.35rem;
}

.task-workspace-drawer-placeholder p {
    max-width: 360px;
    margin: 0;
}

#task-workspace-drawer .app-drawer-body {
    padding: 0;
    overflow: hidden;
}

#appointment-create-drawer .app-drawer-body,
#appointment-workspace-drawer .app-drawer-body {
    padding: 0;
    overflow: hidden;
}

#appointment-create-drawer-content,
#appointment-workspace-drawer-content,
.appointment-workspace-drawer-content-inner {
    height: 100%;
    min-height: 0;
}

.appointment-workspace-drawer-content-inner {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.appointment-workspace-drawer-content-main {
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.appointment-workspace-drawer-actions {
    margin: 0;
}

.appointment-workspace-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--app-border);
}

.appointment-workspace-section > header {
    margin-bottom: 18px;
}

.appointment-workspace-section > header h3,
.appointment-workspace-section > header p {
    margin: 0;
}

.appointment-workspace-section > header h3 {
    font-size: 1rem;
}

.appointment-workspace-section > header > p:last-child {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 0.82rem;
}

.appointment-workspace-status-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.appointment-workspace-action-form {
    margin: 0;
}

.appointment-workspace-section--danger {
    border-top-color: color-mix(in srgb, var(--app-red) 28%, var(--app-border));
}

#add-patient-task-drawer .app-drawer-body {
    padding: 0;
    overflow: hidden;
}

#add-patient-task-drawer-content,
.patient-task-create-drawer-content-inner {
    height: 100%;
    min-height: 0;
}

.patient-task-create-drawer-content-inner {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.patient-task-create-drawer-main {
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.patient-task-create-drawer-actions {
    margin: 0;
}

#task-workspace-drawer-content,
.task-workspace-drawer-content-inner {
    height: 100%;
    min-height: 0;
}

.task-workspace-drawer-content-inner {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.task-workspace-drawer-content-main {
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.task-workspace-drawer-actions {
    margin: 0;
}

#task-workspace-drawer .task-workspace-form > .row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

#task-workspace-drawer .task-workspace-form > .row > div,
#task-workspace-drawer .task-form-primary-row > div,
#task-workspace-drawer .task-form-assignment-row > div {
    width: auto;
    padding: 0;
}

#task-workspace-drawer .task-form-primary-group,
#task-workspace-drawer .task-form-assignment-group,
#task-workspace-drawer .task-form-primary-row,
#task-workspace-drawer .task-form-assignment-row {
    display: contents;
}

#task-workspace-drawer .task-form-title {
    grid-column: 1 / 10;
    grid-row: 1;
}

#task-workspace-drawer .task-edit-completion {
    grid-column: 10 / -1;
    grid-row: 1;
    justify-self: end;
}

#task-workspace-drawer .task-form-due {
    grid-column: 1 / 7;
    grid-row: 2;
}

#task-workspace-drawer .task-form-category {
    grid-column: 7 / -1;
    grid-row: 2;
}

#task-workspace-drawer .task-form-author {
    grid-column: 1 / 7;
    grid-row: 3;
}

#task-workspace-drawer .task-form-assignee {
    grid-column: 7 / -1;
    grid-row: 3;
}

#task-workspace-drawer .task-form-related-group {
    grid-column: 1 / -1;
    grid-row: 4;
}

#task-workspace-drawer .task-form-description-group {
    grid-column: 1 / -1;
    grid-row: 5;
}

#task-workspace-drawer textarea[name="description"] {
    min-height: min(42vh, 360px);
    white-space: pre-wrap;
}

@media (max-width: 767.98px) {
    #task-workspace-drawer .task-workspace-form > .row > div,
    #task-workspace-drawer .task-form-primary-row > div,
    #task-workspace-drawer .task-form-assignment-row > div {
        grid-column: 1 / -1;
        grid-row: auto;
        justify-self: stretch;
    }
}

@media (max-width: 1799.98px) {
    .workspace-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .workspace-metric-card strong {
        font-size: clamp(1.25rem, 2vw, 1.5rem);
    }

    .task-toolbar-panel--refine-sort .app-workspace-toolbar-panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .task-toolbar-panel--refine-sort .app-workspace-toolbar-panel-heading > small {
        padding-left: 28px;
    }

    .task-work-item {
        grid-template-columns: 88px minmax(0, 1fr) auto;
        gap: 16px;
    }

    .task-work-item-meta {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 767.98px) {
    .app-workspace-toolbar-row,
    .task-workspace-toolbar-row {
        grid-template-columns: 1fr;
    }

    .app-toolbar-search {
        width: 100%;
        min-width: 0;
        flex-basis: auto;
    }

    .task-sort-links {
        justify-content: flex-start;
    }

    .task-results-heading-meta small {
        display: none;
    }

    .task-work-item {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 17px 17px 17px 21px;
    }

    .task-work-item-status {
        grid-column: 1;
        grid-row: 1;
    }

    .task-work-item-actions {
        grid-column: 2;
        grid-row: 1;
        display: flex;
    }

    .task-work-item-main {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 575.98px) {
    .workspace-metric-grid {
        grid-template-columns: 1fr;
    }

    .workspace-metric-card {
        min-height: 112px;
        padding-block: 18px 16px;
    }

    .app-workspace-toolbar,
    .task-workspace-toolbar {
        padding: 12px;
    }

    .app-workspace-toolbar-panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .app-workspace-toolbar-panel-heading > small {
        padding-left: 28px;
    }

    .app-toolbar-search {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .app-toolbar-filter-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-toolbar-active-filters {
        width: 100%;
        justify-content: flex-start;
    }

    .task-results-heading {
        min-height: 82px;
        gap: 10px;
        padding: 10px 12px;
    }

    .task-results-heading-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 10px;
    }

    .task-results-heading h2 {
        display: -webkit-box;
        font-size: 0.9rem;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .task-results-heading-main > div > span {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.65rem;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .task-results-heading-meta {
        gap: 5px;
        padding-left: 10px;
    }

    .task-results-heading-meta strong {
        font-size: 1.2rem;
    }

    .task-results-heading-meta span {
        font-size: 0.67rem;
    }

    .task-results-heading-count-full {
        display: none;
    }

    .task-results-heading-count-compact {
        display: inline;
    }

    .task-work-item {
        gap: 13px 8px;
    }

    .task-work-item-actions {
        gap: 3px;
    }

    .task-work-item-meta {
        grid-template-columns: 1fr;
    }

    .task-work-item-meta strong {
        white-space: normal;
    }

    .task-directory-related-user {
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .workspace-metric-card,
    .task-work-item {
        transition: none;
    }

    .workspace-metric-card:hover,
    .workspace-metric-card:focus-visible,
    .task-work-item:hover {
        transform: none;
    }
}

/*
 * Record rows must reveal their content instead of replacing it with an
 * ellipsis. Controls and status badges retain their own compact behavior.
 */
.app-data-row .app-data-row-title,
.app-data-row .app-data-row-subtitle,
.app-data-row .app-data-row-field > strong,
.app-data-row .app-data-row-field > span,
.app-data-row .app-data-row-fields > div > strong,
.app-data-row .app-data-row-fields > div > span,
.app-data-row .directory-work-item-meta-block > span:not(.status-label),
.app-data-row .inventory-setting-row-details,
.app-data-row .task-work-item-meta strong,
.app-data-row .task-identity-details strong,
.app-data-row .task-identity-details small,
.app-data-row .task-directory-related-user span {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.app-data-row .inventory-product-title {
    overflow: hidden;
    overflow-wrap: normal;
    white-space: nowrap;
}

.app-data-row .inventory-product-title > a {
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Appointment calendar */
.app-content:has(> .appointment-calendar-workspace) {
    padding-bottom: var(--app-content-gap);
}

.appointment-calendar-workspace {
    gap: 14px;
    min-height: calc(100dvh - var(--app-sticky-content-top) - var(--app-content-gap));
    grid-template-rows: minmax(0, 1fr);
}

.appointment-calendar-workspace .page-heading h1 {
    font-size: 1.5rem;
}

.appointment-calendar-page-heading {
    flex: 0 0 auto;
    margin: 0;
    padding: 20px 18px;
    overflow: visible;
    border: 0;
    border-bottom: 1px solid var(--app-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.appointment-calendar-page-heading::after {
    content: none;
}

.appointment-calendar-page-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
}

.appointment-calendar-page-summary .ti {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.appointment-calendar-page-timezone {
    margin-top: 5px;
}

.appointment-calendar-page-timezone + .appointment-calendar-page-summary {
    margin-top: 3px;
}

.appointment-calendar-frame {
    --appointment-calendar-unavailable: #f4e2e4;
    --fc-monarch-background: var(--app-surface);
    --fc-monarch-foreground: var(--app-text);
    --fc-monarch-primary: var(--app-primary-dark);
    --fc-monarch-primary-foreground: #ffffff;
    --fc-monarch-event: var(--app-primary);
    --fc-monarch-event-contrast: #ffffff;
    --fc-monarch-secondary: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
    --fc-monarch-secondary-foreground: var(--app-primary-dark);
    --fc-monarch-muted: color-mix(in srgb, var(--app-border) 52%, var(--app-surface));
    --fc-monarch-muted-foreground: var(--app-muted);
    --fc-monarch-border: var(--app-border);
    --fc-monarch-ring: rgb(var(--app-primary-hover-rgb) / 32%);
    --fc-monarch-faint: var(--appointment-calendar-unavailable);
    --fc-monarch-now: var(--app-red);
    --fc-monarch-today: color-mix(in srgb, var(--app-primary) 7%, var(--app-surface));
    --fc-monarch-highlight: color-mix(in srgb, var(--app-primary) 20%, transparent);
    min-height: 0;
    align-self: stretch;
}

.appointment-calendar-surface {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.appointment-calendar-toolbar {
    min-height: 48px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(320px, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--app-border);
}

.appointment-calendar-toolbar .btn {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.2;
}

.appointment-calendar-toolbar .btn .ti {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.appointment-calendar-toolbar .btn:not(.appointment-calendar-arrow) {
    padding-block: 6px 4px;
}

.appointment-calendar-navigation,
.appointment-calendar-view-switch,
.appointment-calendar-toolbar-actions {
    display: flex;
    align-items: center;
}

.appointment-calendar-navigation {
    flex-wrap: wrap;
    gap: 4px;
}

.appointment-calendar-scope-switch {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    margin: 0 0 0 4px;
    padding-left: 3.75rem;
    border-left: 1px solid var(--app-border);
}

.appointment-calendar-scope-switch .form-check-input {
    flex: 0 0 auto;
}

.appointment-calendar-scope-switch .form-check-label {
    margin-left: 6px;
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.appointment-calendar-view-switch {
    justify-content: flex-end;
}

.appointment-calendar-toolbar-actions {
    min-width: 0;
    justify-content: flex-end;
    gap: 8px;
}

.appointment-calendar-view-switch .btn {
    min-width: 54px;
    border-radius: 0;
}

.appointment-calendar-view-switch .btn:first-child {
    border-radius: var(--app-button-border-radius) 0 0 var(--app-button-border-radius);
}

.appointment-calendar-view-switch .btn:last-child {
    border-radius: 0 var(--app-button-border-radius) var(--app-button-border-radius) 0;
}

.appointment-calendar-view-switch .btn + .btn {
    margin-left: -1px;
}

.appointment-calendar-arrow {
    width: 30px;
    padding-inline: 0;
}

.appointment-calendar-arrow .ti,
.appointment-calendar-jump-button .ti,
.appointment-calendar-filter-button .ti {
    font-size: 1.05rem;
}

.appointment-calendar-jump-button,
.appointment-calendar-filter-button {
    width: 30px;
    flex: 0 0 30px;
    padding-inline: 0;
}

.appointment-calendar-filter-drawer-form {
    margin: 0;
}

.appointment-calendar-scroll {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    padding: 0;
    overscroll-behavior-inline: contain;
}

.appointment-calendar {
    height: 100% !important;
    min-width: 0;
    color: var(--app-text);
    font-family: inherit;
}

body > [role="dialog"][id^="fc:"] {
    z-index: calc(var(--app-z-sticky-surface) + 1) !important;
}

body.appointment-calendar-popover-open {
    overflow: hidden;
}

.appointment-calendar-popover-backdrop {
    position: fixed;
    z-index: calc(var(--app-z-sticky-surface) + 2);
    inset: 0;
    background: rgb(15 41 61 / 38%);
    backdrop-filter: blur(2px);
}

body > [role="dialog"].appointment-calendar-popover[id^="fc:"] {
    width: min(560px, calc(100vw - 32px));
    max-width: none;
    max-height: min(720px, calc(100dvh - 32px));
    position: fixed !important;
    z-index: calc(var(--app-z-sticky-surface) + 3) !important;
    inset: 50% auto auto 50% !important;
    overflow: hidden;
    transform: translate(-50%, -50%);
}

.appointment-calendar-popover-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

#appointment-calendar [role="grid"] {
    border-top-width: 0;
    border-right-width: 0;
    border-left-width: 0;
    border-radius: 0;
}

/* MultiMonth adds a framed viewport around its accessible month list. The
   surrounding application surface already provides the calendar boundary. */
.appointment-calendar-scroll[data-calendar-view="year"]
    #appointment-calendar > div > div:has(> div > [role="list"][aria-label]) {
    border: 0;
    border-bottom: 1px solid var(--app-border);
    border-radius: 0;
}

.appointment-calendar-scroll:is([data-calendar-view="day"], [data-calendar-view="week"])
    #appointment-calendar [role="columnheader"] > div > div {
    margin: 4px 6px 0;
}

.appointment-calendar-scroll:is([data-calendar-view="day"], [data-calendar-view="week"])
    #appointment-calendar [role="columnheader"] > div > div > :first-child {
    font-size: 0.625rem;
    line-height: 0.75rem;
}

.appointment-calendar-scroll:is([data-calendar-view="day"], [data-calendar-view="week"])
    #appointment-calendar [role="columnheader"] > div > div > :last-child {
    width: 24px;
    height: 24px;
    margin: 1px;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.appointment-calendar-scroll:is([data-calendar-view="day"], [data-calendar-view="week"])
    #appointment-calendar [data-time] > div > div {
    margin: 4px 8px 4px 6px;
    font-size: 0.75rem;
    line-height: 1rem;
}

.appointment-calendar-toolbar,
.appointment-calendar-legend {
    flex: 0 0 auto;
}

@media (max-width: 991.98px) {
    .appointment-calendar-frame {
        position: relative;
        top: auto;
    }
}

.cogniveon-calendar-event {
    border-radius: 7px;
    box-shadow: 0 2px 7px rgb(26 42 56 / 16%);
    font-size: 0.76rem;
    font-weight: 650;
}

.cogniveon-calendar-event:focus-visible {
    outline: 3px solid rgb(var(--app-primary-hover-rgb) / 35%);
    outline-offset: 2px;
}

/* MultiMonth fixes its event limit to available cell height. Make foreground
   appointments exceed that limit so every appointment is represented by the
   count link; popover events live outside this scoped calendar container. */
.appointment-calendar-scroll[data-calendar-view="year"] .cogniveon-calendar-event {
    min-height: 100vh;
}

.appointment-calendar-count-link {
    width: max-content;
    max-width: calc(100% - 8px);
    margin: 4px;
    padding: 3px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#appointment-calendar .appointment-calendar-count-link--pending {
    border-color: color-mix(in srgb, var(--app-blue) 30%, var(--app-border));
    background: color-mix(in srgb, var(--app-blue) 17%, var(--app-surface));
    color: var(--app-blue);
}

#appointment-calendar .appointment-calendar-count-link--pending:hover,
#appointment-calendar .appointment-calendar-count-link--pending:focus-visible {
    border-color: var(--app-blue);
    background: color-mix(in srgb, var(--app-blue) 25%, var(--app-surface));
    color: color-mix(in srgb, var(--app-blue) 86%, var(--app-text));
}

#appointment-calendar .appointment-calendar-count-link--complete {
    border-color: color-mix(in srgb, var(--app-green) 30%, var(--app-border));
    background: color-mix(in srgb, var(--app-green) 17%, var(--app-surface));
    color: var(--app-green);
}

#appointment-calendar .appointment-calendar-count-link--complete:hover,
#appointment-calendar .appointment-calendar-count-link--complete:focus-visible {
    border-color: var(--app-green);
    background: color-mix(in srgb, var(--app-green) 25%, var(--app-surface));
    color: color-mix(in srgb, var(--app-green) 86%, var(--app-text));
}

.appointment-calendar-count-link:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 1px;
}

.cogniveon-calendar-first-slot-header,
.cogniveon-calendar-first-slot-header > * > * {
    display: block !important;
    position: relative;
    z-index: 2;
}

.cogniveon-calendar-first-slot-header > * > * {
    transform: translateY(16px);
}

.cogniveon-calendar-closure {
    border-color: var(--appointment-calendar-unavailable) !important;
    background: var(--appointment-calendar-unavailable) !important;
    color: var(--app-red) !important;
    opacity: 1 !important;
}

.appointment-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 12px 18px 15px;
    color: var(--app-muted);
    font-size: 0.75rem;
}

.appointment-calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.appointment-calendar-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--appointment-status-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--appointment-status-color) 17%, transparent);
}

.appointment-calendar-selection {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid color-mix(in srgb, var(--app-primary) 28%, var(--app-border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--app-primary) 7%, var(--app-surface));
}

.appointment-calendar-selection-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--app-primary) 18%, var(--app-surface));
    color: var(--app-primary-dark);
}

.appointment-calendar-selection > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.appointment-calendar-selection strong {
    color: var(--app-primary-dark);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.appointment-calendar-selection span:not(.appointment-calendar-selection-icon) {
    color: var(--app-text);
    font-weight: 700;
}

.appointment-calendar-selection small {
    color: var(--app-muted);
}

@media (max-width: 1199.98px) {
    .appointment-calendar-toolbar {
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 767.98px) {
    .appointment-calendar-toolbar {
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .appointment-calendar-navigation,
    .appointment-calendar-view-switch {
        justify-content: flex-start;
    }

    .appointment-calendar-toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .appointment-calendar-view-switch {
        min-width: 0;
        flex: 1 1 auto;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .appointment-calendar-view-switch .btn {
        min-width: 60px;
        flex: 1 0 auto;
    }

    .appointment-calendar-scroll[data-calendar-view="week"] .appointment-calendar {
        min-width: 720px;
    }

    .appointment-calendar-legend {
        padding-inline: 13px;
    }
}

@media (max-width: 479.98px) {
    .appointment-calendar-navigation .btn:last-child {
        margin-left: auto;
    }
}

.media-library-upload-frame {
    display: flex;
    align-items: stretch;
}

.media-library-upload-frame > .app-surface {
    width: 100%;
}

.media-dropzone {
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 28px;
    border: 2px dashed color-mix(in srgb, var(--app-primary) 38%, var(--app-border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--app-primary) 3%, var(--app-surface));
    cursor: pointer;
    text-align: center;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.media-dropzone:hover,
.media-dropzone.is-dragging {
    border-color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 9%, var(--app-surface));
}

.media-dropzone.is-dragging {
    transform: translateY(-2px);
}

.media-dropzone:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--app-primary) 40%, transparent);
    outline-offset: 3px;
}

.media-dropzone-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--app-primary) 14%, var(--app-surface));
    color: var(--app-primary-dark);
    font-size: 1.75rem;
}

.media-upload-queue {
    display: grid;
    gap: 14px;
    width: min(100%, 320px);
}

.media-upload-item {
    display: grid;
    gap: 5px;
}

.media-upload-name {
    color: var(--app-text);
    font-size: 0.88rem;
    font-weight: 700;
}

.media-upload-progress {
    position: relative;
    height: 22px;
    overflow: hidden;
    border-radius: 5px;
    background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface-muted));
}

.media-upload-progress-bar {
    display: block;
    width: 0;
    height: 100%;
    background: var(--app-primary);
    transition: width 120ms linear, background-color 160ms ease;
}

.media-upload-progress-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--app-text);
    font-size: 0.76rem;
    font-weight: 800;
}

.media-upload-item.is-uploading .media-upload-progress-label,
.media-upload-item.is-success .media-upload-progress-label,
.media-upload-item.is-error .media-upload-progress-label {
    color: #fff;
    text-shadow: 0 1px 2px rgb(0 0 0 / 25%);
}

.media-upload-item.is-success .media-upload-progress-bar {
    background: var(--app-primary);
}

.media-upload-item.is-error .media-upload-progress-bar {
    background: var(--bs-danger);
}

.media-upload-error {
    display: inline-flex;
    align-items: flex-start;
    gap: 5px;
    color: var(--bs-danger-text-emphasis);
    font-size: 0.8rem;
    line-height: 1.35;
}

.media-upload-error[hidden] {
    display: none;
}

.media-upload-error .ti {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 0.92rem;
}

.media-library-search {
    margin-bottom: 24px;
}

.media-library-group + .media-library-group {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--app-border);
}

.media-library-group-heading {
    margin-bottom: 16px;
}

.media-library-group-heading h3 {
    margin: 0;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 800;
}

.media-library-group-heading p {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 0.82rem;
}

.media-library-list-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--app-border);
    border-radius: 10px;
}

.media-library-list {
    min-width: 820px;
    color: var(--app-text);
    font-size: 0.84rem;
    vertical-align: middle;
}

.media-library-list thead th {
    padding: 10px 12px;
    border-bottom-color: var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.media-library-list tbody td {
    padding: 12px;
    border-color: var(--app-border);
}

.media-library-list tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--app-primary) 2%, var(--app-surface));
}

.media-library-list tbody tr:hover td {
    background: color-mix(in srgb, var(--app-primary) 5%, var(--app-surface));
}

.media-library-thumbnail-column,
.media-library-thumbnail-cell {
    width: 105px;
}

.media-library-thumbnail {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: color-mix(in srgb, var(--app-primary) 4%, var(--app-surface-muted));
    color: var(--app-primary-dark);
    font-size: 2.25rem;
}

.media-library-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-library-file-cell {
    width: 34%;
}

.media-library-file-cell > strong,
.media-library-filename {
    display: block;
}

.media-library-file-cell > strong a {
    color: var(--app-text);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.media-library-file-cell > strong a:hover {
    color: var(--app-primary-dark);
    text-decoration: underline;
}

.media-library-filename {
    margin-top: 2px;
    color: var(--app-muted);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.media-library-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 7px;
    font-size: 0.78rem;
}

.media-library-row-actions a,
.media-library-row-action {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--app-primary-dark);
    line-height: inherit;
    text-decoration: none;
}

.media-library-row-actions a:hover,
.media-library-row-action:hover {
    text-decoration: underline;
}

.media-library-delete-action {
    color: var(--bs-danger-text-emphasis);
}

.media-library-delete-error {
    flex-basis: 100%;
    color: var(--bs-danger-text-emphasis);
    font-size: 0.76rem;
}

.media-library-delete-error[hidden] {
    display: none;
}

.media-library-source {
    display: inline-flex;
    padding: 3px 7px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface-muted);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.media-library-list td[data-label="Details"] span {
    display: block;
    white-space: nowrap;
}

.media-library-empty {
    height: 120px;
    color: var(--app-muted);
    text-align: center;
}

.media-library-empty > span {
    display: inline-block;
    margin: 0 4px;
}

.media-library-empty .ti {
    font-size: 1.4rem;
    vertical-align: middle;
}

@media (max-width: 767.98px) {
    .media-library-list-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .media-library-list,
    .media-library-list tbody {
        display: block;
        min-width: 0;
    }

    .media-library-list thead {
        display: none;
    }

    .media-library-list tr[data-media-row] {
        display: grid;
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 4px 12px;
        padding: 12px 0;
        border-bottom: 1px solid var(--app-border);
    }

    .media-library-list tbody tr[data-media-row] td {
        display: flex;
        grid-column: 2;
        gap: 8px;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .media-library-list tbody tr[data-media-row] .media-library-thumbnail-cell {
        display: block;
        grid-column: 1;
        grid-row: 1 / span 5;
        width: 80px;
    }

    .media-library-list tbody tr[data-media-row] .media-library-file-cell {
        display: block;
        width: auto;
    }

    .media-library-list td[data-label]::before {
        flex: 0 0 64px;
        color: var(--app-muted);
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 700;
    }

    .media-library-list .media-library-file-cell::before,
    .media-library-list .media-library-thumbnail-cell::before {
        content: none;
    }

    .media-library-empty {
        display: table-cell;
        width: 100%;
    }
}

@media (max-width: 479.98px) {
    .media-dropzone {
        min-height: 170px;
        padding: 22px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .media-dropzone {
        transition: none;
    }
}
