/* Shared CRM visual system. Layouts, actions, status meanings and print forms
   remain owned by their components. Loaded last to replace legacy chrome. */
html:has(body.crm-workspace-theme) {
    background: #f1f0f0;
}
body.crm-workspace-theme {
    --workspace-shell: #f1f0f0;
    --workspace-surface: #fff;
    --workspace-soft: #f6f5f5;
    --workspace-line: #e9e7e7;
    --workspace-text: #29292d;
    --workspace-muted: #77767e;
    --workspace-accent: #d10000;
    --workspace-tint: #fff2f2;
    --workspace-focus: #d1000022;
    --workspace-radius: 12px;
    color: var(--workspace-text);
    background: var(--workspace-shell) !important;
    min-height: 100dvh;
}
/* Desktop workspace shell: a calm dock on the left and a separate white
   working surface, so the navigation never competes with the document. */
@media screen and (min-width: 1200px) {
    html body.uikit-theme.crm-workspace-theme .app-shell.app-shell-topnav {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        min-height: 100dvh;
        background: var(--workspace-shell);
    }
    html body.uikit-theme.crm-workspace-theme .app-shell-topnav > .crm-topnav {
        position: static;
        z-index: auto;
        width: 0;
        min-height: 0;
        height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }
    html body.uikit-theme.crm-workspace-theme .app-shell-topnav > .main {
        grid-column: 1;
        grid-row: 1;
        min-height: 100dvh;
        margin-left: 244px;
        padding: 24px;
        background: var(--workspace-shell);
    }
    html body.uikit-theme.crm-workspace-theme .app-shell-topnav > .main > .content {
        box-sizing: border-box;
        min-height: calc(100dvh - 48px);
        padding: 32px;
        border: 1px solid var(--workspace-line);
        border-radius: 18px;
        background: var(--workspace-surface);
        box-shadow: 0 10px 30px rgba(41, 41, 45, .045);
    }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar {
        width: 244px;
        padding: 24px 16px;
        overflow: hidden;
        background: #fafafa !important;
        border-right: 1px solid var(--workspace-line);
    }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .brand {
        margin: 2px 8px 28px;
        color: var(--workspace-text);
        font-size: 16px;
        font-weight: 650;
    }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-list {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0 4px 224px;
        overflow-y: auto;
        scrollbar-width: none;
    }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-list::-webkit-scrollbar { display: none; }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-group {
        margin: 20px 8px 6px;
        color: var(--workspace-muted);
        font-size: 11px;
        font-weight: 650;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-list a {
        min-height: 40px;
        padding: 0 12px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        color: var(--workspace-text);
        font-size: 14px;
    }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-list a:hover {
        color: var(--workspace-text);
        background: var(--workspace-soft);
    }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-list a.is-active {
        color: var(--workspace-accent);
        background: var(--workspace-tint);
        box-shadow: none;
        font-weight: 650;
    }
    /* The utility controls remain one component in the template, but are
       docked at the base of the desktop navigation. */
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools {
        position: fixed;
        z-index: 1000;
        left: 16px;
        bottom: 20px;
        width: 212px;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 0;
        padding: 10px;
        border: 1px solid var(--workspace-line);
        border-radius: 14px;
        background: var(--workspace-surface);
        box-shadow: 0 12px 28px rgba(41, 41, 45, .09);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools > form,
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools > .theme-switcher { width: 100%; }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-toggle,
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .topnav-logout-button {
        width: 100%;
        min-height: 38px;
        padding: 0 10px;
        border: 0;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 9px;
        color: var(--workspace-text);
        background: transparent;
        font-size: 13px;
        font-weight: 600;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-toggle:hover,
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .topnav-logout-button:hover {
        color: var(--workspace-text);
        background: var(--workspace-soft);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-toggle::after { content: "Уведомления"; }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-center { width: 100%; }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-menu {
        right: auto;
        bottom: calc(100% + 10px);
        left: 0;
        width: min(360px, calc(100vw - 32px));
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher {
        display: grid;
        gap: 6px;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-label {
        display: block;
        padding: 0 10px;
        color: var(--workspace-muted);
        font-size: 11px;
        font-weight: 650;
        letter-spacing: .05em;
        text-transform: uppercase;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options {
        min-height: 38px;
        border-radius: 9px;
        background: var(--workspace-soft);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options button { border-radius: 8px; }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .mobile-nav-toggle { display: none; }
    html[data-theme="dark"] body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar { background: #202329 !important; }
}

/* Chat is available without leaving the current register or card. */
.crm-chat-popup[hidden] { display: none; }
.crm-chat-popup {
    position: fixed;
    z-index: 2200;
    inset: 0;
}
.crm-chat-popup-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 15, 16, .42);
    cursor: default;
}
.crm-chat-popup-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    bottom: 20px;
    width: min(940px, calc(100vw - 40px));
    display: grid;
    grid-template-rows: 52px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--workspace-line);
    border-radius: 14px;
    background: var(--workspace-surface);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}
.crm-chat-popup-panel > header {
    padding: 0 16px 0 18px;
    border-bottom: 1px solid var(--workspace-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--workspace-text);
}
.crm-chat-popup-panel > header > span { display: inline-flex; align-items: center; gap: 10px; }
.crm-chat-popup-panel > header a {
    color: var(--workspace-muted);
    font-size: 12px;
    text-decoration: none;
}
.crm-chat-popup-panel > header a:hover { color: var(--workspace-accent); }
.crm-chat-popup-panel > header button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: var(--workspace-muted);
    background: transparent;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}
.crm-chat-popup-panel > header button:hover { color: var(--workspace-text); background: var(--workspace-soft); }
.crm-chat-popup-panel iframe { width: 100%; height: 100%; border: 0; background: var(--workspace-surface); }
body.chat-popup-is-open { overflow: hidden; }

/* The frame is a focused chat workspace, without duplicate CRM chrome. */
html body.chat-embed-page .crm-topnav,
html body.chat-embed-page .crm-desktop-sidebar { display: none !important; }
html body.chat-embed-page .app-shell-topnav > .main {
    min-height: 100dvh;
    margin-left: 0 !important;
    padding: 0 !important;
    background: var(--workspace-surface) !important;
}
html body.chat-embed-page .main > .content {
    min-height: 100dvh !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
html body.chat-embed-page .page-heading { display: none; }
html body.chat-embed-page .chat-shell {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
@media (max-width: 720px) {
    .crm-chat-popup-panel { inset: 0; width: auto; border: 0; border-radius: 0; }
    .crm-chat-popup-panel > header a { display: none; }
}

/* Dark mode uses a separate visual language: Deep Black, Off-white and
   Vibrant Violet from the approved palette. Red remains the light-theme
   brand accent only and is never used for interface emphasis in dark mode. */
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme {
    --workspace-shell: #1a1a1a;
    --workspace-surface: #202020;
    --workspace-soft: #292929;
    --workspace-line: #3b3b3b;
    --workspace-text: #f5f5f5;
    --workspace-muted: #b7b3be;
    --workspace-accent: #7c4dff;
    --workspace-tint: #2d214b;
    --workspace-focus: #7c4dff55;
    --workspace-danger: #7c4dff;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme .brand img {
    filter: hue-rotate(250deg) saturate(1.35) brightness(1.12);
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .uk-button-primary, .btn-primary, .uk-button-danger,
    .trip-edit-command, .driver-delete-button
) {
    color: #f5f5f5 !important;
    background: #7c4dff !important;
    border-color: #7c4dff !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .uk-button-primary, .btn-primary, .uk-button-danger,
    .trip-edit-command, .driver-delete-button
):is(:hover, :focus-visible):not(:disabled) {
    background: #6938e6 !important;
    border-color: #6938e6 !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .primary-link, .row-action, .clear-link, .server-sort-link,
    .uk-text-danger, .amount-problem, .is-danger, .is-warning, .is-expired,
    .driver-document-expired, .transportation-register-profit
) {
    color: #a98cff !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .uk-label-danger, .uk-alert-danger, .uk-badge-danger,
    .driver-license-expired-row > td, .driver-profile-document.is-expired
) {
    color: #f5f5f5 !important;
    border-color: #7c4dff !important;
    background: #2d214b !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .uk-tab > .uk-active > a, .driver-profile-tabs > .uk-active > a,
    .organization-profile-tabs > .uk-active > a, .trip-profile-tabs > .uk-active > a,
    .transportation-tabs > .uk-active > a, .trip-work-tabs .uk-active a
) {
    color: #a98cff !important;
    border-color: #7c4dff !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .contract-profile .contract-parties article,
    .driver-profile-phone-list a,
    .driver-profile-document.is-current,
    .trip-workspace .route-stop-list article,
    .transportation-status-progress
) {
    border-left-color: #7c4dff !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    input[type="checkbox"], input[type="radio"]
) {
    accent-color: #7c4dff;
}

/* Breadcrumbs are navigation, not part of the page heading. A quiet rule on
   the next line gives the working section a clear starting point. */
html body.crm-workspace-theme :is(
    .orders-breadcrumb,
    .contract-breadcrumb,
    .contract-form-breadcrumb,
    .organization-profile-breadcrumb,
    .trip-profile-breadcrumb,
    .driver-profile-breadcrumb
) {
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 28px;
    color: var(--workspace-muted);
    font-size: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--workspace-line);
}

/* More rows in the driver register without turning document data into a wall
   of text. The mobile card layout keeps its deliberately roomier spacing. */
@media screen and (min-width: 721px) {
    html body.uikit-theme.crm-workspace-theme .driver-directory-table { font-size: 13px; }
    html body.uikit-theme.crm-workspace-theme .driver-directory-table th {
        padding-top: 11px;
        padding-bottom: 11px;
    }
    html body.uikit-theme.crm-workspace-theme .driver-directory-table td {
        height: auto !important;
        padding: 7px 10px !important;
        line-height: 1.2;
        vertical-align: top;
    }
    html body.uikit-theme.crm-workspace-theme .driver-directory-table td small {
        margin-top: 1px;
        font-size: 11px;
        line-height: 1.2;
    }
    html body.uikit-theme.crm-workspace-theme .driver-directory-table .uk-label {
        min-height: 20px;
        padding: 1px 7px;
        font-size: 10px;
        line-height: 18px;
    }
    /* Keep row selection aligned exactly below the select-all checkbox. */
    html body.uikit-theme.crm-workspace-theme .driver-directory-table :is(th, td).driver-register-select {
        width: 56px !important;
        min-width: 56px;
        box-sizing: border-box;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: center;
        vertical-align: middle;
    }
    html body.uikit-theme.crm-workspace-theme .driver-directory-table .driver-register-select input {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Transportation register: keep the desktop shell as one deliberate grid.
   The page previously inherited competing legacy header and shell rules: at
   some desktop widths the sidebar was still fixed while the work area no
   longer reserved its width.  This made the left rail look cropped and let
   the title, counter and actions break into unrelated rows. */
@media screen and (min-width: 1200px) {
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page {
        overflow-x: clip;
    }
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .crm-desktop-sidebar {
        display: flex !important;
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: 244px !important;
        box-sizing: border-box;
        transform: none !important;
    }
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .app-shell-topnav > .main {
        width: calc(100% - 244px) !important;
        min-width: 0 !important;
        margin-left: 244px !important;
        box-sizing: border-box;
    }
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .app-shell-topnav > .main > .content {
        min-width: 0;
    }
    html body.transportations-workspace-page .orders-page-header {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 24px !important;
    }
    html body.transportations-workspace-page .orders-title-line {
        display: inline-flex !important;
        flex-flow: row nowrap !important;
        align-items: center !important;
        gap: 12px !important;
        white-space: nowrap;
    }
    html body.transportations-workspace-page .orders-count {
        display: inline-flex !important;
        flex: 0 0 auto;
        align-items: center;
        min-height: 26px;
        padding: 2px 10px;
        border-radius: 7px;
        background: var(--workspace-soft);
        color: var(--workspace-muted);
        font-size: 13px;
        line-height: 1;
    }
    html body.transportations-workspace-page .orders-page-actions {
        display: flex !important;
        flex: 0 0 auto;
        flex-flow: row nowrap !important;
        align-items: center !important;
        justify-content: flex-end;
        margin-left: auto !important;
        white-space: nowrap;
    }
}

/* Between the mobile and desktop layouts the desktop rail must never peek
   out from the side.  The page uses the normal full-width workspace here. */
@media screen and (min-width: 721px) and (max-width: 1199px) {
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .crm-desktop-sidebar {
        display: none !important;
    }
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .app-shell-topnav > .main {
        width: 100% !important;
        margin-left: 0 !important;
        min-width: 0 !important;
    }
}
html[data-theme="dark"] body.crm-workspace-theme {
    --workspace-shell: #1a1a1a;
    --workspace-surface: #202020;
    --workspace-soft: #292929;
    --workspace-line: #3b3b3b;
    --workspace-text: #f5f5f5;
    --workspace-muted: #b7b3be;
    --workspace-accent: #7c4dff;
    --workspace-tint: #2d214b;
    --workspace-focus: #7c4dff55;
}
/* Dark palette: Deep Black, Off-white and Vibrant Violet. */
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar {
    background: var(--workspace-shell) !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(.uk-button-primary, .btn-primary) {
    background: var(--workspace-accent) !important;
    border-color: var(--workspace-accent) !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme .uk-button-primary:hover:not(:disabled) {
    background: #6938e6 !important;
    border-color: #6938e6 !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme input:is([type="checkbox"], [type="radio"]) {
    accent-color: var(--workspace-accent);
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme .driver-registry-status.is-inactive::before {
    background: var(--workspace-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--workspace-accent) 18%, transparent);
}
/* The driver registry is a working table, so its frame stays deliberately
   strict rather than card-like. */
html body.uikit-theme.crm-workspace-theme.driver-directory-page :is(.driver-register-panel, .driver-register-panel .table-wrap) {
    border-radius: 0 !important;
}
html body.uikit-theme.crm-workspace-theme .driver-registry-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--workspace-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
}
html body.uikit-theme.crm-workspace-theme .driver-registry-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #28ae7b;
    box-shadow: 0 0 0 3px rgba(40, 174, 123, .12);
}
html body.uikit-theme.crm-workspace-theme .driver-registry-status.is-inactive::before {
    background: var(--workspace-accent);
    box-shadow: 0 0 0 3px rgba(209, 0, 0, .10);
}
html body.uikit-theme.crm-workspace-theme .driver-registry-status.is-archived::before {
    display: none;
}
html body.uikit-theme.crm-workspace-theme .driver-profile-document-heading .driver-registry-status {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
html body.uikit-theme.crm-workspace-theme .driver-profile-document-heading .driver-registry-status.is-archived {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--workspace-muted);
    font-size: 11px;
    font-weight: 400;
    line-height: normal;
}
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-filters {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px !important;
    padding: 0 !important;
    margin: 0 0 24px;
    border: 0 !important;
    background: transparent !important;
}
html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}
html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-filters .uk-select,
html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-action { height: 42px; }
html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-filters .uk-select { width: 180px; }
html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-summary { display: flex; justify-content: flex-end; gap: 28px; padding: 18px 20px; border-bottom: 1px solid var(--workspace-line); }
html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-summary > div { min-width: 155px; text-align: right; }
html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-summary span { display: block; color: var(--workspace-muted); font-size: 11px; }
html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-summary strong { display: block; margin-top: 4px; font-size: 15px; }
html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-table small { display: block; margin-top: 4px; color: var(--workspace-muted); font-size: 11px; }
@media (max-width: 720px) {
    html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-filters { display: grid; grid-template-columns: 1fr 1fr; }
    html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-filters .uk-select,
    html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-action { width: 100%; }
    html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-summary { display: grid; grid-template-columns: 1fr; gap: 12px; }
    html body.uikit-theme.crm-workspace-theme.tax-directory-page .tax-register-summary > div { text-align: left; }
}
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-search-field {
    position: relative;
    display: block;
    width: auto;
    max-width: none;
    flex: 1 1 420px;
    padding: 0;
    border: 0;
    background: transparent;
}
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-search-field > .uk-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--workspace-muted);
    pointer-events: none;
}
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-search-field .search {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    height: 42px;
    padding-left: 43px !important;
}
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-filters > .uk-select { width: 210px; height: 42px; }
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-search-action { flex: 0 0 auto; height: 42px; padding-inline: 16px; white-space: nowrap; }
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-search-action:last-child { margin-left: 0; }
@media (max-width: 720px) {
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-filters { display: grid; grid-template-columns: 1fr 1fr; }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-search-field,
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-filters > .uk-select,
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-search-action:last-child { grid-column: 1 / -1; width: 100%; margin-left: 0; }
}
html body.uikit-theme.crm-workspace-theme .directory-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 1160px;
}
html body.uikit-theme.crm-workspace-theme .directory-hub-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 220px;
    padding: 22px;
    border: 1px solid var(--workspace-line);
    border-radius: 0;
    color: var(--workspace-text);
    background: var(--workspace-surface);
}
html body.uikit-theme.crm-workspace-theme .directory-hub-card:hover {
    border-color: var(--workspace-accent) !important;
    color: var(--workspace-text);
    background: transparent !important;
    box-shadow: none !important;
}
html body.uikit-theme.crm-workspace-theme .directory-card-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
html body.uikit-theme.crm-workspace-theme .directory-card-top > span { color: var(--workspace-accent); }
html body.uikit-theme.crm-workspace-theme .directory-card-top a { color: var(--workspace-muted); font-size: 12px; text-decoration: none; }
html body.uikit-theme.crm-workspace-theme .directory-card-top a:hover { color: var(--workspace-accent); }
html body.uikit-theme.crm-workspace-theme .directory-hub-card strong { display: block; font-size: 18px; }
html body.uikit-theme.crm-workspace-theme .directory-hub-card:hover strong,
html body.uikit-theme.crm-workspace-theme .directory-hub-card:hover .directory-card-top a { color: var(--workspace-accent) !important; }
html body.uikit-theme.crm-workspace-theme .directory-hub-card p { margin: 5px 0 0; color: var(--workspace-muted); font-size: 14px; }
html body.uikit-theme.crm-workspace-theme .directory-hub-card small { color: var(--workspace-muted); font-size: 13px; }
html body.uikit-theme.crm-workspace-theme .directory-hub-card .uk-button { margin-top: auto; border-radius: 0; background: transparent; text-align: center; transition: color .16s ease, border-color .16s ease; }
html body.uikit-theme.crm-workspace-theme .directory-hub-card .uk-button:hover,
html body.uikit-theme.crm-workspace-theme .directory-hub-card .uk-button:focus-visible { border-color: var(--workspace-accent) !important; background: transparent !important; color: var(--workspace-accent) !important; }
html body.uikit-theme.crm-workspace-theme .directory-attention { max-width: 1160px; margin-top: 30px; border: 1px solid var(--workspace-line); border-radius: 0; background: var(--workspace-surface); }
html body.uikit-theme.crm-workspace-theme .directory-attention-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--workspace-line); }
html body.uikit-theme.crm-workspace-theme .directory-attention-heading > span { color: var(--workspace-accent); }
html body.uikit-theme.crm-workspace-theme .directory-eyebrow { color: var(--workspace-muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
html body.uikit-theme.crm-workspace-theme .directory-attention h2 { margin: 4px 0 0; font-size: 18px; color: var(--workspace-text); }
html body.uikit-theme.crm-workspace-theme .directory-attention-heading p { margin: 5px 0 0; color: var(--workspace-muted); font-size: 13px; }
html body.uikit-theme.crm-workspace-theme .directory-attention-table { display: block; }
html body.uikit-theme.crm-workspace-theme .directory-attention-row { display: grid; grid-template-columns: 160px minmax(260px, 1fr) 84px 104px; align-items: center; gap: 16px; min-height: 58px; padding: 0 22px; border-bottom: 1px solid var(--workspace-line); color: var(--workspace-muted); font-size: 13px; text-decoration: none; }
html body.uikit-theme.crm-workspace-theme .directory-attention-row:last-child { border-bottom: 0; }
html body.uikit-theme.crm-workspace-theme .directory-attention-row:not(.directory-attention-labels):hover { color: var(--workspace-text); background: var(--workspace-soft); }
html body.uikit-theme.crm-workspace-theme .directory-attention-labels { min-height: 36px; color: var(--workspace-muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
html body.uikit-theme.crm-workspace-theme .directory-attention-area { color: var(--workspace-text); font-weight: 650; }
html body.uikit-theme.crm-workspace-theme .directory-attention-row strong { color: #17815d; font-size: 16px; font-variant-numeric: tabular-nums; text-align: right; }
html body.uikit-theme.crm-workspace-theme .directory-attention-row strong.is-warning { color: #b26b00; }
html body.uikit-theme.crm-workspace-theme .directory-attention-row strong.is-alert { color: var(--workspace-accent); }
html body.uikit-theme.crm-workspace-theme .directory-attention-action { color: var(--workspace-accent); font-size: 12px; font-weight: 650; text-align: right; }
html body.uikit-theme.crm-workspace-theme .directory-status-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; max-width: 1160px; margin-top: 24px; padding: 14px 18px; border: 1px solid var(--workspace-line); border-left: 3px solid var(--workspace-line); background: var(--workspace-surface); }
html body.uikit-theme.crm-workspace-theme .directory-status-title { color: var(--workspace-text); font-size: 13px; font-weight: 700; white-space: nowrap; }
html body.uikit-theme.crm-workspace-theme .directory-status-items { display: flex; align-items: center; flex: 1 1 auto; flex-wrap: wrap; gap: 8px 18px; }
html body.uikit-theme.crm-workspace-theme .directory-status-items a { color: var(--workspace-muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
html body.uikit-theme.crm-workspace-theme .directory-status-items a:hover { text-decoration: underline; }
html body.uikit-theme.crm-workspace-theme .directory-status-items a strong { margin-right: 3px; color: var(--workspace-accent); font-variant-numeric: tabular-nums; }
html body.uikit-theme.crm-workspace-theme .directory-status-items a.is-warning strong { color: #b26b00; }
html body.uikit-theme.crm-workspace-theme .directory-status-ok { display: inline-flex; align-items: center; gap: 7px; color: #17815d; font-size: 13px; }
html body.uikit-theme.crm-workspace-theme :is(.orders-breadcrumb, .organization-profile-breadcrumb) > a {
    color: var(--workspace-muted);
    text-decoration: none;
}
html body.uikit-theme.crm-workspace-theme :is(.orders-breadcrumb, .organization-profile-breadcrumb) > a:hover {
    color: var(--workspace-accent);
    text-decoration: underline;
}
@media screen and (max-width: 720px) {
    html body.uikit-theme.crm-workspace-theme .directory-hub-grid { grid-template-columns: 1fr; }
    html body.uikit-theme.crm-workspace-theme .directory-attention-labels { display: none; }
    html body.uikit-theme.crm-workspace-theme .directory-attention-row { grid-template-columns: 1fr auto; gap: 5px 12px; min-height: 0; padding: 14px 16px; }
    html body.uikit-theme.crm-workspace-theme .directory-attention-row > span:nth-child(2) { grid-column: 1; color: var(--workspace-muted); }
    html body.uikit-theme.crm-workspace-theme .directory-attention-row strong { grid-column: 2; grid-row: 1 / span 2; }
    html body.uikit-theme.crm-workspace-theme .directory-attention-action { display: none; }
    html body.uikit-theme.crm-workspace-theme .directory-status-strip { align-items: flex-start; }
}
/* Контрагенты используют ту же рабочую таблицу, что и водители: строгая
   геометрия, компактные строки и закреплённые названия столбцов. */
html body.uikit-theme.crm-workspace-theme.organization-directory-page :is(.organization-register-panel, .organization-register-panel .table-wrap) {
    border-radius: 0 !important;
}
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table {
    min-width: 1120px;
    table-layout: fixed;
}
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table .organization-register-select {
    width: 56px !important;
    min-width: 56px;
    box-sizing: border-box;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center;
    vertical-align: middle;
}
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table .organization-register-select input {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table :is(th, td):nth-child(2) { width: 29%; }
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table :is(th, td):nth-child(3) { width: 17%; }
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table :is(th, td):nth-child(4) { width: 21%; }
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table :is(th, td):nth-child(5) { width: 19%; }
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table :is(th, td):nth-child(6) { width: 14%; }
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-fns-status.is-unknown { color: var(--workspace-muted); }
html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-fns-status.is-unknown::before {
    background: var(--workspace-muted);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--workspace-muted) 14%, transparent);
}
@media screen and (min-width: 721px) {
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table { font-size: 13px; }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table th {
        padding: 11px 10px;
        font-size: 12px;
        line-height: 1.2;
    }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table td {
        height: auto !important;
        padding: 7px 10px !important;
        vertical-align: top;
        line-height: 1.2;
    }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table td small {
        margin-top: 1px;
        font-size: 11px;
        line-height: 1.2;
    }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-address { margin-top: 3px !important; }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .main > .content {
        height: auto;
        min-height: calc(100dvh - 150px);
        display: block;
    }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-panel {
        display: block;
        margin-bottom: 0;
        overflow: visible !important;
    }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-panel .table-wrap {
        overflow: visible;
        max-height: none;
    }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table thead {
        position: sticky;
        top: 0;
        z-index: 3;
    }
    html body.uikit-theme.crm-workspace-theme.organization-directory-page .organization-register-table thead th {
        position: static;
        background: var(--workspace-soft, #f5f5f5);
    }
}
@media screen {
    @media (min-width: 961px) and (min-height: 650px) {
        html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .main > .content {
            height: var(--register-height, calc(100dvh - 150px)); min-height: 0;
            display: flex; flex-direction: column;
        }
        html body.transportations-workspace-page .content > :not(.transportation-register-panel) { flex-shrink: 0; }
        html body.transportations-workspace-page .transportation-register-panel {
            flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0;
        }
        html body.transportations-workspace-page .transportation-register-panel .table-wrap {
            flex: 1 1 auto; min-height: 0; overflow: auto; max-height: none;
        }
        html body.transportations-workspace-page .transportation-register-table thead th {
            position: sticky; top: 0; z-index: 2; background: var(--workspace-soft, #f5f5f5);
        }
        html body.uikit-theme.crm-workspace-theme.driver-directory-page .main > .content {
            /* Let the register grow with its records. The table header sticks
               to the viewport during the usual page scroll. */
            height: auto; min-height: calc(100dvh - 150px);
            display: block;
        }
        html body.driver-directory-page .driver-register-panel {
            display: block; margin-bottom: 0;
            /* The legacy panel clips descendants, which prevents a sticky
               table header from following the document scroll. */
            overflow: visible !important;
        }
        html body.driver-directory-page .driver-register-panel .table-wrap {
            overflow: visible; max-height: none;
        }
        html body.driver-directory-page .driver-directory-table thead {
            position: sticky; top: 0; z-index: 3;
        }
        html body.driver-directory-page .driver-directory-table thead th {
            position: static; background: var(--workspace-soft, #f5f5f5);
        }
        html body.uikit-theme.crm-workspace-theme.vehicle-directory-page .main > .content {
            height: auto; min-height: calc(100dvh - 150px); display: block;
        }
        html body.vehicle-directory-page .vehicle-register-panel {
            display: block; margin-bottom: 0; overflow: visible !important;
        }
        html body.vehicle-directory-page .vehicle-register-panel .table-wrap {
            overflow: visible; max-height: none;
        }
        html body.vehicle-directory-page .vehicle-directory-table thead {
            position: sticky; top: 0; z-index: 3;
        }
        html body.vehicle-directory-page .vehicle-directory-table thead th {
            position: static; background: var(--workspace-soft, #f5f5f5);
        }
    }
    html body.crm-workspace-theme [data-driver-form] .driver-personal-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; border-bottom: 0; padding-bottom: 0; }
    html body.crm-workspace-theme [data-driver-form] .driver-personal-grid > .field { grid-column: auto; min-width: 0; }
    html body.crm-workspace-theme [data-driver-form] .driver-active-field { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; white-space: nowrap; color: var(--workspace-text); font-size: 14px; cursor: pointer; }
    html body.crm-workspace-theme [data-driver-form] .driver-active-field input { margin: 0; }
    [data-driver-form] .orders-breadcrumb { margin-bottom: 24px; }
    [data-driver-form] :is(.field-error, .errorlist, .form-text, .phone-input-warning) { display: none !important; }
    html body.uikit-theme.crm-workspace-theme [data-driver-form] :is(input, select, textarea):is([aria-invalid="true"], .is-phone-invalid) { border: 3px solid #d10000 !important; }
    html body.uikit-theme.crm-workspace-theme [data-driver-form] [data-driver-phone-remove] {
        width: 100%; min-height: 40px; align-self: center; margin: 0;
        border-color: #d10000 !important; background: transparent !important; color: #d10000 !important;
    }
    html body.uikit-theme.crm-workspace-theme [data-driver-form] [data-driver-phone-add] {
        border-color: #d10000 !important; background: transparent !important; color: #d10000 !important;
    }
    html body.uikit-theme.crm-workspace-theme [data-driver-form] [data-driver-phone-add]:hover,
    html body.uikit-theme.crm-workspace-theme [data-driver-form] [data-driver-phone-add]:focus {
        border-color: #a80000 !important; background: transparent !important; color: #a80000 !important;
    }
    html body.uikit-theme.crm-workspace-theme [data-driver-form] :is([data-driver-phone-add], [data-passport-add], [data-license-add]) { margin-top: 18px !important; }
    /* Phone rows have a shorter internal block; compensate so the visual gap
       before its add action matches passport and licence sections. */
    html body.uikit-theme.crm-workspace-theme [data-driver-form] .driver-phone-section [data-driver-phone-add] { margin-top: 36px !important; }
    html body.uikit-theme.crm-workspace-theme [data-driver-form] [data-driver-phone-remove]:hover:not(:disabled),
    html body.uikit-theme.crm-workspace-theme [data-driver-form] [data-driver-phone-remove]:focus:not(:disabled) {
        border-color: #a80000 !important; background: transparent !important; color: #a80000 !important;
    }
    @media (max-width: 640px) {
        html body.crm-workspace-theme [data-driver-form] .driver-personal-grid { grid-template-columns: minmax(0, 1fr); }
    }
    html body.crm-workspace-theme .driver-smart-input-dialog { width: min(720px, calc(100vw - 32px)); padding: 28px; }
    .driver-smart-input-dialog header { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--workspace-line); }
    .driver-smart-input-dialog header h2 { margin: 0; color: var(--workspace-text); font-size: 20px; }
    .driver-smart-input-dialog header p { margin: 6px 0 0; color: var(--workspace-muted); font-size: 13px; }
    .driver-smart-input-dialog textarea { min-height: 220px; resize: vertical; }
    .driver-smart-result { margin-top: 18px; padding: 16px; border: 1px solid var(--workspace-line); border-left: 3px solid var(--workspace-accent); background: var(--workspace-soft); }
    .driver-smart-result h3 { margin: 0 0 10px; font-size: 16px; color: var(--workspace-text); }
    .driver-smart-result dl { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(0, 1.8fr); gap: 7px 16px; margin: 0; }
    .driver-smart-result dt { color: var(--workspace-muted); }
    .driver-smart-result dd { margin: 0; color: var(--workspace-text); overflow-wrap: anywhere; }
    .driver-smart-result .is-warning { margin-top: 12px; color: var(--workspace-accent); }
    .driver-smart-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
    html body.driver-directory-page .driver-directory-table { min-width: 1000px; }
html body.driver-directory-page .driver-directory-table :is(th, td):nth-child(1) { width: 56px; }
    html body.uikit-theme.crm-workspace-theme .driver-directory-table tr.driver-license-expired-row > td { background: #fff2f2 !important; }
    html body.uikit-theme.crm-workspace-theme .driver-directory-table tr.driver-license-expired-row:hover > td { background: #ffe8e8 !important; }
    html body.uikit-theme.crm-workspace-theme .driver-directory-table .driver-document-expired { color: #d10000 !important; font-weight: 700; }
    html[data-theme="dark"] body.uikit-theme.crm-workspace-theme .driver-directory-table tr.driver-license-expired-row > td { background: #3a2529 !important; }
    html body.driver-directory-page .driver-directory-table :is(th, td):nth-child(2) { width: 20%; }
    html body.driver-directory-page .driver-directory-table :is(th, td):nth-child(3) { width: 28%; }
    html body.driver-directory-page .driver-directory-table :is(th, td):nth-child(4) { width: 20%; }
    html body.driver-directory-page .driver-directory-table :is(th, td):nth-child(5) { width: 15%; }
    html body.driver-directory-page .driver-directory-table :is(th, td):nth-child(6) { width: 14%; }
    body.driver-directory-page,
    body.organization-directory-page { --orders-muted: var(--workspace-muted); --orders-soft: var(--workspace-soft); }
    html body.driver-directory-page #drivers-title { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -.7px; color: var(--workspace-text); }
    html body.organization-directory-page #organizations-title { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -.7px; color: var(--workspace-text); }
    html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-breadcrumb { display: flex; align-items: center; gap: 12px; margin: 0 0 28px; color: var(--workspace-muted); font-size: 12px; }
    html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin: 0 0 28px; }
    html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-title-line { display: flex; align-items: center; gap: 12px; }
    html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-count { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: 7px; background: var(--workspace-soft); color: var(--workspace-muted); font-size: 13px; line-height: 1; }
    html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-page-header p { margin: 8px 0 0; color: var(--workspace-muted); font-size: 13px; }
    html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-page-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
    html body.driver-directory-page .orders-page-actions .uk-button { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; min-height: 42px; }
    html body.driver-directory-page .driver-register-filters {
        display: flex !important; flex-wrap: wrap; justify-content: flex-start; gap: 6px !important;
        padding: 0 !important; margin: 0 0 24px; border: 0 !important; background: transparent !important;
    }
    html body.driver-directory-page .driver-register-filters .driver-search-field { position: relative; display: block; width: auto; max-width: none; flex: 1 1 420px; }
    html body.driver-directory-page .driver-register-filters .driver-search-action { flex: 0 0 auto; min-height: 42px; padding-inline: 16px; }
    /* Legacy register styles added a left margin to every action.  Keep the
       toolbar rhythm determined solely by flex gap, like the fleet register. */
    html body.driver-directory-page .driver-register-filters > .driver-search-action { margin-left: 0 !important; }
    html body.driver-directory-page .driver-register-filters .driver-search-field > .uk-icon { position: absolute; z-index: 1; top: 50%; left: 14px; transform: translateY(-50%); color: var(--workspace-muted); pointer-events: none; }
    html body.driver-directory-page .driver-register-filters .search { width: 100% !important; max-width: none; padding-left: 43px !important; }
    html body.driver-directory-page .driver-register-filters select { width: 230px !important; max-width: 100%; flex: 0 1 230px !important; margin: 0 !important; }
    html body.driver-directory-page .driver-register-filters :is(input, select, button) { min-height: 42px; }
    html body.driver-directory-page .driver-letter-tabs { margin: 0; }
    html body.driver-directory-page .driver-letter-tabs a { min-width: 31px; justify-content: center; padding-right: 9px; padding-left: 9px; }
    html body.driver-directory-page .driver-letter-tabs a:first-child { min-width: auto; padding-right: 16px; }
    html body.driver-directory-page .driver-letter-tabs-spacer { display: block; height: 28px; }
    html body.organization-directory-page .organization-role-tabs { margin: 0; }
    html body.organization-directory-page .organization-role-tabs-spacer { display: block; height: 28px; }
    body.vehicle-directory-page { --orders-muted: var(--workspace-muted); --orders-soft: var(--workspace-soft); }
    html body.vehicle-directory-page #vehicles-title { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -.7px; color: var(--workspace-text); }
    html body.vehicle-directory-page .orders-page-actions .uk-button { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; min-height: 42px; }
    html body.vehicle-directory-page .vehicle-kind-tabs { margin: 0; }
    html body.vehicle-directory-page .vehicle-kind-tabs-spacer { display: block; height: 28px; }
    html body.vehicle-directory-page .vehicle-register-filters {
        display: flex !important; flex-wrap: wrap; justify-content: flex-start; gap: 12px !important;
        padding: 0 !important; margin: 0 0 24px; border: 0 !important; background: transparent !important;
    }
    html body.vehicle-directory-page .vehicle-register-filters .vehicle-search-field { position: relative; display: block; width: 420px; max-width: 100%; flex: 0 1 420px; }
    html body.vehicle-directory-page .vehicle-register-filters .vehicle-search-field > .uk-icon { position: absolute; z-index: 1; top: 50%; left: 14px; transform: translateY(-50%); color: var(--workspace-muted); pointer-events: none; }
    html body.vehicle-directory-page .vehicle-register-filters .search { width: 100% !important; max-width: none; padding-left: 43px !important; }
    html body.vehicle-directory-page .vehicle-register-filters select { width: 230px !important; max-width: 100%; flex: 0 1 230px !important; margin: 0 !important; }
    html body.vehicle-directory-page .vehicle-register-filters :is(input, select, button) { min-height: 42px; }
    html body.vehicle-directory-page .vehicle-directory-table { min-width: 1000px; }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(1) { width: 16%; }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(2) { width: 27%; }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(3) { width: 20%; }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(4) { width: 25%; }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(5) { width: 12%; }
    html body.uikit-theme.crm-workspace-theme [data-vehicle-form] .vehicle-command-panel { padding: 14px 0; background: var(--workspace-surface) !important; border-color: var(--workspace-line) !important; }
    html body.uikit-theme.crm-workspace-theme [data-vehicle-form] .vehicle-data-card,
    html body.uikit-theme.crm-workspace-theme [data-vehicle-form] .vehicle-attachment-card {
        padding: 18px 18px 18px 14px; border: 1px solid var(--workspace-line); border-left: 4px solid var(--workspace-accent);
        border-radius: 12px; background: var(--workspace-soft);
    }
    html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog {
        width: min(1120px, calc(100vw - 32px)); max-height: calc(100dvh - 44px); overflow-y: auto;
        padding: 0 28px 28px; -ms-overflow-style: none; scrollbar-width: none;
    }
    html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog::-webkit-scrollbar { display: none; }
    html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog .vehicle-form-workspace { padding: 0; }
    html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog [data-vehicle-form] { display: grid; gap: 16px; padding: 0 0 4px; }
    html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog [data-vehicle-form] .vehicle-command-panel {
        position: sticky; top: 0; z-index: 80; display: block; width: calc(100% + 56px);
        margin: 0 -28px 22px; padding: 28px 28px 18px; border: 0 !important;
        border-radius: 0 !important; background: var(--workspace-surface) !important;
    }
    html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog [data-vehicle-form] .vehicle-command-panel::after {
        content: ""; position: absolute; right: 28px; bottom: 0; left: 28px; height: 1px;
        background: var(--workspace-line);
    }
    html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog [data-vehicle-form] .order-command-actions { justify-content: flex-start; margin: 0; }
    @media (max-width: 720px) {
        html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog { box-sizing: border-box; width: 100%; max-width: 100%; max-height: 100dvh; padding: 0 16px max(18px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
        html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog [data-vehicle-form] .vehicle-command-panel { width: calc(100% + 32px); margin: 0 -16px 18px; padding: max(14px, env(safe-area-inset-top)) 16px 14px; }
        html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog [data-vehicle-form] .vehicle-command-panel::after { right: 16px; left: 16px; }
        html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog [data-vehicle-form] .order-command-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
        html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog [data-vehicle-form] .order-command-actions .uk-button { width: 100%; min-width: 0; min-height: 40px; height: auto; padding: 8px 10px; line-height: 1.25; white-space: normal; }
        html body.uikit-theme.crm-workspace-theme .crm-vehicle-dialog [data-vehicle-form] > .form-section:not(.vehicle-command-panel) { padding: 18px 16px; }
    }
    @media (max-width: 720px) {
        html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-breadcrumb { margin-bottom: 20px; }
        html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-page-header { gap: 18px; margin-bottom: 20px; }
        html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-page-actions { width: 100%; margin-left: 0; }
        html body:is(.driver-directory-page, .vehicle-directory-page, .organization-directory-page) .orders-page-actions .uk-button { flex: 1; justify-content: center; }
    }
    body.transportations-workspace-page { --orders-muted: var(--workspace-muted); --orders-soft: var(--workspace-soft); }
    html body.transportations-workspace-page #transportations-title { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -.7px; color: var(--workspace-text); }
    html body.transportations-workspace-page .orders-page-actions { flex-wrap: wrap; }
    html body.transportations-workspace-page .orders-page-actions .uk-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; min-height: 42px; }
    html body.transportations-workspace-page .transportation-register-filters {
        display: flex !important; flex-wrap: wrap; justify-content: flex-start; gap: 12px !important;
        padding: 0 !important; margin: 0 0 24px; border: 0 !important; background: transparent !important;
    }
    html body.transportations-workspace-page .transportation-register-filters .search { width: 420px !important; max-width: 100%; flex: 0 1 420px !important; }
    html body.transportations-workspace-page .transportation-register-filters select { width: 245px !important; max-width: 100%; flex: 0 1 245px !important; margin: 0 !important; }
    html body.transportations-workspace-page .transportation-register-filters :is(input, select) { height: 42px; }
    html body.transportations-workspace-page .transportation-register-filters .transportation-date-type { width: 170px !important; flex-basis: 170px !important; }
    html body.transportations-workspace-page .transportation-register-filters .transportation-date-input { width: 128px !important; flex-basis: 128px !important; }
    html body.transportations-workspace-page .transportation-register-filters .transportation-date-apply { height: 42px; white-space: nowrap; }
    /* Dense but readable transportation register: preserve every column while
       reducing vertical whitespace in the operational list. */
    html body.transportations-workspace-page .transportation-register-table th {
        padding: 11px 12px !important;
        font-size: 11px;
        line-height: 1.25;
    }
    html body.transportations-workspace-page .transportation-register-table thead,
    html body.transportations-workspace-page .transportation-register-table thead tr {
        background: var(--workspace-soft, #f5f5f5) !important;
    }
    html body.transportations-workspace-page .transportation-register-table td {
        padding: 11px 12px !important;
        font-size: 12px;
        line-height: 1.35;
    }
    html body.transportations-workspace-page .transportation-register-table td :is(strong, .route-compact, .primary-link) {
        font-size: 12px;
        line-height: 1.35;
    }
    html body.transportations-workspace-page .transportation-register-table td small {
        margin-top: 2px;
        font-size: 10px;
        line-height: 1.3;
    }
    html body.transportations-workspace-page .transportation-register-table .transportation-register-trip > strong { margin-top: 3px; }
    html body.transportations-workspace-page .transportation-register-table .transportation-register-parties > span,
    html body.transportations-workspace-page .transportation-register-table .transportation-register-finance span {
        font-size: 10px;
        line-height: 1.2;
    }
    html body.transportations-workspace-page .transportation-register-table .transportation-register-parties > strong {
        margin: 1px 0 5px;
    }
    html body.transportations-workspace-page .transportation-register-table .transportation-register-parties > small {
        margin: -4px 0 5px;
    }
    html body.transportations-workspace-page .transportation-register-table .transportation-register-finance { gap: 4px; }
    html body.transportations-workspace-page .transportation-register-table .transportation-register-finance .profit {
        margin-top: 1px;
        padding-top: 4px;
    }
    /* The transportation register follows the driver register behaviour:
       records extend the page, while only the column header is pinned during
       the normal document scroll. This avoids a second, cramped table scroll. */
    @media (min-width: 961px) and (min-height: 650px) {
        html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .main > .content {
            height: auto;
            min-height: calc(100dvh - 150px);
            display: block;
        }
        html body.transportations-workspace-page .transportation-register-panel {
            display: block;
            margin-bottom: 0;
            overflow: visible !important;
        }
        html body.transportations-workspace-page .transportation-register-panel .table-wrap {
            overflow: visible;
            max-height: none;
        }
        html body.transportations-workspace-page .transportation-register-table thead {
            position: sticky;
            top: 0;
            z-index: 3;
        }
        html body.transportations-workspace-page .transportation-register-table thead th {
            position: static;
            background: var(--workspace-soft, #f5f5f5);
        }
    }
    /* Keep the frame deliberately strict, like the driver register. */
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page :is(.transportation-register-panel, .transportation-register-panel .table-wrap) {
        border-radius: 0 !important;
    }
    @media (min-width: 721px) {
        html body.transportations-workspace-page .transportation-register-table th {
            padding: 10px !important;
        }
        html body.transportations-workspace-page .transportation-register-table td {
            padding: 7px 10px !important;
            vertical-align: top;
        }
        html body.transportations-workspace-page .transportation-register-table .transportation-register-finance { gap: 3px; }
        html body.transportations-workspace-page .transportation-register-table .transportation-register-parties > strong { margin-bottom: 3px; }
        html body.transportations-workspace-page .transportation-register-table .transportation-register-parties > small { margin-bottom: 3px; }
    }
    /* Hide only scrollbar chrome; do not disable scrolling or keyboard access. */
    html:has(body.crm-workspace-theme), body.crm-workspace-theme,
    body.crm-workspace-theme * { scrollbar-width: none !important; }
    html:has(body.crm-workspace-theme)::-webkit-scrollbar,
    body.crm-workspace-theme::-webkit-scrollbar,
    body.crm-workspace-theme *::-webkit-scrollbar { display: none !important; width: 0; height: 0; }
    html body.crm-workspace-theme .crm-nav-block {
        margin: 8px 0; border: 1px solid var(--workspace-line); border-radius: 12px;
        background: var(--workspace-surface); overflow: visible;
    }
    html body.crm-workspace-theme .crm-nav-block-title {
        display: flex; align-items: center; gap: 10px; padding: 14px 12px;
        color: var(--workspace-text); font-size: 14px; font-weight: 600; cursor: pointer; list-style: none;
    }
    .crm-nav-block-title::-webkit-details-marker { display: none; }
    .crm-nav-block-title::after {
        content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-left: auto; flex: 0 0 auto;
    }
    .crm-nav-block[open] > .crm-nav-block-title::after { transform: rotate(225deg); }
    .crm-nav-block-title:focus-visible { outline: 2px solid var(--workspace-accent); outline-offset: 2px; border-radius: 10px; }
    html body.crm-workspace-theme .crm-nav-block-links { padding: 0 6px 8px; }
    html body.crm-workspace-theme .mobile-nav-list .crm-nav-block-links a { display: block; box-sizing: border-box; width: 100%; white-space: normal; padding: 10px 12px; font-size: 13px; border-radius: 8px; }
    html body.crm-workspace-theme .mobile-nav-list .crm-nav-block-links a:is(.is-active, :hover) { background: var(--workspace-soft) !important; }
    html body.login-page.crm-workspace-theme { min-height: 100vh; padding: 24px; box-sizing: border-box; }
    html body.login-page.crm-workspace-theme .login-card { width: 100%; max-width: 420px; padding: 36px; border-radius: 22px !important; }
    html body.login-page.crm-workspace-theme .login-brand h1 { font-size: 24px; font-weight: 650; color: var(--workspace-text); }
    html body.login-page.crm-workspace-theme .login-brand p { color: var(--workspace-muted); }
    html body.uikit-theme.crm-workspace-theme .app-shell-topnav > .main,
    html body.uikit-theme.crm-workspace-theme .app-shell-topnav > .crm-topnav {
        background: var(--workspace-shell) !important; box-shadow: none !important;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav { border-bottom: 0; }
    /* Верхние сервисные действия собраны в единую компактную панель. */
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools {
        gap: 8px; padding: 6px 10px; border: 1px solid var(--workspace-line);
        border-radius: 14px; background: var(--workspace-surface);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav .navbar-notification-toggle {
        display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
        border: 0; border-radius: 9px; color: var(--workspace-muted); background: transparent;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav .navbar-notification-toggle:hover,
    html body.uikit-theme.crm-workspace-theme .crm-topnav .navbar-notification-toggle:focus {
        color: var(--workspace-text); background: var(--workspace-soft); outline: none;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav .theme-switcher { width: auto; }
    html body.uikit-theme.crm-workspace-theme .crm-topnav .theme-switcher-options {
        min-height: 34px; padding: 3px; border: 0; border-radius: 9px; background: var(--workspace-soft);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav .theme-switcher-options button {
        display: grid; place-items: center; width: 28px; min-width: 28px; height: 28px;
        padding: 0; border-radius: 7px;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav .theme-switcher-options button span:last-child { display: none; }
    html body.uikit-theme.crm-workspace-theme .topnav-logout-button {
        display: grid; place-items: center; width: 34px; min-height: 34px; padding: 0;
        border: 0; border-radius: 9px; color: var(--workspace-muted); background: transparent;
    }
    html body.uikit-theme.crm-workspace-theme .topnav-logout-button:hover,
    html body.uikit-theme.crm-workspace-theme .topnav-logout-button:focus {
        color: var(--workspace-text); background: var(--workspace-soft); outline: none;
    }
    html body.uikit-theme.crm-workspace-theme .topnav-signout-button:hover,
    html body.uikit-theme.crm-workspace-theme .topnav-signout-button:focus { color: var(--workspace-danger, #d10000); }
    html body.uikit-theme.crm-workspace-theme .topnav-action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    html body.uikit-theme.crm-workspace-theme:not(.order-modal-page):not(.orders-workspace-page) .app-shell-topnav > .main {
        padding: 24px 28px 32px; box-sizing: border-box;
    }
    html body.uikit-theme.crm-workspace-theme:not(.order-modal-page):not(.orders-workspace-page) .main > .content {
        padding: 30px; margin: 0; width: 100%; max-width: none;
        min-height: calc(100vh - 150px); box-sizing: border-box;
        background: var(--workspace-surface); border: 1px solid var(--workspace-line);
        border-radius: 22px;
    }
    html body.uikit-theme.crm-workspace-theme :is(.panel, .uk-card-default, .form-section,
        .directory-card, .driver-info-panel, .vehicle-info-panel, .organization-summary-card,
        .driver-summary-card, .vehicle-summary-card, .transport-chain-panel, .safe-delete-card,
        .trip-panel, .metric-card, .document-chip) {
        border-color: var(--workspace-line) !important;
        border-radius: var(--workspace-radius) !important;
        background: var(--workspace-surface) !important;
        color: var(--workspace-text); box-shadow: none !important;
    }
    html body.uikit-theme.crm-workspace-theme :is(.page-heading, .directory-titlebar, .onec-titlebar) h1 {
        font-size: 28px; line-height: 1.3; font-weight: 650;
        letter-spacing: -.6px; color: var(--workspace-text) !important;
    }
    html body.uikit-theme.crm-workspace-theme :is(.form-section-title, .onec-register-header,
        .directory-titlebar, .driver-modal-titlebar, .order-command-title) :is(h1, h2) {
        color: var(--workspace-text) !important; font-size: 20px; line-height: 1.4; font-weight: 600;
    }
    html body.uikit-theme.crm-workspace-theme :is(.form-section-title, .onec-register-header,
        .page-heading, .directory-titlebar, .onec-titlebar) p {
        color: var(--workspace-muted) !important; font-size: 13px; line-height: 1.6;
    }
    html body.uikit-theme.crm-workspace-theme :is(.form-section-title, .onec-register-header) {
        background: transparent !important; border-color: var(--workspace-line) !important;
        box-shadow: none !important;
    }
    html body.uikit-theme.crm-workspace-theme :is(.eyebrow, .uk-text-meta, .uk-text-muted) { color: var(--workspace-muted) !important; }
    html body.uikit-theme.crm-workspace-theme :is(.section-number, .form-section-number,
        .order-register-heading-icon, .directory-heading-icon, .metric-icon) {
        background: var(--workspace-soft) !important; color: var(--workspace-accent) !important; border-radius: 8px !important;
    }
    html body.uikit-theme.crm-workspace-theme .filters {
        gap: 12px; border-color: var(--workspace-line) !important;
        background: var(--workspace-surface) !important; border-radius: 12px !important;
        box-shadow: none !important;
    }
    html body.uikit-theme.crm-workspace-theme :is(.heading-actions, .form-actions, .order-command-actions, .onec-commandbar) { gap: 10px; }
    html body.uikit-theme.crm-workspace-theme :is(.uk-button, .btn) {
        border-radius: 8px !important; min-height: 40px;
        font-size: 13px; font-weight: 500; text-transform: none;
        box-shadow: none !important;
    }
    html body.uikit-theme.crm-workspace-theme :is(.uk-button-default, .btn-secondary) {
        color: var(--workspace-text) !important; border-color: var(--workspace-line) !important;
        background: var(--workspace-surface) !important;
    }
    html body.uikit-theme.crm-workspace-theme :is(.uk-button-primary, .btn-primary) {
        color: #fff !important; background: #d10000 !important; border-color: #d10000 !important;
    }
    html body.uikit-theme.crm-workspace-theme .uk-button-secondary {
        color: var(--workspace-text) !important; background: var(--workspace-soft) !important; border-color: var(--workspace-line) !important;
    }
    html body.uikit-theme.crm-workspace-theme :is(.uk-button-danger, .driver-delete-button,
        .driver-phone-remove, .driver-add-phone, .driver-add-passport, .driver-add-license) {
        color: var(--workspace-accent) !important; border-color: var(--workspace-accent) !important;
        background: transparent !important;
    }
    html body.uikit-theme.crm-workspace-theme .uk-button-primary:hover:not(:disabled) { background: #b60000 !important; border-color: #b60000 !important; }
    html body.uikit-theme.crm-workspace-theme .uk-button-default:hover:not(:disabled) { background: var(--workspace-soft) !important; }
    html body.uikit-theme.crm-workspace-theme :is(.uk-button, .btn):is(:disabled, [aria-disabled="true"]) {
        color: var(--workspace-muted) !important; border-color: var(--workspace-line) !important;
        background: var(--workspace-soft) !important; opacity: .55; box-shadow: none !important; cursor: not-allowed;
    }
    html body.uikit-theme.crm-workspace-theme :is(.uk-input, .uk-select, .uk-textarea,
        .form-control, .form-select, .crm-smart-search) {
        border-radius: 9px !important; border-color: var(--workspace-line) !important;
        background-color: var(--workspace-surface) !important; color: var(--workspace-text) !important;
        font-family: inherit; font-size: 14px; font-weight: 400; box-shadow: none;
    }
    html body.uikit-theme.crm-workspace-theme :is(.uk-input, .uk-select, .uk-textarea,
        .form-control, .form-select, .crm-smart-search):focus {
        border-color: var(--workspace-accent) !important; outline: 2px solid var(--workspace-focus); outline-offset: 0;
    }
    html body.uikit-theme.crm-workspace-theme :is(.uk-input, .uk-select, .uk-textarea, .form-control):disabled {
        background-color: var(--workspace-soft) !important; color: var(--workspace-muted) !important;
    }
    html body.uikit-theme.crm-workspace-theme [aria-invalid="true"],
    html body.uikit-theme.crm-workspace-theme :is(.uk-form-danger, .is-invalid) { border-color: #d10000 !important; }
    html body.uikit-theme.crm-workspace-theme input:is([type="checkbox"], [type="radio"]) { accent-color: #d10000; }
    html body.uikit-theme.crm-workspace-theme :is(.crm-smart-dropdown, .crm-address-dropdown, .uk-dropdown, .uk-navbar-dropdown) {
        background: var(--workspace-surface) !important; color: var(--workspace-text) !important;
        border-color: var(--workspace-line) !important; border-radius: 10px !important;
        box-shadow: 0 12px 32px #00000014;
    }
    html body.uikit-theme.crm-workspace-theme :is(.crm-smart-option, .crm-address-option) { color: var(--workspace-text) !important; background: transparent !important; }
    html body.uikit-theme.crm-workspace-theme :is(.crm-smart-option, .crm-address-option):is(:hover, .is-active) { background: var(--workspace-soft) !important; }
    html body.uikit-theme.crm-workspace-theme .uk-table { color: var(--workspace-text); background: var(--workspace-surface) !important; font-size: 13px; }
    html body.uikit-theme.crm-workspace-theme .uk-table th {
        background: var(--workspace-soft) !important; color: var(--workspace-muted) !important;
        border-color: var(--workspace-line) !important; padding-top: 16px; padding-bottom: 16px;
        font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0;
    }
    html body.uikit-theme.crm-workspace-theme .uk-table th a { color: inherit !important; }
    html body.uikit-theme.crm-workspace-theme .uk-table td {
        background: var(--workspace-surface) !important; border-color: var(--workspace-line) !important;
        padding-top: 18px; padding-bottom: 18px; color: var(--workspace-text);
    }
    html body.uikit-theme.crm-workspace-theme .uk-table tr { border-color: var(--workspace-line) !important; }
    html body.uikit-theme.crm-workspace-theme .uk-table tbody tr:hover td,
    html body.uikit-theme.crm-workspace-theme .uk-table tbody tr.is-selected td { background: var(--workspace-soft) !important; }
    /* The transportation register paints a row as one surface.  Individual
       cells remain transparent, so the finance column cannot form a separate
       coloured rectangle inside the selected row. */
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-table tbody tr {
        background: var(--workspace-surface) !important;
    }
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-table tbody tr > td {
        background: transparent !important;
        background-image: none !important;
    }
    html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-table tbody tr:is(:hover, .is-selected) {
        background: var(--workspace-soft) !important;
    }
    html body.uikit-theme.crm-workspace-theme .uk-table td small { color: var(--workspace-muted) !important; font-size: 12px; line-height: 1.5; }
    html body.uikit-theme.crm-workspace-theme .uk-table .primary-link { color: var(--workspace-text) !important; font-weight: 600; }
    html body.uikit-theme.crm-workspace-theme .uk-table .primary-link:hover { color: var(--workspace-accent) !important; }
    html body.uikit-theme.crm-workspace-theme :is(.table-wrap, .order-register-panel) { border-radius: 12px !important; }
    html body.uikit-theme.crm-workspace-theme :is(.driver-phone-card, .driver-passport-card,
        .driver-carrier-card, .order-route-stop, .document-chip) {
        background: var(--workspace-soft) !important; border-color: var(--workspace-line) !important;
        border-left-color: var(--workspace-accent) !important; border-radius: 9px !important;
    }
    html body.uikit-theme.crm-workspace-theme :is(.order-command-header, .driver-command-panel) {
        background: var(--workspace-surface) !important; border-color: var(--workspace-line) !important;
    }
    html body.uikit-theme.crm-workspace-theme :is(.uk-modal-dialog, .modal-content) {
        background: var(--workspace-surface) !important; color: var(--workspace-text);
        border: 1px solid var(--workspace-line); border-radius: 16px !important;
    }
    html body.uikit-theme.crm-workspace-theme.order-modal-page .main > .content {
        padding: 0; background: var(--workspace-surface); border-radius: 0;
    }
    html body.uikit-theme.crm-workspace-theme :is(.uk-tab, .detail-tabs) { border-color: var(--workspace-line); }
    html body.uikit-theme.crm-workspace-theme .uk-tab > li > a { color: var(--workspace-muted); text-transform: none; font-size: 13px; }
    html body.uikit-theme.crm-workspace-theme .uk-tab > .uk-active > a { color: var(--workspace-text); border-color: var(--workspace-accent); }
    html body.uikit-theme.crm-workspace-theme .metric-card strong { color: var(--workspace-text); }
    html body.uikit-theme.crm-workspace-theme .metric-card.uk-card-primary { background: var(--workspace-tint) !important; color: var(--workspace-text) !important; }
    html body.uikit-theme.crm-workspace-theme .metric-card :is(span, small) { color: var(--workspace-muted); }
    html body.uikit-theme.crm-workspace-theme .register-pagination { border: 0; background: transparent !important; color: var(--workspace-muted); font-size: 12px; }
    html body.uikit-theme.crm-workspace-theme :is(.chat-sidebar, .chat-main, .chat-messages,
        .chat-header, .chat-compose, .planner-toolbar, .planner-board, .planner-column) {
        background: var(--workspace-surface) !important; border-color: var(--workspace-line) !important; color: var(--workspace-text);
    }
    html body.uikit-theme.crm-workspace-theme :is(.chat-conversation.is-active, .chat-avatar, .planner-task) { background: var(--workspace-soft) !important; color: var(--workspace-text); border-color: var(--workspace-line) !important; }
    html body.uikit-theme.crm-workspace-theme hr { border-color: var(--workspace-line) !important; }
    html body.uikit-theme.crm-workspace-theme .driver-command-panel::after { background: var(--workspace-line) !important; }
    html body.uikit-theme.crm-workspace-theme :is(.driver-modal-titlebar, .vehicle-command-panel, .form-section-title, .driver-personal-grid) { border-color: var(--workspace-line) !important; }
    html body.uikit-theme.crm-workspace-theme .transportation-card :is(.transportation-status-progress,
        .transportation-summary, .transport-chain-panel, .panel, .transportation-finance-card,
        .transport-chain-node, .driver-copy-card, .route-stop-list article, .onec-details-grid > div,
        .trip-finance-card, .trip-finance-flow, .trip-finance-settlements article) {
        background: var(--workspace-surface) !important; border-color: var(--workspace-line) !important;
        border-radius: 12px !important; color: var(--workspace-text);
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card :is(.transportation-titlebar h2, .trip-breadcrumbs strong) { color: var(--workspace-text); }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-summary-grid {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
        gap: 20px; margin: 0;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-summary-grid > div {
        width: auto; min-width: 0; max-width: none; padding: 0; margin: 0;
        border: 0; box-sizing: border-box;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-summary-grid :is(strong, a) {
        display: block; width: auto; max-width: none; white-space: normal;
        overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.5;
    }
    /* Trip cards must fit the workspace, not the full browser width. */
    html body.uikit-theme.crm-workspace-theme .transportation-card { min-width: 0; color: var(--workspace-text); }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-overview-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-overview-grid > .transportation-finance-card {
        grid-column: auto !important; grid-row: auto !important;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card :is(.transportation-role-card, .transportation-finance-card) {
        min-width: 0; container-type: inline-size;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card :is(h2, h3, dd, p, a, strong) { overflow-wrap: anywhere; }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-role-card dl {
        grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr); align-items: start;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card :is(dt, .transportation-role-card p, .driver-copy-card small) { color: var(--workspace-muted) !important; }
    html body.uikit-theme.crm-workspace-theme .transportation-card :is(dd, h2, h3) { color: var(--workspace-text); }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-titlebar {
        flex-wrap: wrap; gap: 16px; background: transparent !important;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-commandbar { flex-wrap: wrap; justify-content: flex-start; }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-finance-card :is(.trip-finance-hero, .trip-finance-mini-grid article) {
        background: var(--workspace-soft) !important; border-color: var(--workspace-line) !important;
        border-radius: 10px; min-width: 0;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-finance-card .trip-finance-mini-grid {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-finance-card .trip-finance-mini-grid article {
        grid-column: auto !important; grid-row: auto !important;
    }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-finance-card :is(span, small) { color: var(--workspace-muted) !important; }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-finance-card strong { color: var(--workspace-text) !important; white-space: normal; }
    html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-finance-card .amount-problem { color: var(--workspace-accent) !important; }
    @container (max-width: 500px) {
        html body.uikit-theme.crm-workspace-theme .transportation-card .trip-finance-hero { grid-template-columns: minmax(0, 1fr); padding: 16px; }
        html body.uikit-theme.crm-workspace-theme .transportation-card .trip-finance-hero strong { grid-column: 1; grid-row: auto; text-align: left; font-size: 26px; }
        html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-role-card dl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
        html body.uikit-theme.crm-workspace-theme .transportation-card .transportation-role-card dd { text-align: left; margin-bottom: 12px; }
    }
    /* Keep the accepted orders composition; do not add a second container. */
    html body.uikit-theme.crm-workspace-theme.orders-workspace-page .order-register-filters { background: transparent !important; }
}
@media (min-width: 1200px) {
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar { background: var(--workspace-shell) !important; border-right: 0; padding: 26px 18px; }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .brand { color: var(--workspace-text); }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-group { border-top: 1px solid var(--workspace-line); padding: 16px 10px 4px; margin-top: 14px; color: var(--workspace-muted); font-size: 11px; }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-list a { border-radius: 8px; padding: 10px 14px; color: var(--workspace-text); }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-list a:is(.is-active, :hover) { background: var(--workspace-surface); color: var(--workspace-text); }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar .mobile-nav-list a.is-active { font-weight: 600; box-shadow: 0 1px 4px #00000005; }
}
@media screen and (max-width: 1199px) {
    html body.uikit-theme.crm-workspace-theme:not(.order-modal-page):not(.orders-workspace-page) .app-shell-topnav > .main { padding: 16px; }
    html body.uikit-theme.crm-workspace-theme:not(.order-modal-page):not(.orders-workspace-page) .main > .content { padding: 24px; }
}
@media screen and (max-width: 720px) {
    html body.uikit-theme.crm-workspace-theme:not(.order-modal-page):not(.orders-workspace-page) .app-shell-topnav > .main { padding: 10px; }
    html body.uikit-theme.crm-workspace-theme:not(.order-modal-page):not(.orders-workspace-page) .main > .content { padding: 18px 14px; border-radius: 16px; }
    html body.uikit-theme.crm-workspace-theme :is(.page-heading, .directory-titlebar, .onec-titlebar) h1 { font-size: 24px; overflow-wrap: anywhere; }
    html body.uikit-theme.crm-workspace-theme .filters { padding: 12px; }
    html body.uikit-theme.crm-workspace-theme .uk-table td { padding-top: 10px; padding-bottom: 10px; }
    /* On touch screens a tap can leave :hover stuck on a table row. Keep
       registry rows visually neutral; statuses carry the necessary warning. */
    html body.uikit-theme.crm-workspace-theme .uk-table tbody tr:is(:hover, :focus-within, .is-selected) > td {
        background: var(--workspace-surface) !important;
    }
    html body.uikit-theme.crm-workspace-theme .uk-modal-dialog { border-radius: 12px !important; }
    /* The driver lookup is the primary control on the directory page. Keep it
       on its own full-width row and retain the icon inside the input. */
    html body.driver-directory-page .driver-register-filters .driver-search-field {
        display: block;
        box-sizing: border-box;
        width: 100% !important;
        max-width: none !important;
        flex: 0 0 100% !important;
    }
    html body.driver-directory-page .driver-register-filters .driver-search-field > .uk-icon {
        position: absolute;
        z-index: 1;
        top: 50%;
        left: 14px;
        transform: translateY(-50%);
        pointer-events: none;
    }
    html body.driver-directory-page .driver-register-filters .driver-search-field .search {
        box-sizing: border-box;
        width: 100% !important;
        min-width: 0;
        padding-left: 43px !important;
    }
    /* The desktop register assigns a fixed cell height. Once a table row is
       presented as a mobile card, that height makes subsequent fields overlap. */
    html body.driver-directory-page .driver-directory-table,
    html body.driver-directory-page .driver-directory-table tbody,
    html body.driver-directory-page .driver-directory-table tr,
    html body.driver-directory-page .driver-directory-table td {
        display: block;
        box-sizing: border-box;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
    }
    html body.driver-directory-page .driver-directory-table tbody tr {
        padding: 16px;
    }
    html body.driver-directory-page .driver-directory-table td {
        min-height: 0 !important;
        padding: 11px 0;
        overflow: visible;
        white-space: normal !important;
    }
    html body.driver-directory-page .driver-directory-table td small {
        display: block;
        line-height: 1.45;
    }
    html body.driver-directory-page .driver-directory-table .driver-register-select { display: none !important; }
    /* Keep all driver cards neutral on mobile, including expired licences. */
    html body.driver-directory-page .driver-directory-table tbody tr {
        background: var(--workspace-surface) !important;
    }
    html body.driver-directory-page .driver-directory-table td {
        background: transparent !important;
    }
    html body.driver-directory-page .driver-directory-table tbody tr.driver-license-expired-row {
        background: var(--workspace-surface) !important;
    }
    html body.driver-directory-page .driver-directory-table tbody tr.driver-license-expired-row > td {
        background: transparent !important;
    }
    html body.uikit-theme.crm-workspace-theme.driver-directory-page .driver-directory-table tr.driver-license-expired-row > td {
        background: var(--workspace-surface) !important;
    }
}

/* Keep these desktop dock rules last: legacy page styles also address the
   former top navigation controls. */
@media screen and (min-width: 1200px) {
    /* When a registry is scrolled, the space revealed above its card must
       remain part of the neutral workspace rather than flash white. */
    html body.uikit-theme.crm-workspace-theme .app-shell.app-shell-topnav,
    html body.uikit-theme.crm-workspace-theme .app-shell-topnav > .crm-topnav {
        background: var(--workspace-shell) !important;
    }
    html body.uikit-theme.crm-workspace-theme .app-shell-topnav > .main > .content {
        min-height: calc(100dvh - 48px);
        padding: 32px;
        border-radius: 18px;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .topnav-action-label {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options button {
        width: auto;
        min-width: 0;
        height: 32px;
        padding: 0 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options button span:last-child { display: inline; }

    /* The sidebar dock must keep its theme control legible.  It shares markup
       with the former header controls, so make the desktop-dock treatment
       explicit after all generic header rules. */
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools {
        z-index: 1100;
        max-height: calc(100dvh - 40px);
        overflow-y: auto;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher {
        display: grid;
        width: 100%;
        gap: 6px;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-label {
        display: block;
        padding: 0 10px;
        color: var(--workspace-muted);
        font-size: 11px;
        font-weight: 650;
        letter-spacing: .05em;
        text-transform: uppercase;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        min-height: 38px;
        padding: 3px;
        border: 0;
        border-radius: 9px;
        background: var(--workspace-soft);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options button {
        width: 100%;
        min-width: 0;
        min-height: 32px;
        height: 32px;
        padding: 0 6px;
        border: 0;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        color: var(--workspace-muted);
        background: transparent;
        font-size: 11px;
        cursor: pointer;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options button:is(:hover, :focus-visible) {
        color: var(--workspace-text);
        background: color-mix(in srgb, var(--workspace-surface) 74%, transparent);
        outline: none;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options button[aria-pressed="true"] {
        color: var(--workspace-text);
        background: var(--workspace-surface);
        box-shadow: 0 1px 4px rgba(41, 41, 45, .10);
        font-weight: 650;
    }

    /* On desktop the tool dock is physically placed in the sidebar. This
       avoids it being clipped by the collapsed legacy top navigation. */
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar > .crm-topnav-tools {
        position: static;
        z-index: auto;
        width: 100%;
        max-height: none;
        margin-top: auto;
        overflow: visible;
        flex: 0 0 auto;
    }
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar > .mobile-nav-list {
        padding-bottom: 12px;
    }
}

/* Final dark-mode overrides: component styles above contain legacy light-theme
   red literals, therefore these rules deliberately come last. */
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .driver-profile-avatar, .organization-profile-avatar, .trip-profile-avatar,
    .organization-view-primary,
    .organization-profile-doc-summary .is-warning,
    .transportation-role-card .eyebrow, .transportation-finance-card .eyebrow
) { color: #a98cff !important; }
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .organization-view-record, .organization-profile-document.is-current,
    .driver-profile-document.is-current, .driver-profile-document.is-expired,
    .driver-profile-phone-list a, .contract-profile .contract-parties article,
    .trip-workspace .route-stop-list article, .transportation-status-progress
) { border-left-color: #7c4dff !important; }
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .driver-directory-table tr.driver-license-expired-row > td,
    .driver-profile-document.is-expired, .trip-profile-status.is-danger
) {
    color: #f5f5f5 !important;
    border-color: #7c4dff !important;
    background: #2d214b !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    [data-driver-form] :is(input, select, textarea):is([aria-invalid="true"], .is-phone-invalid),
    [aria-invalid="true"], .uk-form-danger, .is-invalid
) { border-color: #7c4dff !important; }
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    [data-driver-form] [data-driver-phone-add],
    [data-driver-form] [data-passport-add],
    [data-driver-form] [data-license-add],
    [data-driver-form] [data-driver-phone-remove]
) { color: #a98cff !important; border-color: #7c4dff !important; }

/* Neutral graphite surfaces replace the older blue-tinted detail cards. */
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .contract-profile, .trip-workspace, #contract-form
) {
    --workspace-surface: #202020 !important;
    --workspace-soft: #292929 !important;
    --workspace-line: #3b3b3b !important;
    --workspace-text: #f5f5f5 !important;
    --workspace-muted: #b7b3be !important;
}
html[data-theme="dark"] body.organization-card-page :is(
    .organization-profile-card, .organization-view-section
) {
    border-color: #3b3b3b !important;
    background: #202020 !important;
}
html[data-theme="dark"] body.organization-card-page :is(
    .organization-view-record, .organization-view-role-box,
    .organization-view-state-box, .organization-view-empty,
    .organization-profile-document, .organization-profile-contract-table th
) {
    border-color: #3b3b3b !important;
    background: #292929 !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .driver-view-empty, .vehicle-view-empty, .document-register-filters,
    .document-chip, .transportation-card .transportation-summary,
    .transportation-card .transport-chain-panel, .transportation-card .panel,
    .transportation-card .transportation-finance-card, .trip-profile-card
) {
    border-color: #3b3b3b !important;
    background: #202020 !important;
}

/* Compact sidebar accordion: submenu items read as one navigation path,
   rather than as a separate card beneath every section. */
html body.crm-workspace-theme .crm-nav-block {
    margin: 3px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}
html body.crm-workspace-theme .crm-nav-block-title {
    min-height: 40px;
    padding: 0 12px !important;
    border-radius: 8px;
    font-size: 14px !important;
}
html body.crm-workspace-theme .crm-nav-block[open] > .crm-nav-block-title {
    color: var(--workspace-text);
    background: var(--workspace-soft);
}
html body.crm-workspace-theme .crm-nav-block-title::after {
    width: 7px;
    height: 7px;
    transition: transform .16s ease;
}
html body.crm-workspace-theme .crm-nav-block-links {
    display: grid;
    gap: 2px;
    margin: 3px 0 8px 23px;
    padding: 3px 0 4px 12px !important;
    border-left: 1px solid var(--workspace-line);
}
html body.crm-workspace-theme .mobile-nav-list .crm-nav-block-links a {
    position: relative;
    min-height: 34px;
    padding: 7px 10px !important;
    border-radius: 7px;
    color: var(--workspace-muted);
    font-size: 13px !important;
}
html body.crm-workspace-theme .mobile-nav-list .crm-nav-block-links a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -16px;
    width: 5px;
    height: 5px;
    border: 1px solid var(--workspace-line);
    border-radius: 50%;
    background: var(--workspace-surface);
    transform: translateY(-50%);
}
html body.crm-workspace-theme .mobile-nav-list .crm-nav-block-links a:is(.is-active, :hover) {
    color: var(--workspace-text);
    background: var(--workspace-tint) !important;
}
html body.crm-workspace-theme .mobile-nav-list .crm-nav-block-links a.is-active::before {
    border-color: var(--workspace-accent);
    background: var(--workspace-accent);
}

/* The fleet is an operational register, so its table frame stays square on
   every viewport rather than inheriting the rounded card treatment. */
html body.uikit-theme.crm-workspace-theme.vehicle-directory-page :is(
    .vehicle-register-panel, .vehicle-register-panel .table-wrap,
    .vehicle-directory-table, .vehicle-directory-table :is(thead, tbody, tr, th, td)
) {
    border-radius: 0 !important;
}
html body.uikit-theme.crm-workspace-theme.vehicle-directory-page .vehicle-register-panel {
    border: 1px solid var(--workspace-line) !important;
    box-shadow: none !important;
}

/* Service dock: chat, notifications and appearance use the same calm
   full-width control treatment at the base of the sidebar. */
@media screen and (min-width: 1200px) {
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .crm-dock-chat,
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-toggle,
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .topnav-logout-button {
        position: relative;
        width: 100%;
        min-height: 38px;
        padding: 0 10px;
        border: 0;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 9px;
        color: var(--workspace-text);
        background: transparent;
        font-size: 13px;
        font-weight: 600;
        text-decoration: none;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools :is(.crm-dock-chat, .navbar-notification-toggle, .topnav-logout-button):is(:hover, :focus-visible) {
        color: var(--workspace-text);
        background: var(--workspace-soft);
        outline: none;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .crm-dock-chat.is-active {
        color: var(--workspace-accent);
        background: var(--workspace-tint);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .crm-dock-chat .nav-unread {
        margin-left: auto;
        min-width: 18px;
        min-height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        display: inline-grid;
        place-items: center;
        color: #fff;
        background: var(--workspace-accent);
        font-size: 10px;
        line-height: 1;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-count {
        top: 7px;
        right: 8px;
        color: #fff;
        background: var(--workspace-accent);
    }
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .navbar-notification-menu, .navbar-notification-menu header,
    .navbar-notification-item
) {
    border-color: #3b3b3b !important;
    color: #f5f5f5 !important;
    background: #202020 !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme .navbar-notification-item:hover {
    background: #292929 !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme :is(
    .navbar-notification-item-icon, .navbar-notification-menu header button
) {
    color: #a98cff !important;
    background: #2d214b !important;
}

/* Fleet register follows the same dense, full-width work-table geometry as
   the driver register. Earlier vehicle rules predated the selection column. */
@media screen and (min-width: 721px) {
    html body.vehicle-directory-page .vehicle-register-filters {
        gap: 6px !important;
    }
    html body.vehicle-directory-page .vehicle-register-filters .vehicle-search-field {
        width: auto;
        max-width: none;
        flex: 1 1 420px;
    }
    html body.vehicle-directory-page .vehicle-register-panel,
    html body.vehicle-directory-page .vehicle-register-panel .table-wrap {
        width: 100%;
        border-radius: 0 !important;
    }
    html body.vehicle-directory-page .vehicle-directory-table {
        width: 100% !important;
        min-width: 1080px;
        table-layout: fixed;
    }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(1) {
        width: 56px !important;
        min-width: 56px;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: center;
    }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(2) { width: 14% !important; }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(3) { width: 25% !important; }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(4) { width: 19% !important; }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(5) { width: 23% !important; }
    html body.vehicle-directory-page .vehicle-directory-table :is(th, td):nth-child(6) { width: 13% !important; }
    html body.vehicle-directory-page .vehicle-directory-table th {
        padding: 10px !important;
    }
    html body.vehicle-directory-page .vehicle-directory-table td {
        padding: 7px 10px !important;
        vertical-align: top;
    }
    html body.vehicle-directory-page .vehicle-directory-table td > small {
        margin-top: 2px;
        line-height: 1.35;
    }
    html body.vehicle-directory-page .vehicle-directory-table .driver-registry-status {
        line-height: 18px;
        font-size: 12px;
    }
}

/* Quiet utility footer: the service actions belong to navigation, not to a
   separate floating card. */
@media screen and (min-width: 1200px) {
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar > .crm-topnav-tools {
        gap: 2px;
        margin-top: auto;
        padding: 13px 4px 0;
        border: 0;
        border-top: 1px solid var(--workspace-line);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .crm-dock-chat,
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-toggle,
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .topnav-logout-button {
        min-height: 36px;
        padding: 0 9px;
        border-radius: 7px;
        color: var(--workspace-muted);
        font-weight: 500;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools :is(.crm-dock-chat, .navbar-notification-toggle, .topnav-logout-button):is(:hover, :focus-visible) {
        color: var(--workspace-text);
        background: var(--workspace-soft);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .crm-dock-chat.is-active {
        color: var(--workspace-accent);
        background: transparent;
        box-shadow: inset 2px 0 0 var(--workspace-accent);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher {
        margin: 8px 0 7px;
        padding: 8px 9px;
        border-top: 1px solid var(--workspace-line);
        border-bottom: 1px solid var(--workspace-line);
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-label {
        padding: 0;
        font-size: 10px;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options {
        box-sizing: border-box;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3px;
        min-height: 34px;
        padding: 2px;
        border: 1px solid var(--workspace-line);
        border-radius: 7px;
        background: transparent;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options button {
        box-sizing: border-box;
        width: 100%;
        min-height: 29px;
        height: 29px;
        margin: 0;
        border-radius: 5px;
        font-size: 10px;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .theme-switcher-options button[aria-pressed="true"] {
        color: var(--workspace-accent);
        background: var(--workspace-tint);
        box-shadow: none;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .topnav-admin-button {
        margin-top: 1px;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .topnav-signout-button {
        color: var(--workspace-muted);
    }

    /* Notification popover opens above the footer dock. The sidebar itself
       must not clip that popover once the dock is moved inside it. */
    html body.uikit-theme.crm-workspace-theme .crm-desktop-sidebar {
        overflow: visible;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-center {
        position: relative;
        overflow: visible;
    }
    html body.uikit-theme.crm-workspace-theme .crm-topnav-tools .navbar-notification-menu {
        z-index: 1200;
        top: auto;
        bottom: calc(100% + 10px);
        left: 0;
        right: auto;
        overflow: hidden;
    }
}

/* Chat: a compact, calm correspondence workspace. */
html body.crm-workspace-theme .chat-shell {
    min-height: 680px;
    overflow: hidden;
    border: 1px solid var(--workspace-line);
    border-radius: 14px;
    grid-template-columns: 300px minmax(0, 1fr);
    background: var(--workspace-surface);
    box-shadow: none;
}
html body.crm-workspace-theme .chat-sidebar {
    border-color: var(--workspace-line);
    background: var(--workspace-soft);
}
html body.crm-workspace-theme .chat-start-form {
    padding: 16px;
    border-color: var(--workspace-line);
    background: var(--workspace-surface);
}
html body.crm-workspace-theme .chat-start-form .uk-form-label {
    margin-bottom: 8px;
    color: var(--workspace-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}
html body.crm-workspace-theme .chat-start-form .uk-button {
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
}
html body.crm-workspace-theme .chat-conversation-list { max-height: none; }
html body.crm-workspace-theme .chat-conversation {
    padding: 13px 16px;
    border-bottom-color: var(--workspace-line);
    box-shadow: inset 3px 0 transparent;
    color: var(--workspace-text);
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
html body.crm-workspace-theme .chat-conversation:hover {
    color: var(--workspace-text);
    background: var(--workspace-surface);
    text-decoration: none;
}
html body.crm-workspace-theme .chat-conversation.is-active {
    color: var(--workspace-text);
    background: var(--workspace-surface);
    box-shadow: inset 3px 0 var(--workspace-accent);
}
html body.crm-workspace-theme .chat-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 10px;
    color: var(--workspace-accent);
    background: var(--workspace-tint);
    font-size: 13px;
}
html body.crm-workspace-theme .chat-avatar.large {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 10px;
}
html body.crm-workspace-theme :is(.chat-conversation-copy small, .chat-header small, .chat-empty-list, .chat-placeholder, .chat-thread-empty) { color: var(--workspace-muted); }
html body.crm-workspace-theme .chat-main { background: var(--workspace-surface); }
html body.crm-workspace-theme .chat-header {
    min-height: 66px;
    padding: 12px 18px;
    border-color: var(--workspace-line);
    background: var(--workspace-surface);
}
html body.crm-workspace-theme .chat-header strong { font-size: 14px; }
html body.crm-workspace-theme .chat-thread {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
    padding: 20px;
    gap: 10px;
    background: var(--workspace-soft);
}
html body.crm-workspace-theme .chat-message > div {
    max-width: min(620px, 78%);
    padding: 9px 12px 8px;
    border: 1px solid var(--workspace-line);
    border-radius: 10px 10px 10px 2px;
    color: var(--workspace-text);
    background: var(--workspace-surface);
    box-shadow: none;
}
html body.crm-workspace-theme .chat-message.is-mine > div {
    border-color: var(--workspace-accent);
    border-radius: 10px 10px 2px 10px;
    color: #fff;
    background: var(--workspace-accent);
}
html body.crm-workspace-theme .chat-message strong { font-size: 10px; font-weight: 650; }
html body.crm-workspace-theme .chat-compose {
    padding: 12px 16px;
    gap: 8px;
    border-color: var(--workspace-line);
    background: var(--workspace-surface);
}
html body.crm-workspace-theme .chat-compose textarea {
    min-height: 42px;
    border-color: var(--workspace-line);
    border-radius: 8px;
    background: var(--workspace-soft);
}
html body.crm-workspace-theme .chat-compose .uk-button { min-height: 42px; border-radius: 8px; }
html body.crm-workspace-theme .chat-file-button {
    min-height: 42px;
    border-color: var(--workspace-line);
    border-radius: 8px;
    color: var(--workspace-muted);
    background: var(--workspace-soft);
}
html body.crm-workspace-theme .chat-file-button:hover { border-color: var(--workspace-accent); color: var(--workspace-accent); }
html body.crm-workspace-theme .chat-compose .chat-compose-hint { color: var(--workspace-muted); }
html body.crm-workspace-theme .chat-attachment {
    border-color: var(--workspace-line);
    border-radius: 7px;
    color: var(--workspace-accent);
    background: var(--workspace-tint);
}
html body.crm-workspace-theme .chat-message.is-mine .chat-attachment { border-color: rgba(255,255,255,.32); color: #fff; background: rgba(255,255,255,.12); }
html body.chat-embed-page .chat-shell { min-height: 100dvh; border: 0; border-radius: 0; }

.crm-chat-popup-panel { width: min(980px, calc(100vw - 40px)); border-radius: 16px; }
.crm-chat-popup-panel > header { height: 56px; padding: 0 14px 0 18px; }
.crm-chat-popup-title { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; }
.crm-chat-popup-title i { width: 8px; height: 8px; border-radius: 50%; color: transparent; background: var(--workspace-accent); }
.crm-chat-popup-panel > header a { padding: 6px 8px; border-radius: 6px; }
.crm-chat-popup-panel > header a:hover { background: var(--workspace-soft); }

html[data-theme="dark"] body.crm-workspace-theme .chat-thread { background: #1a1a1a; }
html[data-theme="dark"] body.crm-workspace-theme .chat-message > div { border-color: var(--workspace-line); background: #202020; }
html[data-theme="dark"] body.crm-workspace-theme .chat-message.is-mine > div { border-color: var(--workspace-accent); background: var(--workspace-accent); }

@media (max-width: 720px) {
    html body.crm-workspace-theme .chat-shell { min-height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
    html body.crm-workspace-theme .chat-thread { min-height: 360px; padding: 14px; }
    html body.crm-workspace-theme .chat-compose { padding: 10px 12px; }
    html body.crm-workspace-theme .chat-message > div { max-width: 88%; }
}

/* Messenger layout: familiar direct-message mechanics, without CRM chrome. */
html body.crm-workspace-theme .chat-shell { grid-template-columns: 320px minmax(0, 1fr); }
html body.crm-workspace-theme .chat-list-toolbar {
    min-height: 62px;
    padding: 0 16px;
    border-bottom: 1px solid var(--workspace-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--workspace-surface);
}
html body.crm-workspace-theme .chat-list-toolbar > div { display: grid; gap: 2px; }
html body.crm-workspace-theme .chat-list-toolbar strong { font-size: 15px; font-weight: 650; }
html body.crm-workspace-theme .chat-list-toolbar small { color: var(--workspace-muted); font-size: 11px; }
html body.crm-workspace-theme .chat-new-dialog-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--workspace-accent);
    cursor: pointer;
}
html body.crm-workspace-theme .chat-new-dialog-toggle:hover { filter: brightness(.94); }
html body.crm-workspace-theme .chat-start-form { padding: 12px 14px; }
html body.crm-workspace-theme .chat-start-form[hidden] { display: none !important; }
html body.crm-workspace-theme .chat-start-form .uk-form-label { margin-bottom: 7px; }
html body.crm-workspace-theme .chat-start-form .uk-button { min-width: auto; padding: 0 11px; font-size: 12px; }
html body.crm-workspace-theme .chat-conversation-search {
    position: relative;
    margin: 10px 12px;
    display: block;
    color: var(--workspace-muted);
}
html body.crm-workspace-theme .chat-conversation-search .uk-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 11px;
    transform: translateY(-50%);
    pointer-events: none;
}
html body.crm-workspace-theme .chat-conversation-search input {
    box-sizing: border-box;
    width: 100%;
    height: 36px;
    padding: 0 10px 0 34px;
    border: 1px solid transparent;
    border-radius: 8px;
    outline: none;
    color: var(--workspace-text);
    background: var(--workspace-surface);
    font: inherit;
    font-size: 12px;
}
html body.crm-workspace-theme .chat-conversation-search input:focus { border-color: var(--workspace-accent); }
html body.crm-workspace-theme .chat-conversation-list { max-height: calc(100dvh - 240px); }
html body.crm-workspace-theme .chat-conversation {
    min-height: 64px;
    padding: 10px 14px;
    gap: 10px;
    border-bottom: 0;
    box-shadow: none;
}
html body.crm-workspace-theme .chat-conversation + .chat-conversation { border-top: 1px solid color-mix(in srgb, var(--workspace-line) 70%, transparent); }
html body.crm-workspace-theme .chat-conversation.is-active { box-shadow: inset 3px 0 var(--workspace-accent); }
html body.crm-workspace-theme .chat-conversation-copy strong { font-size: 13px; font-weight: 650; }
html body.crm-workspace-theme .chat-conversation-copy small { margin-top: 2px; font-size: 11px; }
html body.crm-workspace-theme .chat-header {
    min-height: 62px;
    padding: 10px 18px;
    box-sizing: border-box;
}
html body.crm-workspace-theme .chat-header > div { gap: 2px; }
html body.crm-workspace-theme .chat-header strong { font-size: 14px; font-weight: 650; }
html body.crm-workspace-theme .chat-thread {
    padding: 18px 20px;
    gap: 8px;
    background-image: radial-gradient(color-mix(in srgb, var(--workspace-line) 72%, transparent) .6px, transparent .6px);
    background-size: 12px 12px;
}
html body.crm-workspace-theme .chat-message > div { border-radius: 12px 12px 12px 3px; }
html body.crm-workspace-theme .chat-message.is-mine > div { border-radius: 12px 12px 3px 12px; }
html body.crm-workspace-theme .chat-compose {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 10px 14px;
    align-items: center;
}
html body.crm-workspace-theme .chat-compose textarea { min-height: 40px; max-height: 100px; padding: 9px 11px; }
html body.crm-workspace-theme .chat-file-button { width: 40px; min-width: 40px; padding: 0; justify-content: center; }
html body.crm-workspace-theme .chat-file-button > span:last-child { display: none; }
html body.crm-workspace-theme .chat-compose .uk-button { min-height: 40px; padding: 0 14px; }
html body.crm-workspace-theme .chat-compose .chat-compose-hint { display: none; }

@media (max-width: 720px) {
    html body.crm-workspace-theme .chat-list-toolbar { min-height: 56px; }
    html body.crm-workspace-theme .chat-conversation-list { max-height: 260px; }
    html body.crm-workspace-theme .chat-thread { background-image: none; }
    html body.crm-workspace-theme .chat-compose .uk-button span:last-child { display: none; }
    html body.crm-workspace-theme .chat-compose .uk-button { width: 40px; padding: 0; }
}

/* Three quiet columns mirror the workbench composition used by the product,
   rather than turning the dialog into a full CRM page. */
html body.crm-workspace-theme .chat-shell {
    min-height: 0;
    height: min(760px, calc(100dvh - 40px));
    grid-template-columns: 250px minmax(0, 1fr) 220px;
    border-radius: 12px;
}
html body.crm-workspace-theme .chat-sidebar { background: var(--workspace-surface); }
html body.crm-workspace-theme .chat-list-toolbar { min-height: 56px; padding: 0 14px; }
html body.crm-workspace-theme .chat-list-toolbar strong { font-size: 14px; }
html body.crm-workspace-theme .chat-list-toolbar small { display: none; }
html body.crm-workspace-theme .chat-new-dialog-toggle { width: 30px; height: 30px; }
html body.crm-workspace-theme .chat-conversation-search { margin: 8px 10px; }
html body.crm-workspace-theme .chat-conversation-search input { height: 34px; font-size: 11px; background: var(--workspace-soft); }
html body.crm-workspace-theme .chat-conversation-list { max-height: none; }
html body.crm-workspace-theme .chat-conversation { min-height: 56px; padding: 9px 12px; }
html body.crm-workspace-theme .chat-conversation:hover,
html body.crm-workspace-theme .chat-conversation.is-active { background: var(--workspace-soft); }
html body.crm-workspace-theme .chat-conversation.is-active { box-shadow: inset 2px 0 var(--workspace-accent); }
html body.crm-workspace-theme .chat-avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 50%; font-size: 11px; }
html body.crm-workspace-theme .chat-avatar.large { width: 34px; height: 34px; flex-basis: 34px; border-radius: 50%; }
html body.crm-workspace-theme .chat-conversation-copy strong { font-size: 12px; }
html body.crm-workspace-theme .chat-conversation-copy small { font-size: 10px; }
html body.crm-workspace-theme .chat-header { min-height: 56px; padding: 9px 16px; }
html body.crm-workspace-theme .chat-header strong { font-size: 13px; }
html body.crm-workspace-theme .chat-header small { font-size: 10px; }
html body.crm-workspace-theme .chat-thread {
    padding: 24px 28px;
    background: var(--workspace-surface);
    background-image: none;
}
html body.crm-workspace-theme .chat-message > div {
    max-width: min(560px, 82%);
    border-radius: 10px;
    background: var(--workspace-soft);
}
html body.crm-workspace-theme .chat-message.is-mine > div { border-radius: 10px; }
html body.crm-workspace-theme .chat-message strong { color: var(--workspace-muted); }
html body.crm-workspace-theme .chat-message.is-mine strong { color: rgba(255,255,255,.76); }
html body.crm-workspace-theme .chat-compose {
    margin: 0 18px 16px;
    padding: 8px 10px;
    border: 1px solid var(--workspace-line);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(41,41,45,.06);
}
html body.crm-workspace-theme .chat-compose textarea { border: 0; background: transparent; }
html body.crm-workspace-theme .chat-compose textarea:focus { outline: 0; }
html body.crm-workspace-theme .chat-file-button { border: 0; background: transparent; }
html body.crm-workspace-theme .chat-context {
    min-width: 0;
    border-left: 1px solid var(--workspace-line);
    display: flex;
    flex-direction: column;
    background: var(--workspace-surface);
}
html body.crm-workspace-theme .chat-context > header {
    min-height: 56px;
    padding: 0 14px;
    border-bottom: 1px solid var(--workspace-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
html body.crm-workspace-theme .chat-context > header strong { font-size: 12px; font-weight: 650; }
html body.crm-workspace-theme .chat-context > header small {
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--workspace-muted);
    background: var(--workspace-soft);
    font-size: 10px;
}
html body.crm-workspace-theme .chat-people-list { overflow-y: auto; padding: 6px; }
html body.crm-workspace-theme .chat-people-list form { margin: 0; }
html body.crm-workspace-theme .chat-person {
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--workspace-text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}
html body.crm-workspace-theme .chat-person:hover { background: var(--workspace-soft); }
html body.crm-workspace-theme .chat-person > span:last-child { min-width: 0; display: grid; gap: 2px; }
html body.crm-workspace-theme .chat-person b,
html body.crm-workspace-theme .chat-person small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
html body.crm-workspace-theme .chat-person b { font-size: 11px; font-weight: 600; }
html body.crm-workspace-theme .chat-person small { color: var(--workspace-muted); font-size: 10px; }
html body.crm-workspace-theme .chat-people-empty { margin: 16px 10px; color: var(--workspace-muted); font-size: 11px; }
html body.chat-embed-page .chat-shell { height: 100dvh; }
html[data-theme="dark"] body.crm-workspace-theme .chat-thread { background: #202020; }
html[data-theme="dark"] body.crm-workspace-theme .chat-compose { box-shadow: none; }

@media (max-width: 960px) {
    html body.crm-workspace-theme .chat-shell { grid-template-columns: 240px minmax(0, 1fr); }
    html body.crm-workspace-theme .chat-context { display: none; }
}
@media (max-width: 720px) {
    html body.crm-workspace-theme .chat-shell { height: 100dvh; grid-template-columns: 1fr; }
    html body.crm-workspace-theme .chat-compose { margin: 0 10px 10px; }
}

/* Personal VK WorkSpace mailbox setup. */
html body.mailbox-page .mailbox-page-header { margin-bottom: 26px; }
.mailbox-directory-page .mailbox-page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin: 0 0 28px; }
html body.mailbox-directory-page .mailbox-title-line h1 { margin: 0; color: var(--workspace-text); font-size: 28px; font-weight: 650; line-height: 1.3; letter-spacing: -.7px; }
.mailbox-directory-page .mailbox-page-header p { margin: 8px 0 0; color: var(--workspace-muted); font-size: 13px; }
.mailbox-workspace { max-width: none; display: grid; gap: 18px; }
.mailbox-title-line { display: flex; align-items: center; gap: 10px; }
.mailbox-connection-card,
.mailbox-setup-card,
.mailbox-security-note,
.mailbox-empty-state {
    border: 1px solid var(--workspace-line);
    background: var(--workspace-surface);
}
.mailbox-connection-card {
    min-height: 108px;
    padding: 20px 22px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.mailbox-provider-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--workspace-accent);
    background: var(--workspace-tint);
}
.mailbox-kicker { color: var(--workspace-muted); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.mailbox-connection-card h2 { margin: 4px 0 4px; color: var(--workspace-text); font-size: 18px; font-weight: 650; }
.mailbox-connection-card p { margin: 0; color: var(--workspace-muted); font-size: 13px; }
.mailbox-status { margin-left: auto; padding: 5px 9px; border-radius: 6px; color: var(--workspace-accent); background: var(--workspace-tint); font-size: 12px; font-weight: 600; white-space: nowrap; }
.mailbox-status-pending { color: var(--workspace-muted); background: var(--workspace-soft); }
.mailbox-setup-card { padding: 24px 22px; border-radius: 12px; display: flex; align-items: center; gap: 20px; }
.mailbox-setup-card > div { flex: 1; }
.mailbox-step { color: var(--workspace-accent); font-size: 11px; font-weight: 650; letter-spacing: .08em; }
.mailbox-setup-card h2 { margin: 7px 0; color: var(--workspace-text); font-size: 18px; }
.mailbox-setup-card p { max-width: 560px; margin: 0; color: var(--workspace-muted); font-size: 13px; line-height: 1.5; }
.mailbox-setup-card small { max-width: 210px; color: var(--workspace-muted); font-size: 11px; line-height: 1.4; }
.mailbox-connect-fields { min-width: 260px; display: grid; gap: 8px; }
.mailbox-connect-fields label { display: grid; gap: 4px; color: var(--workspace-muted); font-size: 11px; }
.mailbox-connect-fields .uk-input { height: 38px; border-color: var(--workspace-line); border-radius: 7px; color: var(--workspace-text); background: var(--workspace-soft); font-size: 12px; }
.mailbox-connect-fields .uk-button { min-height: 38px; border-radius: 7px; }
.mailbox-setup-card .uk-button[disabled] { opacity: .55; cursor: not-allowed; }
.mailbox-security-note { padding: 13px 15px; border-radius: 10px; display: flex; align-items: flex-start; gap: 10px; color: var(--workspace-muted); font-size: 12px; line-height: 1.45; }
.mailbox-security-note .uk-icon { flex: 0 0 auto; color: var(--workspace-accent); }
.mailbox-security-note strong { color: var(--workspace-text); }
.mailbox-empty-state { min-height: 300px; padding: 40px; border-radius: 12px; display: grid; place-content: center; text-align: center; color: var(--workspace-muted); }
.mailbox-empty-state .uk-icon { margin: 0 auto 12px; color: var(--workspace-accent); }
.mailbox-empty-state h2 { margin: 0 0 6px; color: var(--workspace-text); font-size: 17px; }
.mailbox-empty-state p { max-width: 390px; margin: 0; font-size: 13px; }
.personal-settings-link { min-height: 48px; padding: 7px 8px; border-radius: 9px; display: flex; align-items: center; gap: 9px; color: var(--workspace-text); text-decoration: none; }
.personal-settings-link:hover, .personal-settings-link:focus-visible, .personal-settings-link.is-active { color: var(--workspace-text); background: var(--workspace-soft); }
.personal-settings-link > span:nth-child(2) { min-width: 0; display: grid; gap: 1px; flex: 1; }
.personal-settings-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
.personal-settings-link small { color: var(--workspace-muted); font-size: 10px; }
.personal-settings-link > .uk-icon { color: var(--workspace-muted); }
.personal-settings-avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--workspace-accent); background: var(--workspace-tint); font-size: 13px; font-weight: 700; }
.personal-settings-avatar.is-large { width: 54px; height: 54px; flex-basis: 54px; font-size: 21px; }
@media screen and (min-width: 1200px) { .crm-topnav-tools > .personal-settings-link { margin-bottom: 7px; padding-bottom: 18px; border-bottom: 1px solid var(--workspace-line); border-radius: 0; } }
.personal-settings-layout { max-width: 960px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 16px; }
.personal-settings-card { padding: 24px; border: 1px solid var(--workspace-line); border-radius: 14px; background: var(--workspace-surface); }
.personal-settings-card h2 { margin: 0; color: var(--workspace-text); font-size: 19px; }
.personal-settings-card p { color: var(--workspace-muted); }
.personal-settings-card-head { display: flex; align-items: center; gap: 13px; padding-bottom: 20px; border-bottom: 1px solid var(--workspace-line); }
.personal-settings-card-head p { margin: 4px 0 0; font-size: 13px; }
.personal-settings-form { display: grid; gap: 14px; margin-top: 20px; }
.personal-settings-form label { display: grid; gap: 6px; color: var(--workspace-muted); font-size: 12px; font-weight: 600; }
.personal-settings-form :is(.uk-input, .uk-textarea) { border-color: var(--workspace-line); color: var(--workspace-text); background: var(--workspace-soft); }
.personal-settings-form small { color: var(--workspace-muted); font-size: 11px; font-weight: 400; }
.personal-settings-form .uk-button { justify-self: start; }
.personal-settings-info dl { display: grid; gap: 14px; margin: 20px 0; }
.personal-settings-info dl div { display: grid; gap: 3px; }
.personal-settings-info dt { color: var(--workspace-muted); font-size: 11px; }
.personal-settings-info dd { margin: 0; color: var(--workspace-text); font-size: 14px; font-weight: 600; }
.personal-settings-info dd a { color: var(--workspace-accent); }
.personal-settings-info > p { padding-top: 15px; border-top: 1px solid var(--workspace-line); font-size: 12px; line-height: 1.45; }
.bank-statement-directory-page .bank-statement-directory-heading { margin-bottom: 24px; }
.bank-statement-directory-page .bank-statement-metrics { margin-bottom: 18px; }
.bank-statement-directory-page .bank-statement-directory-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; padding: 0; border: 0; background: transparent; }
.bank-statement-directory-page .bank-statement-directory-filters .driver-search-field { position: relative; display: block; flex: 1 1 320px; min-width: 240px; }
.bank-statement-directory-page .bank-statement-directory-filters .driver-search-field > .uk-icon { position: absolute; z-index: 1; top: 50%; left: 14px; transform: translateY(-50%); color: var(--workspace-muted); pointer-events: none; }
.bank-statement-directory-page .bank-statement-directory-filters .search { width: 100%; max-width: none; min-height: 42px; padding-left: 43px; border-color: var(--workspace-line); border-radius: 8px; background: var(--workspace-surface); color: var(--workspace-text); }
.bank-statement-directory-page .bank-statement-directory-filters .uk-select { width: 190px; min-height: 42px; border-color: var(--workspace-line); border-radius: 8px; background: var(--workspace-surface); color: var(--workspace-text); }
.bank-statement-directory-page .bank-statement-directory-filters .uk-button { min-height: 42px; padding-inline: 16px; border-radius: 8px; }
.bank-statement-directory-page .bank-statement-directory-register { min-height: min(620px, calc(100dvh - 410px)); padding: 0; overflow: hidden; border: 1px solid var(--workspace-line); border-radius: 0; box-shadow: none; background: var(--workspace-surface); }
.bank-statement-directory-page .bank-statement-directory-register .onec-register-header { padding: 18px 20px; border-radius: 0; background: var(--workspace-surface); }
.bank-statement-directory-page .bank-statement-directory-register .table-wrap { max-height: min(670px, calc(100dvh - 465px)); overflow: auto; border-top: 1px solid var(--workspace-line); border-radius: 0; }
.bank-statement-directory-page .bank-statement-imports-register { min-height: 0; margin-bottom: 18px; }
.bank-statement-directory-page .bank-statement-imports-register .onec-register-header { padding: 16px 20px; }
.bank-statement-directory-page .bank-statement-imports-register .onec-register-header h2 { font-size: 17px; }
.bank-statement-directory-page .bank-statement-imports-register .table-wrap { max-height: none; }
.bank-statement-directory-page .bank-statement-imports-register .uk-table td { padding-top: 9px; padding-bottom: 9px; }
.bank-statement-directory-page .bank-statement-directory-table { width: 100%; min-width: 860px; margin: 0; border-radius: 0; font-size: 13px; }
.bank-statement-directory-page .bank-statement-directory-table thead { position: sticky; top: 0; z-index: 3; }
.bank-statement-directory-page .bank-statement-directory-table th { height: 44px; padding: 0 14px; border-radius: 0; background: var(--workspace-soft); color: var(--workspace-muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.bank-statement-directory-page .bank-statement-directory-table td { padding: 10px 14px; vertical-align: middle; border-color: var(--workspace-line); }
.bank-statement-directory-page .bank-statement-directory-table td small { margin-top: 2px; font-size: 11px; line-height: 1.3; }
.bank-statement-directory-page .bank-statement-operation { white-space: nowrap; }
.bank-statement-directory-page .bank-statement-operation-direction { display: block; color: var(--workspace-text); font-size: 11px; font-weight: 700; letter-spacing: .035em; }
.bank-statement-directory-page .bank-statement-posting-status { display: block; color: var(--workspace-muted); font-size: 11px; }
.bank-statement-directory-page .bank-statement-posting-status.is-posted { color: #31c48d !important; }
.bank-statement-directory-page .bank-statement-posting-status.is-voided { color: #c13b3b; }
.bank-statement-directory-page .bank-statement-directory-table .uk-label { padding: 3px 7px; border-radius: 5px; font-size: 10px; }
.bank-statement-directory-page .bank-statement-directory-table .row-action { display: inline-flex; margin: 0 2px 0 0; padding: 3px 5px; border: 1px solid var(--workspace-line); border-radius: 5px; font-size: 11px; white-space: nowrap; text-decoration: none; }
.bank-statement-directory-page .bank-statement-directory-table .bank-statement-actions-column { width: 210px; }
.bank-statement-directory-page .bank-statement-register-table { width: 100% !important; min-width: 1455px !important; table-layout: fixed !important; }
.bank-statement-directory-page .bank-statement-register-table th,
.bank-statement-directory-page .bank-statement-register-table td { min-width: 0 !important; white-space: normal; }
.bank-statement-directory-page .bank-statement-register-table td { overflow-wrap: anywhere; }
.bank-statement-directory-page .bank-statement-register-table .bank-statement-purpose {
    display: table-cell;
    overflow: visible;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
/* Банковские документы используют единый компактный шаблон реестров. */
body.orders-workspace-page.bank-statement-directory-page .bank-statement-directory-register {
    min-height: 0;
    height: auto;
    margin: 0;
    border-color: var(--orders-border);
    background: var(--orders-surface);
}
body.orders-workspace-page.bank-statement-directory-page .bank-statement-directory-register .table-wrap {
    height: auto !important;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    border-top: 0;
}
/* Банковский реестр повторяет рабочие настройки таблиц «Контрагенты» и
   «Водители»: таблица растёт по строкам, заголовок закреплён на странице. */
@media screen and (min-width: 961px) and (min-height: 650px) {
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .main > .content {
        height: auto;
        min-height: calc(100dvh - 150px);
        display: block;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-register {
        display: block;
        margin-bottom: 0;
        overflow: visible !important;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-register .table-wrap {
        overflow: visible;
        max-height: none;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table thead {
        position: sticky;
        top: 0;
        z-index: 3;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table thead th {
        position: static;
        background: var(--workspace-soft, #f5f5f5);
    }
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table {
    height: auto;
    border-collapse: collapse;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table :is(th, td) {
    box-sizing: border-box;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table th {
    height: auto;
    padding: 11px 10px;
    font-size: 12px;
    line-height: 1.2;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table td {
    height: auto !important;
    padding: 7px 10px !important;
    vertical-align: top;
    line-height: 1.2;
    border-color: var(--orders-border);
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table td small {
    margin-top: 1px;
    font-size: 11px;
    line-height: 1.2;
}
/* Финальная геометрия реестра банковских выписок. Это тот же режим, что у
   водителей: таблица является частью страницы, а не самостоятельным скролл
   контейнером. Важно не задавать overflow-x отдельно: тогда браузер превращает
   overflow-y в auto и снова появляется прокрутка внутри рамки. */
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page :is(.bank-statement-directory-register, .bank-statement-directory-register .table-wrap, .bank-statement-directory-table) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 0 !important;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page :is(.bank-statement-directory-register, .bank-statement-directory-register .table-wrap) {
    overflow: visible !important;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table thead {
    position: sticky !important;
    top: 0;
    z-index: 20;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table thead th {
    position: static;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table tr.bank-statement-duplicate-row > td {
    background: #fff0f0 !important;
    border-bottom-color: #f1b9b9 !important;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table tr.bank-statement-duplicate-row > td:first-child {
    box-shadow: inset 3px 0 0 #d10000;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-duplicate-note {
    color: #b00000 !important;
    font-weight: 650;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-counterparty-missing {
    color: #a66500 !important;
    font-weight: 650;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-duplicates-action {
    border-color: #d10000 !important;
    color: #b00000 !important;
    background: #fff0f0 !important;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-duplicates-action {
    border-color: #a64852 !important;
    color: #ffafb6 !important;
    background: #3a2529 !important;
}
/* В рабочем реестре рейсов показываем короткий статус комплекта документов.
   Дата входящего и сроки оплаты остаются в карточке, чтобы не перегружать
   таблицу. */
html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-table :is(th, td):nth-child(6) {
    display: table-cell !important;
    visibility: visible !important;
    width: 172px !important;
    min-width: 172px !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--orders-border) !important;
}
html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-documents {
    display: grid !important;
    gap: 5px;
}
html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-documents > div {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 5px;
    align-items: baseline;
}
html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-documents span {
    color: var(--workspace-muted);
    font-size: 11px;
    font-size: 0;
}
html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-documents > div:first-child span::after {
    content: "Вх.";
    font-size: 11px;
}
html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-documents > div:nth-child(2) span::after {
    content: "Исх.";
    font-size: 11px;
}
html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-documents .is-present strong { color: #17835c; }
html body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-documents .is-missing strong { color: #b00000; }
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-documents .is-present strong { color: #55d7a0; }
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme.transportations-workspace-page .transportation-register-documents .is-missing strong { color: #ff9da9; }
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-register + .bank-statement-register {
    margin-top: 22px;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-register-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 14px;
    border-bottom: 1px solid var(--orders-border);
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-register-section-heading h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-register-section-heading span {
    color: var(--orders-muted);
    font-size: 12px;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs {
    display: inline-flex;
    gap: 4px;
    margin: 0 0 12px;
    padding: 4px;
    border: 1px solid var(--orders-border);
    border-radius: 8px;
    background: var(--orders-surface);
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 5px;
    color: var(--orders-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs a:hover { color: var(--orders-ink); }
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs a.is-active {
    color: var(--orders-ink);
    background: var(--orders-soft);
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs span {
    color: inherit;
    font-size: 12px;
    opacity: .75;
}
/* Банковские операции — тот же строгий рабочий реестр, что водители и
   контрагенты: без тяжёлых цветных карточек и со сдержанной иерархией. */
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-register {
    border: 1px solid var(--orders-border) !important;
    border-radius: 0 !important;
    background: var(--orders-surface) !important;
    box-shadow: none !important;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-register-section-heading {
    min-height: 68px;
    margin: 0;
    padding: 11px 16px;
    background: transparent;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-register-section-heading .eyebrow {
    display: block;
    margin: 0 0 3px;
    font-size: 10px;
    letter-spacing: .12em;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-register-section-heading h2 {
    color: var(--orders-ink);
    font-size: 18px;
    font-weight: 650;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-register-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid var(--orders-border);
    border-radius: 0;
    color: var(--orders-muted);
    font-size: 12px;
    font-weight: 650;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
    overflow-x: auto;
    border: 0;
    border-bottom: 1px solid var(--workspace-line);
    border-radius: 0;
    background: transparent;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs a {
    min-height: 0;
    padding: 0 16px 12px;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    color: var(--workspace-muted);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .02em;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs a:first-child {
    padding-left: 0;
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs a.is-active {
    border-bottom-color: var(--workspace-accent);
    background: transparent !important;
    box-shadow: none;
    color: var(--workspace-text);
}
html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs-spacer {
    display: block;
    height: 28px;
}
html[data-theme="dark"] body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-table tr.bank-statement-duplicate-row > td {
    background: #3a2529 !important;
    border-bottom-color: #76434a !important;
}
body.orders-workspace-page.bank-statement-directory-page .bank-statement-directory-table th {
    white-space: nowrap;
}
body.orders-workspace-page.bank-statement-directory-page .bank-statement-directory-table .server-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}
body.orders-workspace-page.bank-statement-directory-page .bank-statement-directory-table .server-sort-link:hover,
body.orders-workspace-page.bank-statement-directory-page .bank-statement-directory-table .server-sort-link.is-active {
    color: var(--orders-accent);
}
body.orders-workspace-page.bank-statement-directory-page .bank-statement-directory-table .server-sort-link span {
    font-size: 12px;
}
.bank-statement-import-operations-table { table-layout: fixed; }
.bank-statement-import-operations-table .bank-operation-date-column { width: 140px; min-width: 140px; white-space: nowrap; }
.bank-statement-import-operations-table td.bank-operation-date-column a,
.bank-statement-import-operations-table td.bank-operation-date-column small { white-space: nowrap; }
@media (max-width: 900px) { .bank-statement-directory-page .bank-statement-directory-filters .driver-search-field { flex-basis: 100%; } .bank-statement-directory-page .bank-statement-directory-filters .uk-select { flex: 1 1 180px; } }
/* На телефоне широкая финансовая таблица остаётся внутри собственного
   контейнера: листать можно пальцем по горизонтали, но она не расширяет
   страницу и не ломает остальную навигацию. */
@media (max-width: 720px) {
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .orders-page-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .orders-page-actions .uk-button {
        width: 100%;
        min-width: 0;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-filters .driver-search-field,
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-filters > .uk-select:first-of-type {
        grid-column: 1 / -1;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-filters :is(.driver-search-field, .uk-select, .uk-button) {
        width: 100%;
        min-width: 0;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-allocation-tabs-spacer {
        height: 16px;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-directory-register .table-wrap {
        width: 100%;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .bank-statement-register-table {
        min-width: 1455px !important;
    }
}
@media (max-width: 720px) { .personal-settings-layout { grid-template-columns: 1fr; } }

/* Шапка банковских выписок на рабочих экранах не наследует мобильную
   вертикальную раскладку: название, счётчик и действия всегда собраны в
   две аккуратные колонки. */
@media screen and (min-width: 721px) {
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .orders-page-header {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 24px !important;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .orders-title-line {
        display: inline-flex !important;
        flex-flow: row nowrap !important;
        align-items: center !important;
        gap: 12px !important;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page #orders-title {
        margin: 0 !important;
        font-size: 28px !important;
        line-height: 1.3 !important;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .orders-count {
        display: inline-flex !important;
        flex: 0 0 auto;
        align-items: center;
        min-height: 26px;
        padding: 2px 10px;
        border-radius: 7px;
        background: var(--orders-soft) !important;
        color: var(--orders-muted) !important;
        font-size: 13px;
        line-height: 1;
    }
    html body.uikit-theme.crm-workspace-theme.bank-statement-directory-page .orders-page-actions {
        display: flex !important;
        flex: 0 0 auto;
        flex-flow: row nowrap !important;
        align-items: center !important;
        justify-content: flex-end;
        gap: 10px;
        margin-left: auto !important;
        white-space: nowrap;
    }
}
.mailbox-inbox { border: 1px solid var(--workspace-line); border-radius: 12px; padding: 22px; background: var(--workspace-surface); }
.mailbox-inbox-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--workspace-line); }
.mailbox-inbox-actions { display: flex; align-items: center; gap: 8px; }
.mailbox-inbox-heading h2 { margin: 4px 0 0; color: var(--workspace-text); font-size: 18px; }
.mailbox-folder-tabs { flex: 0 0 auto; display: flex; gap: 0; margin: 0; padding: 0; overflow-x: auto; border-bottom: 1px solid var(--workspace-line); }
.mailbox-folder-tabs a { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 0 16px 12px; border-bottom: 1px solid transparent; border-radius: 0; color: var(--workspace-muted); font-size: 13px; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.mailbox-folder-tabs a:first-child { padding-left: 0; }
.mailbox-folder-tabs a:hover { color: var(--workspace-text); }
.mailbox-folder-tabs a.is-active { border-bottom-color: var(--workspace-accent); color: var(--workspace-text); font-weight: 400; }
.mailbox-folder-count, .mailbox-folder-unread { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 4px; border-radius: 5px; font-size: 11px; line-height: 1; font-variant-numeric: tabular-nums; }
.mailbox-folder-count { color: var(--workspace-muted); background: var(--workspace-soft); }
.mailbox-folder-unread { color: #fff; background: var(--workspace-accent); }
.mailbox-nav-dot { width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; display: inline-block; background: var(--workspace-accent); }
.mobile-nav-subitem .mailbox-nav-count, .mobile-nav-subitem .mailbox-nav-unread { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; margin-left: auto; padding: 0 5px; border-radius: 9px; font-size: 10px; font-variant-numeric: tabular-nums; }
.mobile-nav-subitem .mailbox-nav-count { color: var(--workspace-muted); background: var(--workspace-soft); }
.mobile-nav-subitem .mailbox-nav-unread { margin-left: 4px; color: #fff; background: var(--workspace-accent); }
.mailbox-directory-page .mailbox-register-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
.mailbox-directory-page .mailbox-register-filters .driver-search-field { position: relative; display: block; flex: 1 1 440px; min-width: 260px; }
.mailbox-directory-page .mailbox-register-filters .driver-search-field > .uk-icon { position: absolute; z-index: 1; top: 50%; left: 14px; transform: translateY(-50%); color: var(--workspace-muted); pointer-events: none; }
.mailbox-directory-page .mailbox-register-filters .search { width: 100%; max-width: none; min-height: 42px; padding-left: 43px; border-color: var(--workspace-line); border-radius: 8px; background: var(--workspace-surface); color: var(--workspace-text); }
.mailbox-directory-page .mailbox-register-filters .uk-button { min-height: 42px; padding-inline: 16px; border-radius: 8px; }
.mailbox-filter-spacer { flex: 1 1 0; }
.mailbox-directory-page .mailbox-workspace:has(.mailbox-register) { min-height: 0; grid-template-rows: none; }
.mailbox-directory-page .mailbox-register { width: 100%; max-width: none; padding: 0; overflow: visible; display: block; border: 1px solid var(--workspace-line); border-radius: 0; background: var(--workspace-surface); box-shadow: none; }
.mailbox-directory-page .mailbox-register .mailbox-message-list { position: static; min-height: 0; max-height: none; overflow: visible; border-top: 0; }
.mailbox-register-table { width: 100%; min-width: 1120px; margin: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.mailbox-register-table thead { position: sticky; top: 0; z-index: 3; }
.mailbox-register-table th { position: static; box-sizing: border-box; height: auto; padding: 9px 10px; border-bottom: 1px solid var(--workspace-line); background: var(--workspace-soft); color: var(--workspace-muted); font-size: 12px; font-weight: 650; line-height: 1.2; }
.mailbox-register-table td { height: 42px; padding: 4px 10px !important; vertical-align: middle; border-color: var(--workspace-line); border-bottom: 1px solid var(--workspace-line); font-size: 13px; line-height: 1.2; }
.mailbox-register-table tr.is-unread td { background: var(--workspace-tint); font-weight: 650; }
.mailbox-register-table tr:not(.is-unread) td { font-weight: 400; }
.mailbox-message-row { cursor: pointer; }
.mailbox-message-row:hover td { background: var(--workspace-soft); }
.mailbox-register-table td:nth-child(2), .mailbox-register-table td:nth-child(3) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mailbox-sender, .mailbox-sender-address { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mailbox-sender { color: var(--workspace-text); font-size: 13px; font-weight: inherit; line-height: 1.25; }
.mailbox-sender-address { margin-left: 4px; color: var(--workspace-muted); font-size: 11px; font-weight: 400; line-height: 1.25; }
.mailbox-sender-address::before { content: "· "; }
.mailbox-message-subject { display: block; overflow: hidden; color: var(--workspace-text) !important; font-size: 13px; font-weight: inherit; line-height: 1.25; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.mailbox-message-preview { display: -webkit-box; margin-top: 2px; overflow: hidden; color: var(--workspace-muted); font-size: 12px; font-weight: 400; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.mailbox-register .mailbox-inbox-empty { margin: 0; padding: 26px 30px; color: var(--workspace-muted); font-size: 14px; }
.mailbox-unread-dot { width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; display: inline-block; vertical-align: middle; background: var(--workspace-accent); }
.mailbox-register-table :is(th, td):nth-child(2) { width: 30%; }.mailbox-register-table :is(th, td):last-child { width: 150px; white-space: nowrap; }
.mailbox-select-column { width: 56px; min-width: 56px; padding-left: 0 !important; padding-right: 0 !important; text-align: center; vertical-align: middle !important; }
.mailbox-select-column input { display: block; margin-right: auto; margin-left: auto; }
.mailbox-register-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 0 16px; background: var(--workspace-surface); }
.mailbox-shown-rows { color: var(--workspace-muted); font-size: 12px; }
.mailbox-delete-button, .mailbox-mark-read-button { min-height: 42px !important; border-color: var(--workspace-line) !important; color: var(--workspace-muted) !important; }
.mailbox-delete-button:disabled, .mailbox-mark-read-button:disabled { opacity: .45; cursor: not-allowed; }
.mailbox-page-size { display: flex; align-items: center; }
.mailbox-page-size label { display: inline-flex; align-items: center; gap: 10px; color: var(--workspace-muted); font-size: 12px; }
.mailbox-page-size .uk-select { width: 250px; height: 40px; border-color: var(--workspace-line); border-radius: 8px; color: var(--workspace-text); background-color: var(--workspace-surface); }
.mailbox-compose-modal { width: min(720px, calc(100vw - 32px)); border-radius: 14px; background: var(--workspace-surface); color: var(--workspace-text); }
.mailbox-compose-modal .uk-modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--workspace-line); background: transparent; }
.mailbox-compose-modal h2 { margin: 4px 0 0; color: var(--workspace-text); font-size: 21px; }
.mailbox-compose-form { display: grid; gap: 14px; padding: 20px 24px 24px; }
.mailbox-compose-form label { display: grid; gap: 6px; color: var(--workspace-muted); font-size: 12px; font-weight: 600; }
.mail-recipient-field > span { display: inline-flex; align-items: center; gap: 7px; }
.mail-dadata-badge { display: inline-flex; align-items: center; min-height: 18px; padding: 0 6px; border: 1px solid var(--workspace-line); border-radius: 5px; color: var(--workspace-muted); background: var(--workspace-soft); font-size: 10px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.crm-mail-recipient-suggest { width: 100%; }
.mailbox-compose-form :is(.uk-input, .uk-textarea) { border-color: var(--workspace-line); background: var(--workspace-soft); color: var(--workspace-text); }
.mailbox-message { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(240px, 2fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--workspace-line); color: var(--workspace-text); font-size: 13px; text-decoration: none; }
.mailbox-message:hover { color: var(--workspace-text); background: var(--workspace-soft); }
.mailbox-message:last-child { border-bottom: 0; }
.mailbox-message span, .mailbox-message small, .mailbox-inbox-empty { color: var(--workspace-muted); }
.mailbox-message-view { width: 100%; max-width: none; box-sizing: border-box; padding: 26px; border: 1px solid var(--workspace-line); border-radius: 14px; background: var(--workspace-surface); }
.mailbox-compose { max-width: 920px; padding: 26px; border: 1px solid var(--workspace-line); border-radius: 14px; background: var(--workspace-surface); }
.crm-organization-dialog { display: flex; flex-direction: column; width: min(1180px, calc(100vw - 40px)); max-width: none; height: calc(100vh - 48px); max-height: calc(100vh - 48px); overflow: hidden; border-radius: 8px; background: var(--workspace-surface); color: var(--workspace-text); }
.crm-organization-dialog .organization-modal-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.crm-organization-dialog .organization-workspace { display: grid; gap: 16px; padding: 0 0 22px; }
.crm-organization-dialog .organization-command-header { padding-right: 0; }
.crm-organization-dialog .organization-command-footer { align-items: center; flex-wrap: nowrap; gap: 12px; }
.crm-organization-dialog .organization-command-inn { flex: 0 1 260px; min-width: 220px; }
.crm-organization-dialog .organization-command-actions { justify-content: flex-start; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0; }
.crm-organization-dialog .organization-command-actions .uk-button { white-space: nowrap; }
.crm-organization-dialog a[href*="/pdf/"] { display: none !important; }
.crm-organization-dialog .organization-modal-command-panel { display: block; position: relative; z-index: 85; flex: 0 0 auto; box-sizing: border-box; width: calc(100% + 72px); margin: 0 -36px 22px; padding: 0 36px 18px; border: 0 !important; border-radius: 0 !important; background: var(--workspace-surface); box-shadow: none !important; }
.crm-organization-dialog .organization-modal-control-divider { height: 1px; margin-top: 18px; background: #e1e8f0; }
.crm-organization-dialog .organization-modal-command-panel .organization-command-footer { margin: 0; }
.crm-organization-dialog .organization-command-panel { display: none; }
.crm-organization-dialog .organization-modal-primary-details { margin: 0; padding: 24px; border: 1px solid #e1e8f0; border-radius: 14px !important; background: var(--workspace-surface); box-shadow: none; }
.crm-organization-dialog .organization-modal-primary-details .form-section-title { min-height: 0; margin: 0 0 20px; padding: 0 0 17px; border-bottom: 1px solid #e1e8f0; background: transparent; }
.crm-organization-dialog .organization-modal-primary-details .form-section-title h2 { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.25; }
.crm-organization-dialog .organization-modal-primary-details .form-section-title p { margin: 4px 0 0; color: #999; font-size: 13px; line-height: 1.35; }
.crm-organization-dialog .organization-modal-verification-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 7px; color: #7b8794; font-size: 12px; line-height: 1.35; }
.crm-organization-dialog .organization-modal-verification-meta strong { font-size: 12px; }
.crm-modal-loading { padding: 40px 10px; color: var(--workspace-muted); text-align: center; }
.mailbox-message-view > header, .mailbox-compose > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--workspace-line); }
.mailbox-message-view h1, .mailbox-compose h1 { margin: 5px 0; color: var(--workspace-text); font-size: 26px; }
.mailbox-message-view header p, .mailbox-compose header p { margin: 0; color: var(--workspace-muted); font-size: 13px; }
.mailbox-message-body { min-height: 180px; padding: 24px 0; color: var(--workspace-text); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.mailbox-attachments { padding-top: 18px; border-top: 1px solid var(--workspace-line); }
.mailbox-attachments h2 { margin: 0 0 10px; color: var(--workspace-text); font-size: 15px; }
.mailbox-attachments > div { display: flex; flex-wrap: wrap; gap: 8px; }
.mailbox-attachments a { display: grid; grid-template-columns: auto 1fr; gap: 2px 7px; min-width: 180px; padding: 9px; border: 1px solid var(--workspace-line); border-radius: 8px; color: var(--workspace-text); font-size: 12px; text-decoration: none; }
.mailbox-attachments a .uk-icon { grid-row: span 2; color: var(--workspace-accent); }
.mailbox-attachments small { color: var(--workspace-muted); }
.mailbox-compose form { display: grid; gap: 15px; margin-top: 22px; }
.mailbox-compose label { display: grid; gap: 6px; color: var(--workspace-muted); font-size: 12px; font-weight: 600; }
.mailbox-compose :is(.uk-input, .uk-textarea) { border-color: var(--workspace-line); color: var(--workspace-text); background: var(--workspace-soft); }
.mailbox-file-input { padding: 12px; border: 1px dashed var(--workspace-line); border-radius: 8px; }
.mailbox-file-input small { color: var(--workspace-muted); font-weight: 400; }
.mailbox-compose-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 720px) {
    .mailbox-connection-card, .mailbox-setup-card { align-items: flex-start; flex-wrap: wrap; }
    .mailbox-status { margin-left: 62px; }
    .mailbox-setup-card .uk-button { width: 100%; }
    .mailbox-connect-fields { width: 100%; }
    .mailbox-message { grid-template-columns: 1fr; gap: 4px; }
    .mailbox-inbox-heading, .mailbox-message-view > header, .mailbox-compose > header { align-items: stretch; flex-direction: column; }
    .mailbox-inbox-actions { flex-wrap: wrap; }
    .mailbox-directory-page .mailbox-register-filters .driver-search-field { flex-basis: 100%; }
    .mailbox-filter-spacer { display: none; }
}

/* Keep the transportation filter toolbar on one row on wide screens. This
   belongs at the end to supersede legacy flex sizes declared above. */
@media screen and (min-width: 1500px) {
    html body.transportations-workspace-page .transportation-register-filters {
        display: grid !important;
        grid-template-columns: minmax(300px, 1.7fr) repeat(3, minmax(160px, .9fr)) repeat(2, minmax(130px, .72fr)) repeat(2, max-content);
        align-items: center;
        flex-wrap: nowrap !important;
    }
    html body.transportations-workspace-page .transportation-register-filters .search,
    html body.transportations-workspace-page .transportation-register-filters select,
    html body.transportations-workspace-page .transportation-register-filters .transportation-date-type,
    html body.transportations-workspace-page .transportation-register-filters .transportation-date-input {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none;
        flex: none !important;
    }
    html body.transportations-workspace-page .transportation-register-filters .transportation-date-apply {
        grid-column: auto;
        width: auto;
    }
}

/* One column map for both the header and body of the driver register. Older
   rules described different column counts, which made the header look narrower
   than the data table on wide screens. */
@media screen and (min-width: 721px) {
    html body.uikit-theme.crm-workspace-theme.driver-directory-page .driver-directory-table {
        width: 100% !important;
        min-width: 1180px;
        table-layout: fixed;
    }
    html body.uikit-theme.crm-workspace-theme.driver-directory-page .driver-directory-table :is(th, td):nth-child(1) { width: 56px !important; }
    html body.uikit-theme.crm-workspace-theme.driver-directory-page .driver-directory-table :is(th, td):nth-child(2) { width: 20% !important; }
    html body.uikit-theme.crm-workspace-theme.driver-directory-page .driver-directory-table :is(th, td):nth-child(3) { width: 25% !important; }
    html body.uikit-theme.crm-workspace-theme.driver-directory-page .driver-directory-table :is(th, td):nth-child(4) { width: 22% !important; }
    html body.uikit-theme.crm-workspace-theme.driver-directory-page .driver-directory-table :is(th, td):nth-child(5) { width: 14% !important; }
    html body.uikit-theme.crm-workspace-theme.driver-directory-page .driver-directory-table :is(th, td):nth-child(6) { width: 15% !important; }
}
