* {
    box-sizing: border-box;
}

/* Modern application navigation ------------------------------------------ */
.app-body {
    --app-sidebar-collapsed: 76px;
    --app-sidebar-expanded: 264px;
    --app-purple: #6161ff;
    --app-purple-dark: #5034ff;
    --app-nav-text: #4b4d5c;
    background: #f6f7fb;
}

.app-sidebar {
    width: var(--app-sidebar-collapsed);
    padding: 16px 12px;
    border-right: 1px solid #e6e7eb;
    color: #323338;
    background: #ffffff;
    box-shadow: 4px 0 18px rgba(50, 51, 56, 0.04);
    transition: width 180ms ease, box-shadow 180ms ease;
}

.app-sidebar:hover,
.app-sidebar:focus-within,
.app-body.is-sidebar-pinned .app-sidebar {
    width: var(--app-sidebar-expanded);
    box-shadow: 12px 0 34px rgba(50, 51, 56, 0.12);
}

.app-sidebar-header {
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid #ececf1;
}

.app-brand {
    gap: 12px;
    min-height: 46px;
    color: #323338;
}

.app-brand:hover {
    color: #323338;
}

.app-brand-mark {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--app-purple-dark), #0085ff);
    box-shadow: 0 7px 16px rgba(97, 97, 255, 0.24);
    font-size: 12px;
    letter-spacing: -0.02em;
}

.app-brand-text {
    display: grid;
    gap: 1px;
    line-height: 1.1;
}

.app-brand-text strong {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.app-brand-text small {
    color: #9293a3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-nav-main {
    margin-top: 18px;
    padding-right: 0;
    scrollbar-color: #d0d1d7 transparent;
    scrollbar-width: thin;
}

.app-nav {
    gap: 5px;
}

.app-nav-footer {
    padding-top: 12px;
    border-top: 1px solid #ececf1;
}

.app-nav-link {
    gap: 14px;
    min-height: 46px;
    border-radius: 9px;
    padding: 0 15px;
    color: var(--app-nav-text);
    font-size: 14px;
    font-weight: 600;
    transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.app-nav-group-toggle {
    color: var(--app-nav-text);
}

.app-nav-link:hover,
.app-nav-link:focus,
.app-sidebar-toggle:hover,
.app-sidebar-toggle:focus {
    color: #323338;
    background: #f0f0ff;
}

.app-nav-link:hover .app-nav-icon,
.app-nav-link:focus .app-nav-icon {
    color: var(--app-purple-dark);
}

.app-nav-link.is-active {
    color: var(--app-purple-dark);
    background: #eeeeff;
    font-weight: 700;
}

.app-nav-link.is-active::after {
    top: 9px;
    right: auto;
    bottom: 9px;
    left: 0;
    width: 3px;
    height: auto;
    border-radius: 0 4px 4px 0;
    background: var(--app-purple);
}

.app-nav-icon {
    color: #676879;
    stroke-width: 1.9;
    transition: color 140ms ease;
}

.app-nav-link.is-active .app-nav-icon {
    color: var(--app-purple-dark);
}

.app-nav-chevron {
    color: #9293a3;
}

.app-sidebar-toggle {
    min-height: 40px;
    border-color: #e6e7eb;
    border-radius: 9px;
    color: #676879;
    background: #f7f7fb;
    font-size: 13px;
    font-weight: 600;
}

.app-sidebar-toggle[aria-pressed="true"] {
    color: var(--app-purple-dark);
    border-color: #cacaFF;
    background: #eeeeff;
}

.app-nav-submenu {
    gap: 3px;
    padding-left: 44px;
}

.app-nav-sublink {
    position: relative;
    min-height: 34px;
    border-radius: 7px;
    color: #676879;
    font-size: 13px;
    font-weight: 600;
}

.app-nav-sublink:hover,
.app-nav-sublink:focus,
.app-nav-sublink.is-active {
    color: #323338;
    background: #f0f0ff;
}

.app-nav-sublink.is-active {
    color: var(--app-purple-dark);
    box-shadow: inset 2px 0 0 var(--app-purple);
}

.app-shell {
    padding-left: var(--app-sidebar-collapsed);
}

.app-body.is-sidebar-pinned .app-shell {
    padding-left: var(--app-sidebar-expanded);
}

.app-topbar {
    min-height: 82px;
    padding: 14px 30px;
    border-bottom: 1px solid #e6e7eb;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 3px 14px rgba(50, 51, 56, 0.04);
}

.app-sidebar:hover + .app-shell .app-topbar,
.app-sidebar:focus-within + .app-shell .app-topbar {
    margin-left: calc(var(--app-sidebar-expanded) - var(--app-sidebar-collapsed));
}

.app-body.is-sidebar-pinned .app-topbar,
.app-body.is-sidebar-pinned .app-sidebar:hover + .app-shell .app-topbar,
.app-body.is-sidebar-pinned .app-sidebar:focus-within + .app-shell .app-topbar {
    margin-left: 0;
}

.topbar-workspace {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.topbar-workspace-mark {
    display: inline-grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 10px;
    color: var(--app-purple-dark);
    background: #eeeeff;
}

.topbar-workspace > div {
    min-width: 0;
}

.app-topbar h1 {
    overflow: hidden;
    margin-top: 3px;
    color: #323338;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar .app-kicker {
    color: #9293a3;
    font-size: 10px;
    letter-spacing: 0.1em;
}

.topbar-actions {
    gap: 10px;
}

.user-chip {
    position: relative;
    min-height: 44px;
    padding: 0 14px 0 5px;
    border-color: #e6e7eb;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(50, 51, 56, 0.05);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00c875, #00a86b);
    font-size: 13px;
}

.user-avatar::after {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 9px;
    height: 9px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #00c875;
    content: "";
}

.user-chip-text {
    color: #4b4d5c;
    font-size: 13px;
    font-weight: 700;
}

.topbar-link {
    gap: 7px;
    min-height: 42px;
    padding: 0 13px;
    border-color: transparent;
    border-radius: 9px;
    color: #676879;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
}

.topbar-link:hover {
    border-color: transparent;
    color: var(--app-purple-dark);
    background: #f0f0ff;
}

@media (max-width: 760px) {
    .app-body {
        --app-sidebar-collapsed: 64px;
        --app-sidebar-expanded: min(248px, 86vw);
    }

    .app-sidebar {
        padding: 12px 8px;
    }

    .app-brand-mark {
        flex-basis: 46px;
    }

    .app-topbar {
        gap: 12px;
        padding: 14px 16px;
    }

    .app-sidebar:hover + .app-shell .app-topbar,
    .app-sidebar:focus-within + .app-shell .app-topbar,
    .app-body.is-sidebar-pinned .app-topbar {
        margin-left: calc(var(--app-sidebar-expanded) - var(--app-sidebar-collapsed));
    }

    .app-body.is-sidebar-pinned .app-topbar,
    .app-body.is-sidebar-pinned .app-sidebar:hover + .app-shell .app-topbar,
    .app-body.is-sidebar-pinned .app-sidebar:focus-within + .app-shell .app-topbar {
        margin-left: 0;
    }

    .topbar-workspace-mark {
        display: none;
    }

    .app-topbar h1 {
        max-width: calc(100vw - 110px);
        font-size: 18px;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .user-chip {
        max-width: calc(100% - 92px);
    }
}

/* Semantic application buttons ------------------------------------------- */
.app-body .button,
.app-body .compact-button {
    min-height: 42px;
    border: 1px solid #00a86b;
    border-radius: 9px;
    padding: 0 16px;
    color: #ffffff;
    background: #00a86b;
    box-shadow: 0 3px 9px rgba(0, 168, 107, 0.16);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: color 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.app-body .button:hover,
.app-body .button:focus-visible,
.app-body .compact-button:hover,
.app-body .compact-button:focus-visible {
    border-color: #008f5b;
    color: #ffffff;
    background: #008f5b;
    box-shadow: 0 5px 13px rgba(0, 143, 91, 0.2);
    outline: none;
    transform: translateY(-1px);
}

/* Blue: navigation to another page. */
.app-body a.button:not([href="#"]),
.app-body .button-navigation {
    border-color: #6161ff;
    color: #ffffff;
    background: #6161ff;
    box-shadow: 0 3px 9px rgba(97, 97, 255, 0.17);
}

.app-body a.button:not([href="#"]):hover,
.app-body a.button:not([href="#"]):focus-visible,
.app-body .button-navigation:hover,
.app-body .button-navigation:focus-visible {
    border-color: #5034ff;
    color: #ffffff;
    background: #5034ff;
    box-shadow: 0 5px 13px rgba(80, 52, 255, 0.22);
}

/* White: view, popup, cancel, and neutral same-page actions. */
.app-body .button-secondary,
.app-body .button-view,
.app-body a.button[href="#"],
.app-body .icon-button {
    border-color: #d8d9df;
    color: #4b4d5c;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(50, 51, 56, 0.06);
}

.app-body .button-secondary:hover,
.app-body .button-secondary:focus-visible,
.app-body .button-view:hover,
.app-body .button-view:focus-visible,
.app-body a.button[href="#"]:hover,
.app-body a.button[href="#"]:focus-visible,
.app-body .icon-button:hover,
.app-body .icon-button:focus-visible {
    border-color: #a9a9ff;
    color: #5034ff;
    background: #f7f7ff;
    box-shadow: 0 4px 10px rgba(97, 97, 255, 0.12);
    outline: none;
}

/* Red: destructive actions. */
.app-body .button.button-danger,
.app-body .button.button-delete,
.app-body .icon-button[data-delete],
.app-body .icon-button[data-remove],
.app-body .icon-button[title*="delete" i],
.app-body .icon-button[title*="remove" i],
.app-body .icon-button[aria-label*="delete" i],
.app-body .icon-button[aria-label*="remove" i] {
    border-color: #e2445c;
    color: #ffffff;
    background: #e2445c;
    box-shadow: 0 3px 9px rgba(226, 68, 92, 0.17);
}

.app-body .button.button-danger:hover,
.app-body .button.button-danger:focus-visible,
.app-body .button.button-delete:hover,
.app-body .button.button-delete:focus-visible,
.app-body .icon-button[data-delete]:hover,
.app-body .icon-button[data-delete]:focus-visible,
.app-body .icon-button[data-remove]:hover,
.app-body .icon-button[data-remove]:focus-visible,
.app-body .icon-button[title*="delete" i]:hover,
.app-body .icon-button[title*="remove" i]:hover,
.app-body .icon-button[aria-label*="delete" i]:hover,
.app-body .icon-button[aria-label*="remove" i]:hover {
    border-color: #c92f47;
    color: #ffffff;
    background: #c92f47;
    box-shadow: 0 5px 13px rgba(201, 47, 71, 0.22);
}

/* Yellow: file downloads. Kept last so it overrides navigation blue. */
.app-body .button-download,
.app-body a.button[download],
.app-body a.button[data-document-download],
.app-body a.button[href*="document_file.php"],
.app-body a.button[href*="download"] {
    border-color: #fdab3d;
    color: #4a3515;
    background: #fdab3d;
    box-shadow: 0 3px 9px rgba(253, 171, 61, 0.2);
}

.app-body .button-download:hover,
.app-body .button-download:focus-visible,
.app-body a.button[download]:hover,
.app-body a.button[download]:focus-visible,
.app-body a.button[data-document-download]:hover,
.app-body a.button[data-document-download]:focus-visible,
.app-body a.button[href*="document_file.php"]:hover,
.app-body a.button[href*="document_file.php"]:focus-visible,
.app-body a.button[href*="download"]:hover,
.app-body a.button[href*="download"]:focus-visible {
    border-color: #e89a2f;
    color: #3c2a10;
    background: #f3a32f;
    box-shadow: 0 5px 13px rgba(232, 154, 47, 0.24);
}

.app-body .button:active,
.app-body .compact-button:active,
.app-body .icon-button:active {
    box-shadow: none;
    transform: translateY(0);
}

.app-body .button:disabled,
.app-body .compact-button:disabled,
.app-body .icon-button:disabled,
.app-body .button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

/* Table controls retain the shared 36px alignment. */
.app-body .data-table .table-button,
.app-body .data-table .table-action,
.app-body .data-table .table-view-action {
    min-height: 36px;
}

@media (prefers-reduced-motion: reduce) {
    .app-body .button,
    .app-body .compact-button,
    .app-body .icon-button {
        transition: none;
    }
}

@media (max-width: 460px) {
    .user-chip-text {
        display: none;
    }

    .user-chip {
        padding-right: 5px;
    }

    .topbar-link span {
        display: none;
    }

    .topbar-link {
        justify-content: center;
        width: 42px;
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar,
    .app-shell,
    .app-topbar,
    .app-nav-link,
    .app-nav-icon {
        transition: none;
    }
}

/* Global workspace search. */
.app-body .global-search {
    position: relative;
    flex: 1 1 420px;
    width: min(100%, 520px);
    max-width: 520px;
    margin: 0 auto;
}

.app-body .global-search-control {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    border: 1px solid #e1e2e8;
    border-radius: 10px;
    padding: 0 11px 0 13px;
    color: #9293a3;
    background: #f7f7fb;
    font-weight: 400;
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.app-body .global-search-control:focus-within {
    border-color: #a9a9ff;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(97, 97, 255, 0.12);
}

.app-body .global-search-control input {
    min-width: 0;
    min-height: 0;
    flex: 1;
    border: 0;
    padding: 0;
    color: #323338;
    background: transparent;
    box-shadow: none;
    outline: none;
    font-size: 14px;
}

.app-body .global-search-control input:focus {
    border: 0;
    box-shadow: none;
    outline: none;
}

.app-body .global-search-control kbd {
    border: 1px solid #d8d9df;
    border-radius: 5px;
    padding: 2px 6px;
    color: #9293a3;
    background: #ffffff;
    box-shadow: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
}

.app-body .global-search-dropdown {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    left: 0;
    z-index: 45;
    overflow: hidden;
    border: 1px solid #e6e7eb;
    border-radius: 12px;
    padding: 6px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(50, 51, 56, 0.17);
}

.app-body .global-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    border-radius: 8px;
    padding: 9px 11px;
    color: #323338;
    text-decoration: none;
}

.app-body .global-search-result:hover,
.app-body .global-search-result:focus,
.app-body .global-search-result.is-active {
    color: #323338;
    background: #f0f0ff;
    outline: none;
}

.app-body .global-search-result-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.app-body .global-search-result-copy strong,
.app-body .global-search-result-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-body .global-search-result-copy strong {
    font-size: 13px;
}

.app-body .global-search-result-copy small {
    color: #9293a3;
    font-size: 11px;
}

.app-body .global-search-module {
    flex: 0 0 auto;
    max-width: 145px;
    overflow: hidden;
    border-radius: 999px;
    padding: 4px 8px;
    color: #5034ff;
    background: #eeeeff;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-body .global-search-message {
    margin: 0;
    padding: 16px 12px;
    color: #676879;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 980px) {
    .app-body .global-search {
        flex-basis: 280px;
        max-width: 360px;
    }

    .app-body .global-search-control kbd {
        display: none;
    }
}

@media (max-width: 760px) {
    .app-body .global-search {
        order: 3;
        width: 100%;
        max-width: none;
        flex-basis: auto;
        margin: 0;
    }

    .app-body .topbar-actions {
        position: absolute;
        top: 14px;
        right: 16px;
        width: auto;
    }
}

@media (max-width: 460px) {
    .app-body .global-search-module {
        max-width: 105px;
    }
}

/* Stable module colors shared by global search and sidebar navigation. */
.app-body [data-module="dashboard"] { --module-color: #6161ff; --module-soft: #eeeeff; }
.app-body [data-module="company_data"] { --module-color: #0085ff; --module-soft: #e9f4ff; }
.app-body [data-module="masterdata_customers_suppliers"] { --module-color: #0085ff; --module-soft: #e9f4ff; }
.app-body [data-module="masterdata_contacts"] { --module-color: #00a6a6; --module-soft: #e5f8f7; }
.app-body [data-module="masterdata_departments"] { --module-color: #a25ddc; --module-soft: #f5ecfb; }
.app-body [data-module="masterdata_employees"] { --module-color: #00a86b; --module-soft: #e8f8f1; }
.app-body [data-module="product_data"] { --module-color: #fdab3d; --module-soft: #fff4e3; }
.app-body [data-module="masterdata_products_materials"] { --module-color: #e88b00; --module-soft: #fff3df; }
.app-body [data-module="families"] { --module-color: #9b51e0; --module-soft: #f4eafa; }
.app-body [data-module="characteristics"] { --module-color: #e2448f; --module-soft: #fcebf3; }
.app-body [data-module="measurement_devices"] { --module-color: #00a9d6; --module-soft: #e5f7fc; }
.app-body [data-module="core_tools"] { --module-color: #6161ff; --module-soft: #eeeeff; }
.app-body [data-module="quality_control"] { --module-color: #00c875; --module-soft: #e7f9f1; }
.app-body [data-module="improvement"] { --module-color: #e2445c; --module-soft: #fcebed; }
.app-body [data-module="administration"] { --module-color: #579bfc; --module-soft: #eaf3ff; }
.app-body [data-module="documents"] { --module-color: #784bd1; --module-soft: #f0eafa; }
.app-body [data-module="settings"] { --module-color: #676879; --module-soft: #eff0f3; }

.app-body .global-search-result[data-module] {
    position: relative;
    padding-left: 10px;
}

.app-body .global-search-accent {
    flex: 0 0 4px;
    align-self: stretch;
    min-height: 34px;
    border-radius: 999px;
    background: var(--module-color, #6161ff);
}

.app-body .global-search-result[data-module]:hover,
.app-body .global-search-result[data-module]:focus,
.app-body .global-search-result[data-module].is-active {
    background: var(--module-soft, #eeeeff);
}

.app-body .global-search-result[data-module] .global-search-module {
    color: var(--module-color, #5034ff);
    background: var(--module-soft, #eeeeff);
}

.app-body .app-nav-link[data-module] .app-nav-icon {
    color: var(--module-color, #676879);
}

.app-body .app-nav-link[data-module]:hover,
.app-body .app-nav-link[data-module]:focus,
.app-body .app-nav-link[data-module].is-active {
    color: var(--module-color, #5034ff);
    background: var(--module-soft, #eeeeff);
}

.app-body .app-nav-link[data-module].is-active::after {
    background: var(--module-color, #6161ff);
}

.app-body .app-nav-sublink[data-module] {
    gap: 8px;
}

.app-body .app-nav-sublink[data-module]::before {
    width: 3px;
    height: 16px;
    flex: 0 0 3px;
    border-radius: 999px;
    background: var(--module-color, #9293a3);
    content: "";
}

.app-body .app-nav-sublink[data-module]:hover,
.app-body .app-nav-sublink[data-module]:focus,
.app-body .app-nav-sublink[data-module].is-active {
    color: var(--module-color, #5034ff);
    background: var(--module-soft, #eeeeff);
}

.app-body .app-nav-sublink[data-module].is-active {
    box-shadow: none;
}

/* Restore the saved sidebar state before enabling motion on a new page. */
.app-body:not(.is-shell-ready) .app-sidebar,
.app-body:not(.is-shell-ready) .app-shell,
.app-body:not(.is-shell-ready) .app-topbar,
.app-body:not(.is-shell-ready) .app-brand-text,
.app-body:not(.is-shell-ready) .app-nav-label,
.app-body:not(.is-shell-ready) .app-nav-submenu,
.app-body:not(.is-shell-ready) .app-nav-chevron {
    transition: none !important;
    transition-delay: 0ms !important;
}

/* Modern application tables ---------------------------------------------- */
.app-body .data-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #e1e2e8;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(50, 51, 56, 0.05);
}

.app-body .data-table {
    color: #323338;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.app-body .data-table th,
.app-body .data-table td {
    border-bottom: 1px solid #ececf1;
    padding: 10px 14px;
    line-height: 1.35;
    text-align: left;
    vertical-align: middle;
}

.app-body .data-table th {
    height: 44px;
    color: #676879;
    background: #f6f7fb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-body .data-table tbody td {
    height: 56px;
    background: #ffffff;
    transition: background-color 120ms ease;
}

.app-body .data-table tbody tr:hover td {
    background: #f8f8ff;
}

.app-body .data-table tbody tr:last-child td {
    border-bottom: 0;
}

.app-body .data-table tbody tr:focus-within td {
    background: #f3f3ff;
}

.app-body .data-table th:first-child,
.app-body .data-table td:first-child {
    padding-left: 18px;
}

.app-body .data-table th:last-child,
.app-body .data-table td:last-child {
    padding-right: 18px;
    vertical-align: middle;
}

.app-body .data-table td.table-view-column,
.app-body .data-table th.table-view-column {
    padding-right: 6px;
    padding-left: 10px;
    text-align: center;
    vertical-align: middle;
}

.app-body .data-table .table-action,
.app-body .data-table .table-view-action {
    display: inline-grid;
    width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    place-items: center;
    border-color: #dedfe5;
    border-radius: 8px;
    color: #676879;
    background: #ffffff;
    vertical-align: middle;
}

.app-body .data-table .table-action:hover,
.app-body .data-table .table-action:focus,
.app-body .data-table .table-view-action:hover,
.app-body .data-table .table-view-action:focus {
    border-color: #a9a9ff;
    color: #5034ff;
    background: #f0f0ff;
    box-shadow: 0 0 0 2px rgba(97, 97, 255, 0.1);
}

.app-body .data-table .table-button {
    min-height: 36px;
    margin: 0;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 1;
    vertical-align: middle;
}

.app-body .data-table td > .table-action,
.app-body .data-table td > .table-button,
.app-body .data-table td > .document-inline-form,
.app-body .data-table td > .document-action-buttons {
    vertical-align: middle;
}

.app-body .document-action-buttons {
    min-height: 36px;
    align-items: center;
}

.app-body .data-table .status-pill {
    min-height: 26px;
    line-height: 1;
    vertical-align: middle;
}

.app-body .table-link,
.app-body .detail-link {
    color: #4d4fc4;
    font-weight: 700;
}

.app-body .table-link:hover,
.app-body .table-link:focus,
.app-body .detail-link:hover,
.app-body .detail-link:focus {
    color: #5034ff;
}

.app-body .table-empty {
    height: 90px !important;
    color: #9293a3;
    background: #ffffff !important;
    font-weight: 500;
    text-align: center;
}

.app-body .dataTable-wrapper,
.app-body .datatable-wrapper {
    gap: 0;
}

.app-body .dataTable-top,
.app-body .datatable-top,
.app-body .dataTable-bottom,
.app-body .datatable-bottom {
    padding: 14px 16px;
    border-color: #ececf1;
    background: #ffffff;
}

.app-body .dataTable-selector,
.app-body .dataTable-input,
.app-body .datatable-selector,
.app-body .datatable-input {
    min-height: 38px !important;
    border-color: #d8d9df;
    border-radius: 8px;
    color: #323338;
    background-color: #ffffff;
}

.app-body .dataTable-input:focus,
.app-body .datatable-input:focus,
.app-body .dataTable-selector:focus,
.app-body .datatable-selector:focus {
    border-color: #a9a9ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(97, 97, 255, 0.12);
}

.app-body .dataTable-info,
.app-body .datatable-info {
    color: #9293a3;
    font-weight: 600;
}

.app-body .dataTable-pagination a,
.app-body .datatable-pagination a {
    min-width: 34px;
    min-height: 34px;
    border-color: transparent;
    border-radius: 8px;
    color: #676879;
}

.app-body .dataTable-pagination a:hover,
.app-body .dataTable-pagination .active a,
.app-body .datatable-pagination a:hover,
.app-body .datatable-pagination .datatable-active a {
    border-color: transparent;
    color: #5034ff;
    background: #eeeeff;
}

@media (max-width: 760px) {
    .app-body .data-table th,
    .app-body .data-table td {
        padding-right: 12px;
        padding-left: 12px;
    }

    .app-body .data-table th:first-child,
    .app-body .data-table td:first-child {
        padding-left: 14px;
    }
}

:root {
    --bs-body-font-family: Arial, Helvetica, sans-serif;
    --bs-body-color: #17202a;
    --bs-body-bg: #eef3f5;
    --bs-primary: #188098;
    --bs-primary-rgb: 24, 128, 152;
    --bs-link-color: #126b7f;
    --bs-link-hover-color: #0f5969;
    --bs-border-color: #dce5e8;
    --bs-border-radius: 6px;
    --bs-border-radius-sm: 6px;
    --bs-border-radius-lg: 8px;
    --bs-focus-ring-color: rgba(24, 128, 152, 0.18);
    --qct-navy: #17313a;
    --qct-teal: #188098;
    --qct-teal-dark: #126b7f;
    --qct-gold: #f2b84b;
    --qct-page-bg: #eef3f5;
    --qct-panel-bg: #ffffff;
    --qct-soft-bg: #f8fafc;
    --qct-border: #dce5e8;
    --qct-text: #17202a;
    --qct-muted: #52636a;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #17202a;
    background: #f4f7f9;
}

.btn,
.form-control,
.form-select,
.card,
.modal-content,
.dropdown-menu {
    border-radius: 6px;
}

.btn {
    min-height: 42px;
    font-weight: 700;
}

.btn-primary {
    --bs-btn-bg: #188098;
    --bs-btn-border-color: #188098;
    --bs-btn-hover-bg: #126b7f;
    --bs-btn-hover-border-color: #126b7f;
    --bs-btn-active-bg: #126b7f;
    --bs-btn-active-border-color: #126b7f;
}

.btn-outline-secondary {
    --bs-btn-color: #17202a;
    --bs-btn-border-color: #c9d6da;
    --bs-btn-hover-color: #126b7f;
    --bs-btn-hover-bg: #f8fafc;
    --bs-btn-hover-border-color: #188098;
}

.form-control,
.form-select {
    min-height: 40px;
    border-color: #c9d6da;
    color: #17202a;
    font-weight: 400;
}

.form-select,
select:not([data-searchable-select]):not(.qct-native-select-hidden) {
    width: 100%;
    min-height: 40px;
    border: 1px solid #c9d6da;
    border-radius: 6px;
    padding: 8px 36px 8px 10px;
    color: #17202a;
    background-color: #ffffff;
    background-image: linear-gradient(45deg, transparent 50%, #61717f 50%), linear-gradient(135deg, #61717f 50%, transparent 50%);
    background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    box-shadow: none;
    font: inherit;
    font-weight: 400;
    appearance: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #188098;
    box-shadow: 0 0 0 3px rgba(24, 128, 152, 0.18);
}

select:not([data-searchable-select]):not(.qct-native-select-hidden):focus {
    border-color: #188098;
    box-shadow: 0 0 0 3px rgba(24, 128, 152, 0.18);
    outline: none;
}

.card,
.modal-content {
    border-color: #dce5e8;
}

a {
    color: #126b7f;
}

[hidden] {
    display: none !important;
}

.auth-page,
.dashboard-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.auth-shell {
    width: min(100%, 920px);
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    background: #ffffff;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(23, 32, 42, 0.08);
}

.auth-intro {
    padding: 42px;
    background: #17313a;
    color: #ffffff;
}

.auth-intro h1,
.auth-card h1,
.dashboard-card h1 {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.15;
}

.auth-intro p,
.auth-card p,
.dashboard-card p {
    margin: 0;
    line-height: 1.55;
}

.auth-card,
.dashboard-card {
    padding: 42px;
    background: #ffffff;
}

.form-grid {
    display: grid;
    gap: 16px;
    margin-top: 26px;
}

.two-columns {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    font-size: 14px;
}

input {
    width: 100%;
    border: 1px solid #c9d6da;
    border-radius: 6px;
    padding: 12px 13px;
    font: inherit;
    color: #17202a;
    background: #ffffff;
}

textarea {
    width: 100%;
    border: 1px solid #c9d6da;
    border-radius: 6px;
    padding: 12px 13px;
    font: inherit;
    font-weight: 400;
    color: #17202a;
    background: #ffffff;
    resize: vertical;
}

input:focus {
    outline: 3px solid rgba(24, 128, 152, 0.18);
    border-color: #188098;
}

textarea:focus {
    outline: 3px solid rgba(24, 128, 152, 0.18);
    border-color: #188098;
}

input.is-invalid {
    border-color: #dc2626;
}

input.is-invalid:focus {
    outline-color: rgba(220, 38, 38, 0.18);
    border-color: #dc2626;
}

input.is-valid {
    border-color: #15803d;
}

input.is-valid:focus {
    outline-color: rgba(21, 128, 61, 0.18);
    border-color: #15803d;
}

.password-strength {
    display: grid;
    gap: 7px;
    margin-top: -6px;
}

.password-strength-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce5e8;
}

.password-strength-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #b91c1c;
    transition: width 160ms ease, background 160ms ease;
}

.password-strength[data-strength="1"] .password-strength-bar {
    width: 25%;
    background: #dc2626;
}

.password-strength[data-strength="2"] .password-strength-bar {
    width: 50%;
    background: #d97706;
}

.password-strength[data-strength="3"] .password-strength-bar {
    width: 75%;
    background: #188098;
}

.password-strength[data-strength="4"] .password-strength-bar {
    width: 100%;
    background: #15803d;
}

.password-strength-text {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #52636a;
}

.field-message {
    min-height: 18px;
    margin: -8px 0 0;
    font-size: 13px;
    font-weight: 700;
    color: #52636a;
}

.field-message.is-invalid {
    color: #dc2626;
}

.field-message.is-valid {
    color: #15803d;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 45px;
    border: 0;
    border-radius: 6px;
    padding: 0 18px;
    font: inherit;
    font-weight: 700;
    color: #ffffff;
    background: #188098;
    cursor: pointer;
    text-decoration: none;
}

.button:hover {
    background: #126b7f;
}

.button-secondary {
    color: #17202a;
    background: #ffffff;
    border: 1px solid #c9d6da;
}

.button-secondary:hover {
    color: #126b7f;
    background: #f8fafc;
    border-color: #188098;
}

.button-danger {
    background: #b91c1c;
}

.button-danger:hover {
    background: #991b1b;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.button:disabled:hover {
    background: #188098;
}

.auth-switch {
    margin-top: 20px;
    font-size: 14px;
}

.alert {
    margin-top: 20px;
    border-radius: 6px;
    padding: 12px 14px;
    line-height: 1.45;
}

.alert-error {
    color: #7a1d1d;
    background: #fde8e8;
    border: 1px solid #f7b8b8;
}

.alert-success {
    color: #14532d;
    background: #dcfce7;
    border: 1px solid #86efac;
}

.error-list {
    margin: 0;
    padding-left: 18px;
}

/* Login page -------------------------------------------------------------- */
.login-page {
    color: #323338;
    background: #f7f7fb;
}

.login-page .login-auth-page {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 40px 24px;
    background:
        radial-gradient(circle at 8% 12%, rgba(97, 97, 255, 0.13) 0, rgba(97, 97, 255, 0) 28%),
        radial-gradient(circle at 92% 88%, rgba(0, 200, 117, 0.12) 0, rgba(0, 200, 117, 0) 25%),
        #f7f7fb;
}

.login-page .login-auth-page::before,
.login-page .login-auth-page::after {
    position: absolute;
    z-index: -1;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(97, 97, 255, 0.14);
    border-radius: 42px;
    content: "";
    transform: rotate(24deg);
}

.login-page .login-auth-page::before {
    top: -105px;
    right: 8%;
}

.login-page .login-auth-page::after {
    bottom: -125px;
    left: 5%;
    border-color: rgba(0, 133, 255, 0.13);
}

.login-page .login-auth-shell {
    width: min(100%, 1060px);
    min-height: 650px;
    grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
    border: 1px solid rgba(50, 51, 56, 0.08);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(50, 51, 56, 0.14);
}

.login-page .login-auth-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 48px 52px;
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.16), transparent 28%),
        linear-gradient(145deg, #5034ff 0%, #6161ff 54%, #0085ff 100%);
}

.login-page .login-auth-intro::after {
    position: absolute;
    right: -50px;
    bottom: 54px;
    width: 190px;
    height: 190px;
    border: 34px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    content: "";
}

.login-page .login-brand {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 12px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.login-page .login-brand-mark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 28px;
    height: 28px;
    padding: 5px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
}

.login-page .login-brand-mark span {
    width: 4px;
    border-radius: 3px;
    background: #ffffff;
    transform: rotate(30deg);
}

.login-page .login-brand-mark span:nth-child(1) { height: 9px; }
.login-page .login-brand-mark span:nth-child(2) { height: 16px; }
.login-page .login-brand-mark span:nth-child(3) { height: 12px; }

.login-page .login-intro-content {
    position: relative;
    z-index: 1;
    margin: auto 0;
}

.login-page .login-eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-page .login-auth-intro h1 {
    max-width: 430px;
    margin-bottom: 20px;
    font-size: clamp(36px, 4vw, 50px);
    line-height: 1.06;
    letter-spacing: -0.045em;
}

.login-page .login-auth-intro p {
    max-width: 430px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 17px;
}

.login-page .login-benefits {
    display: grid;
    gap: 13px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
}

.login-page .login-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-page .login-benefits li span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    color: #5034ff;
    background: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.login-page .login-intro-footnote {
    position: relative;
    z-index: 1;
    font-size: 12px;
}

.login-page .login-auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 62px 64px;
}

.login-page .login-card-header h1 {
    margin-bottom: 10px;
    color: #323338;
    font-size: 36px;
    letter-spacing: -0.035em;
}

.login-page .login-card-header p {
    color: #676879;
    font-size: 16px;
}

.login-page .login-mobile-brand {
    display: none;
}

.login-page .login-form {
    gap: 20px;
    margin-top: 32px;
}

.login-page .login-field {
    gap: 9px;
    color: #323338;
    font-size: 14px;
    font-weight: 600;
}

.login-page .login-field input {
    min-height: 52px;
    border-color: #c5c7d0;
    border-radius: 9px;
    padding: 13px 15px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-page .login-field input::placeholder {
    color: #9293a3;
}

.login-page .login-field input:hover {
    border-color: #9699a6;
}

.login-page .login-field input:focus {
    border-color: #6161ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(97, 97, 255, 0.16);
}

.login-page .login-submit {
    justify-content: space-between;
    min-height: 52px;
    margin-top: 4px;
    border-radius: 9px;
    padding: 0 20px;
    background: #6161ff;
    box-shadow: 0 8px 20px rgba(97, 97, 255, 0.22);
    transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.login-page .login-forgot-password {
    margin-top: -10px;
    text-align: right;
}

.login-page .login-forgot-password a {
    color: #5034ff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.login-page .login-forgot-password a:hover {
    text-decoration: underline;
}

.password-reset-page .password-reset-card {
    min-height: 500px;
}

.password-reset-page .password-reset-message-card {
    text-align: center;
}

.password-reset-status-icon {
    display: inline-grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 24px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #00a86b;
    box-shadow: 0 10px 24px rgba(0, 168, 107, 0.2);
    font-size: 25px;
    font-weight: 800;
}

.password-reset-status-icon.is-error {
    background: #d83a52;
    box-shadow: 0 10px 24px rgba(216, 58, 82, 0.2);
}

.password-reset-page .password-reset-help {
    margin-top: 20px;
    color: #9293a3;
    font-size: 13px;
    text-align: center;
}

.password-reset-page .password-reset-errors {
    margin: 0;
    padding-left: 18px;
}

.login-page .login-submit:hover {
    background: #5034ff;
    box-shadow: 0 10px 24px rgba(80, 52, 255, 0.28);
    transform: translateY(-1px);
}

.login-page .login-submit:focus-visible {
    outline: 3px solid rgba(97, 97, 255, 0.25);
    outline-offset: 3px;
}

.login-page .login-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 24px;
    border-color: #ffd0d6;
    border-radius: 9px;
    padding: 13px 14px;
    color: #8f2230;
    background: #fff2f4;
    font-size: 14px;
}

.login-page .login-alert-icon {
    display: inline-grid;
    flex: 0 0 21px;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #d83a52;
    font-size: 12px;
    font-weight: 800;
}

.login-page .login-auth-switch {
    margin-top: 26px;
    color: #676879;
    text-align: center;
}

.login-page .login-auth-switch a {
    color: #5034ff;
    font-weight: 700;
    text-decoration: none;
}

.login-page .login-auth-switch a:hover {
    text-decoration: underline;
}

/* Login uses a focused single-card layout; registration retains the split view. */
.login-page:not(.register-page) .login-auth-shell {
    width: min(100%, 500px);
    min-height: auto;
    grid-template-columns: 1fr;
}

.login-page:not(.register-page) .login-auth-card {
    min-height: 540px;
    padding: 58px 56px;
}

.login-page:not(.register-page) .login-card-brand {
    display: block;
    position: relative;
    overflow: hidden;
    margin: -58px -56px 42px;
    padding: 42px 56px 48px;
    color: #ffffff;
    background:
        radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.22), transparent 28%),
        linear-gradient(125deg, #5034ff 0%, #6161ff 58%, #0085ff 100%);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-align: center;
    text-shadow: 0 2px 12px rgba(35, 25, 120, 0.18);
}

.login-page:not(.register-page) .login-card-brand::before {
    position: absolute;
    top: -62px;
    right: -34px;
    width: 150px;
    height: 150px;
    border: 24px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
}

.login-page:not(.register-page) .login-card-brand::after {
    position: absolute;
    right: -5%;
    bottom: -1px;
    left: -5%;
    height: 22px;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    background: #ffffff;
    content: "";
}

@media (max-width: 820px) {
    .login-page .login-auth-page {
        align-items: center;
        padding: 24px 18px;
    }

    .login-page .login-auth-shell {
        width: min(100%, 520px);
        min-height: auto;
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    .login-page .login-auth-intro {
        display: none;
    }

    .login-page .login-auth-card {
        padding: 46px 40px;
    }

    .login-page .login-mobile-brand {
        display: block;
        margin-bottom: 34px;
        color: #5034ff;
        font-size: 16px;
        font-weight: 800;
        letter-spacing: -0.02em;
    }
}

@media (max-width: 480px) {
    .login-page .login-auth-page {
        padding: 14px;
    }

    .login-page .login-auth-card {
        padding: 34px 24px;
    }

    .login-page .login-card-header h1 {
        font-size: 31px;
    }

    .login-page:not(.register-page) .login-auth-card {
        min-height: auto;
        padding: 38px 24px;
    }

    .login-page:not(.register-page) .login-card-brand {
        margin: -38px -24px 34px;
        padding: 32px 24px 38px;
        font-size: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-page .login-field input,
    .login-page .login-submit {
        transition: none;
    }
}

/* Registration additions: extends the modern auth layout above. */
.register-page .register-auth-page {
    padding-top: 28px;
    padding-bottom: 28px;
}

.register-page .register-auth-shell {
    width: min(100%, 1120px);
    min-height: 720px;
    grid-template-columns: minmax(360px, 0.9fr) minmax(500px, 1.1fr);
}

.register-page .register-auth-card {
    padding: 46px 60px;
}

.register-page .register-form {
    gap: 16px;
    margin-top: 26px;
}

.register-page .register-name-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.register-page .password-strength {
    gap: 6px;
    margin-top: -8px;
}

.register-page .password-strength-track {
    height: 6px;
    background: #e6e7eb;
}

.register-page .password-strength-text,
.register-page .field-message {
    color: #676879;
    font-size: 12px;
    font-weight: 600;
}

.register-page .field-message {
    min-height: 14px;
    margin-top: -10px;
}

.register-page .register-success {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 22px;
    border-color: #b8ead2;
    border-radius: 9px;
    padding: 13px 14px;
    color: #12613d;
    background: #effbf5;
    font-size: 14px;
}

.register-page .register-success-icon {
    display: inline-grid;
    flex: 0 0 21px;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #00a86b;
    font-size: 12px;
    font-weight: 800;
}

.register-page .login-alert .error-list {
    padding-left: 18px;
}

@media (max-width: 920px) {
    .register-page .register-auth-shell {
        width: min(100%, 650px);
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .register-page .register-auth-intro {
        display: none;
    }

    .register-page .register-auth-card {
        padding: 46px 48px;
    }

    .register-page .login-mobile-brand {
        display: block;
    }
}

@media (max-width: 560px) {
    .register-page .register-auth-page {
        padding: 14px;
    }

    .register-page .register-auth-card {
        padding: 34px 24px;
    }

    .register-page .register-name-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    width: min(100%, 720px);
    border: 1px solid #dce5e8;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(23, 32, 42, 0.08);
}

.dashboard-actions {
    margin-top: 26px;
}

.app-body {
    min-height: 100vh;
    background: #eef3f5;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: 76px;
    overflow: hidden;
    padding: 18px 12px;
    background: #17313a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transition: width 180ms ease, box-shadow 180ms ease;
    transition-delay: 0ms;
}

.app-sidebar:hover,
.app-sidebar:focus-within,
.app-body.is-sidebar-pinned .app-sidebar {
    width: 256px;
    box-shadow: 18px 0 36px rgba(23, 32, 42, 0.16);
}

.app-sidebar:hover {
    transition-delay: 250ms;
}

.app-sidebar:focus-within,
.app-body.is-sidebar-pinned .app-sidebar {
    transition-delay: 0ms;
}

.app-sidebar-header {
    display: grid;
    gap: 14px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    color: #ffffff;
    text-decoration: none;
}

.app-brand-mark {
    display: inline-grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    font-weight: 800;
    background: #f2b84b;
    color: #17202a;
}

.app-brand-text,
.app-nav-label {
    opacity: 0;
    white-space: nowrap;
    transform: translateX(-8px);
    transition: opacity 140ms ease, transform 140ms ease;
    transition-delay: 0ms;
}

.app-sidebar:hover .app-brand-text,
.app-sidebar:hover .app-nav-label {
    transition-delay: 250ms;
}

.app-sidebar:focus-within .app-brand-text,
.app-sidebar:focus-within .app-nav-label,
.app-body.is-sidebar-pinned .app-brand-text,
.app-body.is-sidebar-pinned .app-nav-label {
    opacity: 1;
    transform: translateX(0);
}

.app-sidebar:hover .app-brand-text,
.app-sidebar:hover .app-nav-label {
    opacity: 1;
    transform: translateX(0);
}

.app-nav {
    display: grid;
    align-content: start;
    grid-auto-rows: max-content;
    gap: 6px;
}

.app-nav-main {
    flex: 1;
    min-height: 0;
    margin-top: 28px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}

.app-nav-footer {
    margin-top: 12px;
}

.app-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    border-radius: 8px;
    padding: 0 14px;
    color: #d9e6e8;
    text-decoration: none;
}

.app-nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.app-nav-chevron {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-left: auto;
    opacity: 0;
    transform: rotate(0deg);
    transition: opacity 140ms ease, transform 140ms ease;
}

.app-sidebar:hover .app-nav-chevron,
.app-sidebar:focus-within .app-nav-chevron,
.app-body.is-sidebar-pinned .app-nav-chevron {
    opacity: 1;
}

.app-nav-group.is-open .app-nav-chevron {
    transform: rotate(90deg);
}

.app-sidebar-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0 13px;
    color: #d9e6e8;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.app-nav-link:hover,
.app-nav-link:focus,
.app-sidebar-toggle:hover,
.app-sidebar-toggle:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.app-sidebar-toggle[aria-pressed="true"] {
    color: #ffffff;
    border-color: rgba(242, 184, 75, 0.55);
    background: rgba(242, 184, 75, 0.14);
}

.app-nav-link.is-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.app-nav-link.is-active::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 7px;
    left: 14px;
    height: 2px;
    border-radius: 999px;
    background: #f2b84b;
}

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

.app-nav-submenu {
    display: grid;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    padding-left: 36px;
    opacity: 0;
    transition: max-height 180ms ease, opacity 140ms ease;
    transition-delay: 0ms;
}

.app-sidebar:hover .app-nav-group.is-open .app-nav-submenu,
.app-sidebar:focus-within .app-nav-group.is-open .app-nav-submenu,
.app-body.is-sidebar-pinned .app-nav-group.is-open .app-nav-submenu {
    max-height: 320px;
    opacity: 1;
}

.app-sidebar:hover .app-nav-group.is-open .app-nav-submenu {
    transition-delay: 250ms;
}

.app-sidebar:focus-within .app-nav-group.is-open .app-nav-submenu,
.app-body.is-sidebar-pinned .app-nav-group.is-open .app-nav-submenu {
    transition-delay: 0ms;
}

.app-nav-sublink {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 32px;
    border-radius: 7px;
    padding: 0 10px;
    color: #c9d6da;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.app-nav-sublink:hover,
.app-nav-sublink:focus,
.app-nav-sublink.is-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.app-nav-sublink.is-active {
    box-shadow: inset 2px 0 0 #f2b84b;
}

.app-nav-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    max-width: 22px;
    max-height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-nav-link svg {
    display: block;
    flex: 0 0 22px;
}

.app-shell {
    min-height: 100vh;
    padding-left: 76px;
    transition: padding-left 180ms ease;
}

.app-body.is-sidebar-pinned .app-shell {
    padding-left: 256px;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
    padding: 14px 30px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid #dce5e8;
    backdrop-filter: blur(12px);
    margin-left: 0;
    transition: margin-left 180ms ease;
    transition-delay: 0ms;
}

.app-sidebar:hover + .app-shell .app-topbar {
    margin-left: 180px;
    transition-delay: 250ms;
}

.app-sidebar:focus-within + .app-shell .app-topbar,
.app-body.is-sidebar-pinned .app-topbar {
    margin-left: 180px;
    transition-delay: 0ms;
}

.app-body.is-sidebar-pinned .app-topbar,
.app-body.is-sidebar-pinned .app-sidebar:hover + .app-shell .app-topbar,
.app-body.is-sidebar-pinned .app-sidebar:focus-within + .app-shell .app-topbar {
    margin-left: 0;
    transition-delay: 0ms;
}

.app-topbar h1 {
    margin: 2px 0 0;
    font-size: 22px;
    line-height: 1.2;
}

.app-kicker {
    margin: 0;
    color: #61717f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    max-width: 260px;
    padding: 0 12px 0 4px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.user-avatar {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 7px;
    background: #188098;
    color: #ffffff;
    font-weight: 800;
}

.user-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #c9d6da;
    border-radius: 8px;
    color: #17202a;
    font-weight: 700;
    text-decoration: none;
    background: #ffffff;
}

.topbar-link:hover {
    border-color: #188098;
    color: #126b7f;
}

.app-main {
    display: grid;
    gap: 22px;
    padding: 30px;
}

.dashboard-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding: 30px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.dashboard-hero h2 {
    margin: 6px 0 10px;
    font-size: 30px;
    line-height: 1.2;
}

.dashboard-hero p {
    margin: 0;
    color: #52636a;
}

.account-summary {
    display: grid;
    gap: 6px;
    min-width: 150px;
    padding: 14px 16px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #f8fafc;
}

.account-summary span,
.metric-card span {
    color: #61717f;
    font-size: 13px;
    font-weight: 700;
}

.account-summary strong {
    font-size: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    display: grid;
    gap: 12px;
    min-height: 126px;
    padding: 22px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.metric-card strong {
    font-size: 34px;
    line-height: 1;
}

.settings-panel {
    display: grid;
    gap: 22px;
    padding: 30px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.settings-header h2 {
    margin: 6px 0 10px;
    font-size: 30px;
    line-height: 1.2;
}

.settings-header p {
    margin: 0;
    color: #52636a;
}

.settings-actions,
.settings-edit-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid #c9d6da;
    border-radius: 8px;
    color: #17202a;
    background: #ffffff;
    cursor: pointer;
}

.icon-button:hover,
.icon-button:focus {
    color: #126b7f;
    border-color: #188098;
    outline: none;
}

.settings-message,
.settings-errors {
    margin-top: 0;
}

.settings-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #dce5e8;
}

.settings-tab {
    min-height: 42px;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 0 14px;
    color: #52636a;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.settings-tab:hover,
.settings-tab:focus {
    color: #126b7f;
    outline: none;
}

.settings-tab.is-active {
    color: #17202a;
    border-color: #f2b84b;
}

.settings-tab-panel {
    display: grid;
    gap: 22px;
}

.settings-form,
.settings-section {
    display: grid;
    gap: 22px;
}

.settings-section {
    padding-top: 22px;
    border-top: 1px solid #dce5e8;
}

.settings-section h3 {
    margin: 0;
    font-size: 19px;
    line-height: 1.25;
}

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.section-heading-row p {
    margin: 6px 0 0;
    color: #52636a;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.settings-grid label {
    min-height: 72px;
    padding: 11px 12px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #f8fafc;
}

.settings-grid input,
.settings-grid select {
    margin-top: 0;
    padding: 9px 10px;
    font-weight: 400;
}

select {
    width: 100%;
    border: 1px solid #c9d6da;
    border-radius: 6px;
    min-height: 40px;
    padding: 8px 36px 8px 10px;
    font: inherit;
    font-weight: 400;
    color: #17202a;
    background: #ffffff;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #61717f 50%), linear-gradient(135deg, #61717f 50%, transparent 50%);
    background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
}

.settings-grid select,
.masterdata-form select,
.datatable-selector,
.dataTable-selector {
    width: 100%;
    border: 1px solid #c9d6da;
    border-radius: 6px;
    min-height: 40px;
    padding: 8px 36px 8px 10px;
    font: inherit;
    font-weight: 400;
    color: #17202a;
    background-color: #ffffff;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #61717f 50%), linear-gradient(135deg, #61717f 50%, transparent 50%);
    background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
}

.datatable-selector,
.dataTable-selector {
    width: auto;
    min-width: 86px;
}

select:focus {
    outline: 3px solid rgba(24, 128, 152, 0.18);
    border-color: #188098;
}

.settings-value {
    display: block;
    overflow-wrap: anywhere;
    color: #17202a;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
}

.settings-inline-field {
    align-content: start;
}

.settings-inline-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    width: auto;
    inline-size: max-content;
    max-width: 100%;
}

.settings-inline-control .button-upgrade {
    flex: 0 0 auto;
    width: auto;
    inline-size: auto;
    max-width: max-content;
    min-height: 30px;
    margin-top: 0;
    padding: 0 10px;
    font-size: 13px;
}

.settings-panel.is-editing .settings-grid label {
    background: #ffffff;
}

[data-settings-panel] {
    gap: 16px;
}

[data-settings-panel] .settings-tab-panel {
    gap: 14px;
}

[data-settings-panel] .settings-form {
    display: grid;
    gap: 16px;
}

[data-settings-panel] .settings-section {
    gap: 10px;
    padding-top: 16px;
}

[data-settings-panel] .settings-section h3 {
    font-size: 17px;
}

[data-settings-panel] .settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

[data-settings-panel] .settings-grid label {
    display: grid;
    grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 38px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-right: 1px solid #dce5e8;
    border-bottom: 1px solid #dce5e8;
    border-radius: 0;
    background: #ffffff;
    color: #61717f;
    font-size: 14px;
    font-weight: 800;
}

[data-settings-panel] .settings-grid label:nth-child(2n) {
    border-right: 0;
}

[data-settings-panel] .settings-grid label:last-child,
[data-settings-panel] .settings-grid label:nth-last-child(2):nth-child(odd) {
    border-bottom: 0 !important;
}

[data-settings-panel] .settings-grid input,
[data-settings-panel] .settings-grid select,
[data-settings-panel] .settings-grid textarea,
[data-settings-panel] .qct-combobox-button {
    min-height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 15px;
}

[data-settings-panel] .settings-value,
[data-settings-panel] .settings-inline-control,
[data-settings-panel] .qct-combobox {
    min-width: 0;
    color: #17202a;
    font-size: 15px;
    font-weight: 400;
}

[data-settings-panel] .settings-inline-control {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

[data-settings-panel] .button-upgrade {
    min-height: 32px;
    padding: 5px 10px;
}

.locations-section {
    gap: 16px;
}

.locations-list {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.locations-empty {
    margin: 0;
    padding: 14px;
    border: 1px dashed #c9d6da;
    border-radius: 8px;
    color: #52636a;
    background: #f8fafc;
}

.location-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid #dce5e8;
    background: #ffffff;
}

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

.location-item > div {
    display: grid;
    grid-template-columns: 150px minmax(170px, 0.7fr) minmax(0, 1.3fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.location-item strong,
.location-item p {
    overflow-wrap: anywhere;
}

.location-item strong {
    font-size: 14px;
    font-weight: 700;
}

.location-item p {
    margin: 0;
    color: #52636a;
    font-size: 13px;
}

.location-type {
    justify-self: start;
    border-radius: 6px;
    padding: 3px 7px;
    color: #126b7f;
    background: #e6f4f7;
    font-size: 12px;
    font-weight: 800;
}

.location-delete {
    flex: 0 0 38px;
    width: 34px;
    height: 34px;
}

.location-form {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #f8fafc;
}

.location-form .settings-grid {
    border: 0;
}

.location-grid label {
    background: #ffffff;
}

.location-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.masterdata-panel {
    gap: 20px;
}

.table-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.table-search {
    width: min(100%, 420px);
}

.table-count {
    color: #61717f;
    font-size: 13px;
    font-weight: 800;
}

.data-table-wrap {
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.data-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #dce5e8;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #61717f;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.data-table tbody tr {
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.table-link {
    color: #126b7f;
    font-weight: 700;
    text-decoration: none;
}

.table-link:hover,
.table-link:focus {
    color: #0f5d6f;
    text-decoration: underline;
    outline: none;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #126b7f;
    text-decoration: none;
}

.detail-link:hover,
.detail-link:focus {
    color: #0f5d6f;
    text-decoration: underline;
    outline: none;
}

.text-ellipsis {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.dataTable-wrapper,
.datatable-wrapper {
    display: grid;
    gap: 14px;
}

.dataTable-top,
.dataTable-bottom,
.datatable-top,
.datatable-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
}

.dataTable-top,
.datatable-top {
    justify-content: space-between;
}

.dataTable-search,
.datatable-search {
    margin-left: auto;
}

.dataTable-top,
.datatable-top {
    border-bottom: 1px solid #dce5e8;
}

.dataTable-bottom,
.datatable-bottom {
    border-top: 1px solid #dce5e8;
}

.dataTable-dropdown label,
.dataTable-search,
.datatable-dropdown label,
.datatable-search {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #61717f;
    font-size: 13px;
    font-weight: 800;
}

.dataTable-selector,
.dataTable-input,
.datatable-selector,
.datatable-input {
    border: 1px solid #c9d6da;
    border-radius: 6px;
    padding: 9px 10px;
    font: inherit;
    font-weight: 400;
    color: #17202a;
    background: #ffffff;
}

.dataTable-input,
.datatable-input {
    min-width: 260px;
}

.dataTable-container,
.datatable-container {
    overflow-x: auto;
}

.dataTable-info,
.datatable-info {
    color: #61717f;
    font-size: 13px;
    font-weight: 800;
}

.dataTable-pagination ul,
.datatable-pagination-list {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dataTable-pagination a,
.datatable-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    border: 1px solid #c9d6da;
    border-radius: 6px;
    color: #17202a;
    text-decoration: none;
    background: #ffffff;
}

.dataTable-pagination a:hover,
.dataTable-pagination .active a,
.datatable-pagination a:hover,
.datatable-pagination .datatable-active a {
    border-color: #188098;
    color: #126b7f;
    background: #e6f4f7;
}

.table-empty {
    color: #52636a;
    text-align: center;
}

.departments-empty-table .datatable-input,
.departments-empty-table .datatable-selector {
    cursor: not-allowed;
    opacity: 0.7;
}

.department-tab-panel {
    display: grid;
    gap: 16px;
}

.department-tab-panel[hidden] {
    display: none;
}

.organization-structure-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0 4px;
}

.organization-structure-toolbar h3 {
    margin: 0;
    font-size: 20px;
}

.organization-structure-toolbar p {
    max-width: 720px;
    margin: 5px 0 0;
    color: #52636a;
}

.organization-structure-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.organization-structure-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.organization-card {
    min-width: 0;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.organization-card h4 {
    margin: 0;
    padding: 13px 16px;
    border-bottom: 1px solid #dce5e8;
    color: #61717f;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.organization-tree {
    padding: 16px;
}

.organization-tree {
    overflow: auto;
    max-height: 68vh;
}

.organization-grid {
    display: grid;
    place-content: center;
    min-width: max-content;
    gap: 0;
}

.organization-grid-cell {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 46px;
    min-height: 46px;
}

.organization-grid-cell-department {
    min-width: 208px;
    min-height: 88px;
    padding: 8px;
}

.organization-node {
    position: relative;
    display: grid;
    align-items: center;
    width: 190px;
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid #cfe0e5;
    border-radius: 8px;
    background: #f8fafc;
}

.organization-tree:not(.is-editing) .organization-node[data-open-chart-department] {
    cursor: pointer;
}

.organization-tree:not(.is-editing) .organization-node[data-open-chart-department]:hover,
.organization-tree:not(.is-editing) .organization-node[data-open-chart-department]:focus {
    border-color: #188098;
    outline: 3px solid rgba(24, 128, 152, 0.14);
}

.organization-node-content {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.organization-node strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #17202a;
    font-size: 14px;
    font-weight: 800;
}

.organization-node span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #61717f;
    font-size: 12px;
    font-weight: 700;
}

.organization-node-delete {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    min-height: 28px;
    color: #8a1f1f;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(23, 32, 42, 0.14);
}

.organization-node-delete:hover,
.organization-node-delete:focus {
    color: #ffffff;
    border-color: #b91c1c;
    background: #b91c1c;
}

.organization-node-spacer {
    border-style: dashed;
    border-color: transparent;
    color: transparent;
    background: transparent;
}

.organization-tree.is-editing .organization-node-spacer {
    border-color: #cfe0e5;
    color: #61717f;
    background: rgba(248, 250, 252, 0.68);
}

.organization-tree:not(.is-editing) .organization-node-spacer .organization-node-content {
    display: none;
}

.spacer-connector {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.spacer-connector-segment {
    position: absolute;
    display: block;
    background: #bfd0d6;
}

.spacer-connector-segment.is-top,
.spacer-connector-segment.is-bottom {
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
}

.spacer-connector-segment.is-top {
    top: 0;
    height: 50%;
}

.spacer-connector-segment.is-bottom {
    bottom: 0;
    height: 50%;
}

.spacer-connector-segment.is-left,
.spacer-connector-segment.is-right {
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
}

.spacer-connector-segment.is-left {
    left: 0;
    width: 50%;
}

.spacer-connector-segment.is-right {
    right: 0;
    width: 50%;
}

.organization-tree.is-editing .spacer-connector {
    opacity: 0.35;
}

.organization-grid-cell-connector::before {
    content: "";
    display: block;
    background: #bfd0d6;
}

.organization-grid-cell-connector.is-horizontal::before {
    width: 100%;
    height: 2px;
}

.organization-grid-cell-connector.is-vertical::before {
    width: 2px;
    height: 100%;
    min-height: 46px;
}

.organization-grid-arrow {
    width: 30px;
    height: 30px;
    min-height: 30px;
    color: #126b7f;
    background: #ffffff;
}

.organization-empty {
    margin: 0;
    color: #52636a;
}

.structure-placement-modal {
    width: min(100%, 520px);
}

.structure-placement-field {
    display: grid;
    gap: 6px;
    color: #61717f;
    font-size: 13px;
    font-weight: 800;
}

.table-action {
    width: 36px;
    height: 36px;
}

.data-table th.table-view-column,
.data-table td.table-view-column {
    width: 1%;
    min-width: 44px;
    max-width: 44px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: center;
    white-space: nowrap;
}

.table-view-action {
    width: 32px;
    height: 32px;
}

.data-table th:last-child,
.data-table td:last-child {
    width: 1%;
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
}

.status-customer {
    color: #126b7f;
    background: #e6f4f7;
}

.status-supplier {
    color: #7c4a03;
    background: #fff3d6;
}

.status-product {
    color: #126b7f;
    background: #e6f4f7;
}

.status-material {
    color: #5b3c8a;
    background: #f0e9ff;
}

.status-active {
    color: #14532d;
    background: #dcfce7;
}

.status-draft {
    color: #126b7f;
    background: #e6f4f7;
}

.status-obsolete {
    color: #7c2d12;
    background: #ffedd5;
}

.status-archived {
    color: #52636a;
    background: #eef3f5;
}

.status-inactive {
    color: #52636a;
    background: #eef3f5;
}

.status-as_indication {
    color: #835c00;
    background: #fff4d8;
}

.masterdata-modal {
    width: min(88vw, 1380px);
    min-width: min(100%, 980px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding-right: 34px;
    padding-left: 34px;
}

.document-library-filters {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: 18px 0 14px;
    flex-wrap: wrap;
}

.document-storage-summary {
    margin: 18px 0 4px;
    padding: 18px 20px;
    border: 1px solid #dce1ef;
    border-radius: 14px;
    background: linear-gradient(135deg, #f7f9ff 0%, #f2f8ff 100%);
}

.document-storage-summary-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.document-storage-summary-heading div {
    display: grid;
    gap: 2px;
}

.document-storage-summary-heading span,
.document-storage-summary small {
    color: #676879;
}

.document-storage-summary-heading strong {
    color: #323338;
    font-size: 16px;
}

.document-storage-progress {
    height: 9px;
    overflow: hidden;
    margin-bottom: 9px;
    border-radius: 999px;
    background: #dfe7f5;
}

.document-storage-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0073ea, #00a3ff);
    transition: width 240ms ease;
}

.document-library-filters.is-in-datatable {
    align-items: center;
    justify-content: flex-start;
    margin: 0 auto;
    flex-wrap: nowrap;
}

.document-library-filters label {
    width: min(100%, 240px);
}

.document-library-filters.is-in-datatable label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    margin: 0;
    color: #61717f;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}

.document-library-filters.is-in-datatable .qct-combobox-button {
    width: 170px;
    min-height: 38px;
}

.document-table-meta {
    display: block;
    margin-top: 4px;
    color: #61717f;
    font-size: 12px;
    font-weight: 400;
}

.document-linked-summary {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.document-actions {
    width: 190px;
    text-align: right;
    white-space: nowrap;
}

.document-action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

table[data-documents-table] th.document-actions-column,
table[data-documents-table] td.document-actions,
.datatable-table th.document-actions-column,
.datatable-table td.document-actions {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    white-space: nowrap;
}

.document-action-buttons .table-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.document-inline-form {
    display: inline-flex;
    margin: 0;
}

.confirm-modal.document-info-modal,
.confirm-modal.document-details-modal {
    width: min(94vw, 1120px);
    max-width: 1120px;
}

.confirm-modal.document-revision-modal {
    width: min(92vw, 760px);
    max-width: 760px;
}

.document-info-content {
    margin-top: 18px;
}

.document-info-table {
    min-width: 0;
}

.document-details-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.document-details-summary div {
    min-width: 0;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    padding: 10px 12px;
    background: #f8fafb;
}

.document-details-summary span,
.document-details-summary strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-details-summary span {
    margin-bottom: 3px;
    color: #61717f;
    font-size: 12px;
    font-weight: 500;
}

.document-details-summary strong {
    color: #263943;
    font-size: 13px;
    font-weight: 500;
}

.document-details-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.document-revision-source,
.document-revision-note {
    color: #52636a;
    font-size: 14px;
    font-weight: 400;
}

.document-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    color: #2c3d45;
    font-weight: 400;
}

.document-checkbox-row input {
    width: auto;
    min-height: 0;
}

.modal-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

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

.masterdata-form {
    display: grid;
    gap: 18px;
}

.masterdata-view {
    display: grid;
    gap: 18px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-item {
    display: grid;
    gap: 6px;
    min-height: 72px;
    padding: 12px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #f8fafc;
}

.detail-item span,
.related-preview-grid span {
    color: #61717f;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-item strong {
    overflow-wrap: anywhere;
    font-size: 16px;
    font-weight: 400;
}

.detail-item-wide {
    grid-column: 1 / -1;
}

.contact-modal,
.partner-modal,
.department-modal,
.product-material-modal,
.location-quick-modal {
    gap: 16px;
    width: min(94vw, 1500px);
}

.confirm-modal.contact-modal,
.confirm-modal.partner-modal,
.confirm-modal.department-modal,
.confirm-modal.product-material-modal,
.confirm-modal.location-quick-modal {
    width: min(94vw, 1500px);
    max-width: none;
}

.contact-modal .masterdata-view,
.contact-modal .masterdata-form,
.partner-modal .masterdata-view,
.partner-modal .masterdata-form,
.department-modal .masterdata-view,
.department-modal .masterdata-form,
.product-material-modal .masterdata-form,
.location-quick-modal .masterdata-form {
    gap: 14px;
}

.contact-modal .detail-grid,
.contact-modal .settings-grid,
.partner-modal .detail-grid,
.partner-modal .settings-grid,
.department-modal .detail-grid,
.department-modal .settings-grid,
.product-material-modal .settings-grid,
.location-quick-modal .settings-grid,
.partner-detail-page > .detail-grid,
.contact-detail-page > .detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.contact-modal .detail-item,
.contact-modal .settings-grid label,
.partner-modal .detail-item,
.partner-modal .settings-grid label,
.department-modal .detail-item,
.department-modal .settings-grid label,
.product-material-modal .settings-grid label,
.location-quick-modal .settings-grid label,
.partner-detail-page > .detail-grid .detail-item,
.contact-detail-page > .detail-grid .detail-item {
    display: grid;
    grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 38px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-right: 1px solid #dce5e8;
    border-bottom: 1px solid #dce5e8;
    border-radius: 0;
    background: #ffffff;
    color: #61717f;
    font-size: 14px;
    font-weight: 800;
}

.contact-modal .detail-item:nth-child(2n),
.contact-modal .settings-grid label:nth-child(2n),
.partner-modal .detail-item:nth-child(2n),
.partner-modal .settings-grid label:nth-child(2n),
.department-modal .detail-item:nth-child(2n),
.department-modal .settings-grid label:nth-child(2n),
.location-quick-modal .settings-grid label:nth-child(2n),
.partner-detail-page > .detail-grid .detail-item:nth-child(2n),
.contact-detail-page > .detail-grid .detail-item:nth-child(2n) {
    border-right: 0;
}

.contact-modal .detail-item:last-child,
.contact-modal .detail-item:nth-last-child(2):nth-child(odd),
.contact-modal .settings-grid label:last-child,
.contact-modal .settings-grid label:nth-last-child(2):nth-child(odd),
.partner-modal .detail-item:last-child,
.partner-modal .detail-item:nth-last-child(2):nth-child(odd),
.partner-modal .settings-grid label:last-child,
.partner-modal .settings-grid label:nth-last-child(2):nth-child(odd),
.department-modal .detail-item:last-child,
.department-modal .detail-item:nth-last-child(2):nth-child(odd),
.department-modal .settings-grid label:last-child,
.department-modal .settings-grid label:nth-last-child(2):nth-child(odd),
.location-quick-modal .settings-grid label:last-child,
.location-quick-modal .settings-grid label:nth-last-child(2):nth-child(odd),
.partner-detail-page > .detail-grid .detail-item:last-child,
.partner-detail-page > .detail-grid .detail-item:nth-last-child(2):nth-child(odd),
.contact-detail-page > .detail-grid .detail-item:last-child,
.contact-detail-page > .detail-grid .detail-item:nth-last-child(2):nth-child(odd) {
    border-bottom: 0 !important;
}

.contact-modal .detail-item-wide,
.contact-modal .settings-grid .field-wide,
.partner-modal .detail-item-wide,
.partner-modal .settings-grid .field-wide,
.department-modal .detail-item-wide,
.department-modal .settings-grid .field-wide,
.product-material-modal .settings-grid .field-wide,
.location-quick-modal .settings-grid .field-wide,
.partner-detail-page > .detail-grid .detail-item-wide,
.contact-detail-page > .detail-grid .detail-item-wide {
    grid-column: 1 / -1;
    border-right: 0;
}

.contact-modal .settings-grid label:has(+ .field-wide),
.partner-modal .settings-grid label:has(+ .field-wide),
.partner-modal .detail-item:has(+ .detail-item-wide),
.department-modal .settings-grid label:has(+ .field-wide),
.product-material-modal .settings-grid label:has(+ .field-wide),
.location-quick-modal .settings-grid label:has(+ .field-wide) {
    border-bottom: 1px solid #dce5e8 !important;
}

.contact-modal .settings-grid .keep-bottom-border,
.partner-modal .settings-grid .keep-bottom-border,
.partner-modal .detail-item.keep-bottom-border,
.department-modal .settings-grid .keep-bottom-border,
.product-material-modal .settings-grid .keep-bottom-border,
.location-quick-modal .settings-grid .keep-bottom-border {
    border-bottom: 1px solid #dce5e8 !important;
}

.contact-modal .settings-grid label.keep-bottom-border:nth-last-child(2):nth-child(odd),
.partner-modal .settings-grid label.keep-bottom-border:nth-last-child(2):nth-child(odd),
.partner-modal .detail-item.keep-bottom-border:nth-last-child(2):nth-child(odd),
.department-modal .settings-grid label.keep-bottom-border:nth-last-child(2):nth-child(odd),
.product-material-modal .settings-grid label.keep-bottom-border:nth-last-child(2):nth-child(odd),
.location-quick-modal .settings-grid label.keep-bottom-border:nth-last-child(2):nth-child(odd) {
    border-bottom: 1px solid #dce5e8 !important;
}

.measurement-device-modal .settings-grid label:not(.field-wide) {
    border-right: 1px solid #dce5e8;
}

.measurement-device-modal .settings-grid label:nth-child(2),
.measurement-device-modal .settings-grid label:nth-child(5),
.measurement-device-modal .settings-grid label:nth-child(7),
.measurement-device-modal .settings-grid label:nth-child(9),
.measurement-device-modal .settings-grid label:nth-child(11),
.measurement-device-modal .settings-grid label:nth-child(13),
.measurement-device-modal .settings-grid label:nth-child(15),
.measurement-device-modal .settings-grid .field-wide {
    border-right: 0;
}

.calibration-overdue {
    color: #b42318;
    font-weight: 800;
}

.calibration-inactive {
    color: #61717f;
    font-weight: 800;
}

.contact-modal .detail-item span,
.partner-modal .detail-item span,
.department-modal .detail-item span,
.partner-detail-page > .detail-grid .detail-item span,
.contact-detail-page > .detail-grid .detail-item span {
    color: #61717f;
    font-size: 14px;
    font-weight: 800;
}

.contact-modal .detail-item strong,
.contact-modal .settings-grid input,
.contact-modal .settings-grid select,
.contact-modal .settings-grid textarea,
.contact-modal .qct-combobox,
.contact-modal .qct-combobox-button,
.partner-modal .detail-item strong,
.partner-modal .settings-grid input,
.partner-modal .settings-grid select,
.partner-modal .settings-grid textarea,
.partner-modal .qct-combobox,
.partner-modal .qct-combobox-button,
.department-modal .detail-item strong,
.department-modal .settings-grid input,
.department-modal .settings-grid select,
.department-modal .settings-grid textarea,
.department-modal .qct-combobox,
.department-modal .qct-combobox-button,
.product-material-modal .settings-grid input,
.product-material-modal .settings-grid select,
.product-material-modal .settings-grid textarea,
.product-material-modal .qct-combobox,
.product-material-modal .qct-combobox-button,
.location-quick-modal .settings-grid input,
.location-quick-modal .settings-grid select,
.location-quick-modal .settings-grid textarea,
.location-quick-modal .qct-combobox,
.location-quick-modal .qct-combobox-button,
.partner-detail-page > .detail-grid .detail-item strong,
.contact-detail-page > .detail-grid .detail-item strong {
    min-width: 0;
    color: #17202a;
    font-size: 15px;
    font-weight: 400;
}

.contact-modal .settings-grid input,
.contact-modal .settings-grid select,
.contact-modal .settings-grid textarea,
.contact-modal .qct-combobox-button,
.partner-modal .settings-grid input,
.partner-modal .settings-grid select,
.partner-modal .settings-grid textarea,
.partner-modal .qct-combobox-button {
    min-height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.department-modal .settings-grid input,
.department-modal .settings-grid select,
.department-modal .settings-grid textarea,
.department-modal .qct-combobox-button,
.location-quick-modal .settings-grid input,
.location-quick-modal .settings-grid select,
.location-quick-modal .settings-grid textarea,
.location-quick-modal .qct-combobox-button {
    min-height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.related-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.related-preview-grid article {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.related-preview-grid strong {
    font-size: 28px;
    line-height: 1;
}

.related-records {
    display: grid;
    gap: 12px;
}

.related-tabs {
    margin-top: 4px;
}

.drawing-method-tabs {
    margin-bottom: 0;
}

.product-material-modal .settings-grid .drawing-method-row {
    padding: 8px 12px 24px;
    border-bottom: 1px solid #dce5e8;
    background: #ffffff;
}

.related-tab-title {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    color: #20333a;
}

.related-tab-title-row {
    margin-top: -2px;
}

.dimension-type-notice {
    padding: 10px 12px;
    border: 1px solid #b9d7ff;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4f8f;
    font-size: 14px;
    line-height: 1.35;
}

.drawing-editor-main {
    height: calc(100vh - 64px);
    overflow: hidden;
    padding-bottom: 16px;
}

.drawing-editor {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    height: 100%;
    min-height: 0;
}

.drawing-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.drawing-editor-header h2 {
    margin: 0;
}

.drawing-editor-header p:last-child {
    margin: 4px 0 0;
    color: #5d7078;
}

.drawing-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.drawing-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 14px;
    min-height: 0;
    height: 100%;
}

.drawing-viewer {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 18px;
    overflow: auto;
    padding: 22px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #eef3f5;
}

.drawing-viewer-frame {
    position: relative;
    min-width: 0;
    min-height: 0;
}

.drawing-zoom-overlay {
    position: absolute;
    top: 14px;
    left: 50%;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(210, 221, 225, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(23, 32, 42, 0.14);
    opacity: 0.38;
    transform: translateX(-50%);
    transition: opacity 140ms ease;
}

.drawing-zoom-overlay:hover,
.drawing-zoom-overlay:focus-within {
    opacity: 1;
}

.drawing-balloon-zoom-overlay {
    top: 12px;
    gap: 4px;
    padding: 5px 7px;
    border-color: rgba(216, 217, 223, 0.88);
    border-radius: 9px;
    opacity: 0.36;
    box-shadow: 0 8px 20px rgba(50, 51, 56, 0.14);
}

.drawing-balloon-zoom-overlay .icon-button,
.drawing-balloon-zoom-overlay .drawing-zoom-fit {
    display: inline-grid;
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #323338;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.drawing-balloon-zoom-overlay .drawing-zoom-fit {
    width: auto;
    padding: 0 7px;
    font-size: 12px;
}

.drawing-balloon-zoom-overlay .icon-button:hover,
.drawing-balloon-zoom-overlay .icon-button:focus-visible,
.drawing-balloon-zoom-overlay .drawing-zoom-fit:hover,
.drawing-balloon-zoom-overlay .drawing-zoom-fit:focus-visible {
    border-color: #dadaff;
    color: #5034ff;
    background: #eeeeff;
    outline: none;
}

.drawing-balloon-zoom-overlay .drawing-zoom-percentage {
    min-width: 42px;
    color: #323338;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.drawing-balloon-zoom-overlay .drawing-zoom-divider {
    align-self: stretch;
    width: 1px;
    margin: 3px 2px;
    background: #e6e7eb;
}

.drawing-viewer.is-middle-panning,
.drawing-viewer.is-middle-panning * {
    cursor: grabbing !important;
    user-select: none;
}

.drawing-viewer-full {
    height: 100%;
    min-height: 0;
}

.drawing-display-mode {
    display: grid;
    grid-template-columns: auto minmax(190px, 1fr);
    align-items: center;
    gap: 8px;
    color: #5d7078;
    font-size: 13px;
}

.drawing-display-mode select {
    min-width: 190px;
    min-height: 38px;
    padding: 0 34px 0 11px;
    border: 1px solid #d2dde1;
    border-radius: 8px;
    background: #ffffff;
    color: #20333a;
    font: inherit;
}

.pdf-page-wrapper {
    position: relative;
    box-shadow: 0 12px 30px rgba(30, 48, 55, 0.18);
    background: #ffffff;
}

.pdf-page {
    display: block;
}

.balloon-overlay {
    position: absolute;
    inset: 0;
}

.drawing-balloon {
    position: absolute;
    z-index: 2;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    border: 2px solid #111827;
    border-radius: 999px;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(17, 24, 39, 0.18);
}

.drawing-balloon-compact {
    min-width: 30px;
    width: auto;
    padding: 0 7px;
    white-space: nowrap;
}

.drawing-balloon-compact.balloon-normal {
    background: #bfdbfe;
}

.drawing-balloon-compact.balloon-special {
    background: #facc15;
}

.drawing-balloon-compact.balloon-critical {
    background: #c2410c;
    color: #ffffff;
}

.drawing-balloon-pair {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0;
    transform: translate(-15px, -50%);
    border: 0;
    background: transparent;
    color: #111827;
    font-weight: 700;
    cursor: grab;
}

.drawing-balloon-main,
.drawing-balloon-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 2px solid #111827;
    border-radius: 999px;
    background: #ffffff;
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(17, 24, 39, 0.18);
}

.drawing-balloon-id {
    width: 38px;
    height: 38px;
    font-size: 10px;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
}

.drawing-balloon-connector {
    width: 18px;
    height: 2px;
    background: #111827;
}

.drawing-balloon:active,
.drawing-balloon-pair:active {
    cursor: grabbing;
}

.drawing-balloon.is-selected,
.drawing-balloon-pair.is-selected {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
}

.drawing-balloon.is-locating,
.drawing-balloon-pair.is-locating {
    animation: drawingLocatePulse 900ms ease-out 2;
}

@keyframes drawingLocatePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55), 0 2px 6px rgba(17, 24, 39, 0.18);
    }
    100% {
        box-shadow: 0 0 0 18px rgba(37, 99, 235, 0), 0 2px 6px rgba(17, 24, 39, 0.18);
    }
}

.drawing-sidebar {
    display: grid;
    align-content: start;
    gap: 14px;
    min-height: 0;
    overflow: auto;
}

.drawing-sidebar section {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #ffffff;
}

.drawing-sidebar h3 {
    margin: 0;
    font-size: 16px;
}

.drawing-characteristic-list {
    display: grid;
    gap: 8px;
    max-height: 416px;
    overflow: auto;
}

.drawing-characteristic-list button {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid #dce5e8;
    border-radius: 8px;
    background: #f8fbfc;
    color: #20333a;
    text-align: left;
}

.drawing-characteristic-list button.is-active {
    border-color: #188098;
    background: #edf9fb;
}

.drawing-characteristic-list small {
    color: #6a7c84;
}

.drawing-search-input {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #d2dde1;
    border-radius: 8px;
    background: #ffffff;
    color: #20333a;
}

.drawing-balloon-popup {
    position: fixed;
    z-index: 1500;
    width: min(360px, calc(100vw - 24px));
    padding: 14px;
    border: 1px solid #d2dde1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(23, 32, 42, 0.22);
}

.drawing-balloon-popup h3 {
    margin: 0 34px 12px 0;
    font-size: 16px;
    color: #20333a;
}

.drawing-balloon-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    min-width: 30px;
    height: 30px;
}

.drawing-balloon-popup .drawing-detail-list div {
    grid-template-columns: 126px minmax(0, 1fr);
}

.drawing-detail-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.drawing-detail-list div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5ecef;
}

.drawing-detail-list dt {
    color: #6a7c84;
}

.drawing-detail-list dd {
    margin: 0;
    color: #20333a;
}

.drawing-selected-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 1100px) {
    .drawing-editor-grid,
    .drawing-editor-header {
        grid-template-columns: 1fr;
        display: grid;
    }
}

.related-table-wrap {
    overflow: hidden;
}

.related-table {
    table-layout: fixed;
    min-width: 0;
}

.related-table tbody tr {
    cursor: default;
}

.related-table tbody tr:has(.table-link) {
    cursor: pointer;
}

.related-table th,
.related-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-table th:last-child,
.related-table td:last-child {
    width: auto;
    white-space: nowrap;
}

.related-table-full th,
.related-table-full td {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.related-table-wrap:has(.related-table-full) {
    overflow-x: hidden;
}

.related-table-full {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
}

.datatable-container .related-table-full,
.dataTable-container .related-table-full {
    min-width: 0 !important;
}

.related-table-wrap:has(.related-table-full) .datatable-container,
.related-table-wrap:has(.related-table-full) .dataTable-container {
    overflow-x: hidden;
}

.related-table-full .related-col-name {
    width: 28%;
}

.related-table-full .related-col-job {
    width: 24%;
}

.related-table-full .related-col-email {
    width: 30%;
}

.related-table-full .related-col-phone {
    width: 18%;
}

.related-table-full th:last-child,
.related-table-full td:last-child {
    width: auto;
    white-space: normal;
}

.field-wide {
    grid-column: 1 / -1;
}

.field-with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.stacked-field-control {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.field-label-with-info {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
}

.department-modal .settings-grid:has(.field-info),
.measurement-device-modal .settings-grid:has(.field-info),
.product-material-modal .settings-grid:has(.field-info) {
    overflow: visible;
}

.department-modal .settings-grid label:has(.field-info),
.measurement-device-modal .settings-grid label:has(.field-info),
.product-material-modal .settings-grid label:has(.field-info) {
    position: relative;
    z-index: 3;
}

.field-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    color: #ffffff;
    background: #188098;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    cursor: help;
}

.field-info::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 120;
    width: min(360px, 80vw);
    padding: 10px 12px;
    border-radius: 8px;
    color: #ffffff;
    background: #17313a;
    box-shadow: 0 14px 30px rgba(23, 32, 42, 0.18);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    white-space: pre-line;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.field-info:hover::after,
.field-info:focus::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.compact-button {
    min-height: 40px;
    padding: 0 12px;
}

.compact-icon-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
}

.qct-native-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.qct-combobox-button {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qct-combobox-menu {
    position: fixed;
    z-index: 90;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid #c9d6da;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(23, 32, 42, 0.14);
}

.qct-combobox-options {
    display: grid;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
}

.qct-combobox-option {
    border: 0;
    border-radius: 6px;
    padding: 9px 10px;
    color: #17202a;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 400;
    text-align: left;
}

.qct-combobox-option:hover,
.qct-combobox-option:focus,
.qct-combobox-option[aria-selected="true"] {
    color: #17202a;
    background: #e6f4f7;
    outline: none;
}

.qct-combobox-empty {
    padding: 9px 10px;
    color: #52636a;
}

.category-combobox-menu {
    z-index: 95;
}

.settings-grid select:not([data-searchable-select]):not(.qct-native-select-hidden),
.masterdata-modal .settings-grid select:not([data-searchable-select]):not(.qct-native-select-hidden),
.masterdata-form select:not([data-searchable-select]):not(.qct-native-select-hidden),
.form-select:not(.qct-combobox-button),
.dataTable-selector,
.datatable-selector {
    width: 100%;
    min-height: 40px !important;
    border: 1px solid #c9d6da !important;
    border-radius: 6px !important;
    padding: 8px 36px 8px 10px !important;
    color: #17202a !important;
    background-color: #ffffff !important;
    background-image: linear-gradient(45deg, transparent 50%, #61717f 50%), linear-gradient(135deg, #61717f 50%, transparent 50%) !important;
    background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px !important;
    background-repeat: no-repeat !important;
    background-size: 5px 5px, 5px 5px !important;
    box-shadow: none !important;
    font: inherit !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    appearance: none !important;
    box-sizing: border-box;
}

.dataTable-selector,
.datatable-selector {
    width: auto !important;
    min-width: 86px;
}

select:not([data-searchable-select]) option,
.form-select option,
.masterdata-modal .settings-grid select option,
.masterdata-form select option {
    font-weight: 400;
}

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

.toast-notice {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    max-width: min(92vw, 560px);
    padding: 0 18px;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #14532d;
    background: #dcfce7;
    box-shadow: 0 14px 34px rgba(23, 32, 42, 0.18);
    font-weight: 400;
    transform: translate(-50%, 0);
    animation: toast-drop 180ms ease-out;
}

.toast-countdown {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: #ffffff;
    color: #14532d;
    font-size: 14px;
    font-weight: 700;
}

.session-timeout-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 130;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    max-width: min(92vw, 620px);
    padding: 13px 14px 13px 18px;
    border: 1px solid #8fc9d6;
    border-radius: 8px;
    color: #0f3f4a;
    background: #e6f4f7;
    box-shadow: 0 14px 34px rgba(23, 32, 42, 0.18);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
    transform: translate(-50%, 0);
    animation: toast-drop 180ms ease-out;
}

.session-timeout-toast[hidden] {
    display: none;
}

.session-timeout-toast .button {
    min-height: 34px;
    padding: 0 13px;
    white-space: nowrap;
}

@keyframes toast-drop {
    from {
        opacity: 0;
        transform: translate(-50%, -12px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(23, 32, 42, 0.42);
}

.confirm-modal {
    display: grid;
    gap: 22px;
    width: min(100%, 420px);
    border: 1px solid #dce5e8;
    border-radius: 8px;
    padding: 24px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(23, 32, 42, 0.18);
}

.confirm-modal h2 {
    margin: 6px 0 10px;
    font-size: 24px;
    line-height: 1.2;
}

.confirm-modal p {
    margin: 0;
    color: #52636a;
    line-height: 1.45;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-actions-left {
    margin-right: auto;
}

@media (max-width: 760px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-intro,
    .auth-card,
    .dashboard-card {
        padding: 28px;
    }

    .two-columns {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        width: 64px;
        padding: 12px 8px;
    }

    .app-sidebar:hover,
    .app-sidebar:focus-within,
    .app-body.is-sidebar-pinned .app-sidebar {
        width: min(248px, 86vw);
    }

    .app-shell {
        padding-left: 64px;
    }

    .app-body.is-sidebar-pinned .app-shell {
        padding-left: min(248px, 86vw);
    }

    .app-topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 18px;
    }

    .app-sidebar:hover + .app-shell .app-topbar,
    .app-sidebar:focus-within + .app-shell .app-topbar,
    .app-body.is-sidebar-pinned .app-topbar {
        margin-left: calc(min(248px, 86vw) - 64px);
    }

    .app-body.is-sidebar-pinned .app-topbar,
    .app-body.is-sidebar-pinned .app-sidebar:hover + .app-shell .app-topbar,
    .app-body.is-sidebar-pinned .app-sidebar:focus-within + .app-shell .app-topbar {
        margin-left: 0;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .user-chip {
        min-width: 0;
    }

    .app-main {
        padding: 18px;
    }

    .dashboard-hero {
        flex-direction: column;
        padding: 22px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .settings-panel {
        padding: 22px;
    }

    .settings-header {
        flex-direction: column;
    }

    .settings-tabs {
        overflow-x: auto;
    }

    .settings-tab {
        flex: 0 0 auto;
    }

    .settings-actions,
    .settings-edit-actions {
        width: 100%;
    }

    .settings-edit-actions .button {
        flex: 1;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .organization-structure-toolbar,
    .organization-structure-grid {
        grid-template-columns: 1fr;
    }

    .organization-structure-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    [data-settings-panel] .settings-grid label {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 9px 10px;
    }

    .location-item {
        grid-template-columns: 1fr auto;
    }

    .location-item > div {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .detail-grid,
    .related-preview-grid {
        grid-template-columns: 1fr;
    }

    .contact-modal .detail-grid,
    .contact-modal .settings-grid,
    .partner-modal .detail-grid,
    .partner-modal .settings-grid,
    .department-modal .detail-grid,
    .department-modal .settings-grid,
    .location-quick-modal .settings-grid,
    .partner-detail-page > .detail-grid,
    .contact-detail-page > .detail-grid {
        grid-template-columns: 1fr;
    }

    .contact-modal .detail-item,
    .contact-modal .settings-grid label,
    .partner-modal .detail-item,
    .partner-modal .settings-grid label,
    .department-modal .detail-item,
    .department-modal .settings-grid label,
    .location-quick-modal .settings-grid label,
    .partner-detail-page > .detail-grid .detail-item,
    .contact-detail-page > .detail-grid .detail-item {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 9px 10px;
        border-right: 0;
    }

    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .table-search {
        width: 100%;
    }

    .dataTable-top,
    .dataTable-bottom,
    .datatable-top,
    .datatable-bottom {
        align-items: stretch;
        flex-direction: column;
    }

    .dataTable-search,
    .dataTable-dropdown label,
    .datatable-search,
    .datatable-dropdown label {
        align-items: stretch;
        flex-direction: column;
    }

    .dataTable-input,
    .datatable-input {
        min-width: 0;
        width: 100%;
    }

    .masterdata-modal {
        width: min(100%, 860px);
        min-width: 0;
        padding-right: 24px;
        padding-left: 24px;
    }

    .section-heading-row,
    .location-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .location-form-actions .button {
        width: 100%;
    }

    .confirm-actions {
        flex-direction: column-reverse;
    }

    .confirm-actions .button {
        width: 100%;
    }

    .settings-inline-control .button-upgrade {
        justify-self: start;
    }
}

/* Final cascade layer for the modern application shell. */
.app-body {
    background: #f6f7fb;
}

.app-body .app-sidebar {
    width: var(--app-sidebar-collapsed);
    padding: 16px 12px;
    border-right-color: #e6e7eb;
    color: #323338;
    background: #ffffff;
    box-shadow: 4px 0 18px rgba(50, 51, 56, 0.04);
}

.app-body .app-sidebar:hover,
.app-body .app-sidebar:focus-within,
.app-body.is-sidebar-pinned .app-sidebar {
    width: var(--app-sidebar-expanded);
    box-shadow: 12px 0 34px rgba(50, 51, 56, 0.12);
}

.app-body .app-sidebar-header {
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid #ececf1;
}

.app-body .app-brand {
    gap: 12px;
    min-height: 46px;
    color: #323338;
}

.app-body .app-brand-mark {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--app-purple-dark), #0085ff);
    box-shadow: 0 7px 16px rgba(97, 97, 255, 0.24);
    font-size: 12px;
}

.app-body .app-nav-main {
    margin-top: 18px;
    padding-right: 0;
}

.app-body .app-nav-footer {
    padding-top: 12px;
    border-top: 1px solid #ececf1;
}

.app-body .app-nav-link {
    min-height: 46px;
    border-radius: 9px;
    padding: 0 15px;
    color: var(--app-nav-text);
    font-size: 14px;
    font-weight: 600;
}

.app-body .app-nav-link:hover,
.app-body .app-nav-link:focus,
.app-body .app-sidebar-toggle:hover,
.app-body .app-sidebar-toggle:focus {
    color: #323338;
    background: #f0f0ff;
}

.app-body .app-nav-link.is-active {
    color: var(--app-purple-dark);
    background: #eeeeff;
    font-weight: 700;
}

.app-body .app-nav-link.is-active::after {
    top: 9px;
    right: auto;
    bottom: 9px;
    left: 0;
    width: 3px;
    height: auto;
    background: var(--app-purple);
}

.app-body .app-nav-icon {
    color: #676879;
}

.app-body .app-nav-link.is-active .app-nav-icon,
.app-body .app-nav-link:hover .app-nav-icon,
.app-body .app-nav-link:focus .app-nav-icon {
    color: var(--app-purple-dark);
}

.app-body .app-sidebar-toggle {
    border-color: #e6e7eb;
    border-radius: 9px;
    color: #676879;
    background: #f7f7fb;
}

.app-body .app-sidebar-toggle[aria-pressed="true"] {
    color: var(--app-purple-dark);
    border-color: #cacaff;
    background: #eeeeff;
}

.app-body .app-nav-submenu {
    padding-left: 44px;
}

.app-body .app-nav-sublink {
    color: #676879;
    font-weight: 600;
}

.app-body .app-nav-sublink:hover,
.app-body .app-nav-sublink:focus,
.app-body .app-nav-sublink.is-active {
    color: var(--app-purple-dark);
    background: #f0f0ff;
}

.app-body .app-nav-sublink.is-active {
    box-shadow: inset 2px 0 0 var(--app-purple);
}

.app-body .app-shell {
    padding-left: var(--app-sidebar-collapsed);
}

.app-body.is-sidebar-pinned .app-shell {
    padding-left: var(--app-sidebar-expanded);
}

.app-body .app-topbar {
    min-height: 82px;
    padding: 14px 30px;
    border-bottom-color: #e6e7eb;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 3px 14px rgba(50, 51, 56, 0.04);
}

.app-body .app-sidebar:hover + .app-shell .app-topbar,
.app-body .app-sidebar:focus-within + .app-shell .app-topbar {
    margin-left: calc(var(--app-sidebar-expanded) - var(--app-sidebar-collapsed));
}

.app-body.is-sidebar-pinned .app-topbar,
.app-body.is-sidebar-pinned .app-sidebar:hover + .app-shell .app-topbar,
.app-body.is-sidebar-pinned .app-sidebar:focus-within + .app-shell .app-topbar {
    margin-left: 0;
}

.app-body .app-topbar h1 {
    color: #323338;
    font-size: 20px;
}

.app-body .user-chip {
    border-color: #e6e7eb;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(50, 51, 56, 0.05);
}

.app-body .user-avatar {
    border-radius: 50%;
    background: linear-gradient(135deg, #00c875, #00a86b);
}

.app-body .topbar-link {
    border-color: transparent;
    color: #676879;
    background: transparent;
}

.app-body .topbar-link:hover {
    border-color: transparent;
    color: var(--app-purple-dark);
    background: #f0f0ff;
}

@media (max-width: 760px) {
    .app-body .app-sidebar {
        padding: 12px 8px;
    }

    .app-body .app-topbar {
        padding: 14px 16px;
    }
}

/* Top-bar account dropdown. */
.app-body .user-menu {
    position: relative;
}

.app-body .user-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.app-body .user-menu > summary::-webkit-details-marker {
    display: none;
}

.app-body .user-menu > summary:focus-visible {
    outline: 3px solid rgba(97, 97, 255, 0.22);
    outline-offset: 2px;
}

.app-body .user-menu[open] .user-chip {
    border-color: #cacaFF;
    background: #f7f7ff;
    box-shadow: 0 4px 14px rgba(97, 97, 255, 0.12);
}

.app-body .user-menu-chevron {
    flex: 0 0 15px;
    color: #9293a3;
    transition: transform 150ms ease;
}

.app-body .user-menu[open] .user-menu-chevron {
    transform: rotate(180deg);
}

.app-body .user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    width: min(280px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid #e6e7eb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(50, 51, 56, 0.16);
    animation: user-menu-enter 140ms ease-out;
}

.app-body .user-menu-profile {
    display: grid;
    gap: 3px;
    padding: 16px;
    border-bottom: 1px solid #ececf1;
}

.app-body .user-menu-profile strong,
.app-body .user-menu-profile span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-body .user-menu-profile strong {
    color: #323338;
    font-size: 14px;
}

.app-body .user-menu-profile span {
    color: #9293a3;
    font-size: 12px;
}

.app-body .user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px;
    min-height: 42px;
    padding: 0 11px;
    border-radius: 8px;
    color: #4b4d5c;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.app-body .user-menu-item:hover,
.app-body .user-menu-item:focus {
    color: #d83a52;
    background: #fff2f4;
    outline: none;
}

@keyframes user-menu-enter {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-body .user-menu-dropdown {
        animation: none;
    }

    .app-body .user-menu-chevron {
        transition: none;
    }
}

/* Company logo: fixed header slot and settings upload. */
.app-body .topbar-workspace-mark {
    overflow: hidden;
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    padding: 4px;
}

.app-body .topbar-workspace-mark img {
    display: block;
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
}

.app-body .settings-logo-section {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.3fr);
    align-items: center;
    gap: 28px;
}

.app-body .settings-logo-copy p {
    margin: 6px 0 0;
    color: #676879;
    font-size: 13px;
}

.app-body .settings-logo-card {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    border: 1px solid #e6e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #f9f9fc;
}

.app-body .settings-logo-preview {
    display: grid;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    overflow: hidden;
    place-items: center;
    border: 1px solid #dedfe5;
    border-radius: 12px;
    color: #5034ff;
    background: #ffffff;
    font-size: 16px;
    font-weight: 800;
}

.app-body .settings-logo-preview img {
    display: block;
    width: 62px;
    height: 62px;
    object-fit: contain;
}

.app-body .settings-logo-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.app-body .settings-logo-choose {
    display: inline-flex;
    width: auto;
    cursor: pointer;
}

.app-body .settings-logo-choose input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.app-body .settings-logo-choose:focus-within {
    border-color: #a9a9ff;
    outline: 3px solid rgba(97, 97, 255, 0.16);
    outline-offset: 2px;
}

@media (max-width: 800px) {
    .app-body .settings-logo-section {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 520px) {
    .app-body .settings-logo-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Product and material families. */
.app-body .families-alert {
    margin-top: 0;
}

.app-body .families-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
    align-items: start;
    gap: 20px;
}

.app-body .families-list-panel,
.app-body .family-detail-panel,
.app-body .family-empty-detail {
    min-width: 0;
}

.app-body .families-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.app-body .families-section-heading h3,
.app-body .families-section-heading p {
    margin: 0;
}

.app-body .families-section-heading h3 {
    color: #323338;
    font-size: 18px;
}

.app-body .families-section-heading p {
    margin-top: 4px;
    color: #9293a3;
    font-size: 12px;
}

.app-body .families-table {
    min-width: 600px;
}

.app-body .families-table tbody tr.is-selected td {
    background: #f4eafa;
}

.app-body .families-table .family-select-row {
    cursor: pointer;
}

.app-body .families-table .family-select-row:focus {
    outline: none;
}

.app-body .families-table .family-select-row:focus td {
    background: #f4eafa;
    box-shadow: inset 0 2px 0 rgba(155, 81, 224, 0.45), inset 0 -2px 0 rgba(155, 81, 224, 0.45);
}

.app-body .family-type-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.app-body .family-type-product {
    color: #1769aa;
    background: #e9f4ff;
}

.app-body .family-type-material {
    color: #8a5500;
    background: #fff3df;
}

.app-body .family-detail-panel {
    display: grid;
    gap: 18px;
    border: 1px solid #e1e2e8;
    border-radius: 12px;
    padding: 20px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(50, 51, 56, 0.05);
}

.app-body .family-detail-heading {
    margin: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #ececf1;
}

.app-body .family-detail-heading h3 {
    margin-top: 9px;
    font-size: 22px;
}

.app-body .family-rename-form,
.app-body .family-add-member-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.app-body .family-rename-form label,
.app-body .family-add-member-form label {
    min-width: 0;
}

.app-body .family-rename-form .button,
.app-body .family-add-member-form .button {
    min-width: 112px;
}

.app-body .family-members-wrap {
    box-shadow: none;
}

.app-body .family-members-table {
    min-width: 620px;
}

.app-body .family-members-table td form {
    margin: 0;
}

.app-body .family-archive-form {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
}

.app-body .family-empty-detail {
    display: grid;
    min-height: 320px;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed #d8d9df;
    border-radius: 12px;
    padding: 30px;
    color: #9293a3;
    background: #fafafe;
    text-align: center;
}

.app-body .family-empty-detail > span {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 12px;
    color: #9b51e0;
    background: #f4eafa;
    font-size: 22px;
}

.app-body .family-empty-detail h3,
.app-body .family-empty-detail p {
    margin: 0;
}

.app-body .family-empty-detail h3 {
    color: #4b4d5c;
    font-size: 17px;
}

.app-body .family-empty-detail p {
    font-size: 13px;
}

.app-body .family-modal {
    width: min(92vw, 560px);
}

@media (max-width: 1080px) {
    .app-body .families-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .app-body .family-rename-form,
    .app-body .family-add-member-form {
        grid-template-columns: 1fr;
    }

    .app-body .family-rename-form .button,
    .app-body .family-add-member-form .button {
        width: 100%;
    }
}
