

:root {
    --primary: #1f3a5f;
    --primary-hover: #29466d;
    --primary-soft: #eef3f8;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #dbe3ee;
    --text: #1f2937;
    --text-muted: #64748b;
    --success: #1f9d55;
    --info: #2563eb;
    --warning: #d97706;
    --danger: #dc2626;
    --sidebar-bg: #162338;
    --sidebar-bg-hover: rgba(255, 255, 255, 0.05);
    --sidebar-text: #d9e3f0;
    --sidebar-active: #4f46e5;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius-md: 14px;
    --radius-lg: 18px;
    --field-height: 46px;
}


html,
body {
    background: var(--bg) !important;
    color: var(--text);
}

body.sidebar-mini .main-sidebar,
body.sidebar-mini .left-side,
body .main-sidebar,
body .left-side {
    width: 250px !important;
    min-width: 250px !important;
}

body.sidebar-mini .main-content,
body.sidebar-mini .content-wrapper,
body .main-content,
body .content-wrapper {
    padding-left: 280px !important;
}

@media (max-width: 1024px) {
    body.sidebar-mini .main-content,
    body.sidebar-mini .content-wrapper,
    body .main-content,
    body .content-wrapper {
        padding-left: 30px !important;
    }
}

.wrapper,
.page-wrapper,
.content-wrapper,
.content,
.main-content {
    background: var(--bg) !important;
    background-color: var(--bg) !important;
}

.main-header,
.navbar,
.navbar-bg,
.topbar,
.header,
.headerbar,
.navbar-custom,
.content-header,
.wrapper .main-header,
.wrapper .header,
.wrapper .navbar {
    background: #1b2940 !important;
    background-color: #1b2940 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12) !important;
    opacity: 1 !important;
}

.main-navbar,
.navbar-bg {
    left: 250px !important;
    width: calc(100% - 250px) !important;
}

.navbar-left {
    display: flex !important;
    align-items: center !important;
    min-height: 44px;
}

.crm-sidebar-toggle {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.crm-sidebar-toggle i {
    margin: 0 !important;
    color: inherit !important;
    font-size: 16px !important;
}

.crm-sidebar-toggle:hover,
.crm-sidebar-toggle:focus {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.24) !important;
    color: #ffffff !important;
    outline: none !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar,
body.crm-sidebar-collapsed .main-sidebar,
html.crm-sidebar-collapsed-ready .left-side,
body.crm-sidebar-collapsed .left-side {
    width: 72px !important;
    min-width: 72px !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow: hidden !important;
}

html.crm-sidebar-collapsed-ready .main-navbar,
body.crm-sidebar-collapsed .main-navbar,
html.crm-sidebar-collapsed-ready .navbar-bg,
body.crm-sidebar-collapsed .navbar-bg {
    left: 72px !important;
    width: calc(100% - 72px) !important;
}

html.crm-sidebar-collapsed-ready .main-content,
body.crm-sidebar-collapsed .main-content,
html.crm-sidebar-collapsed-ready .content-wrapper,
body.crm-sidebar-collapsed .content-wrapper {
    padding-left: 96px !important;
}

html.crm-sidebar-collapsed-ready .main-footer,
body.crm-sidebar-collapsed .main-footer {
    padding-left: 96px !important;
}

html.crm-sidebar-collapsed-ready .crm-sidebar-toggle,
body.crm-sidebar-collapsed .crm-sidebar-toggle {
    background: #eef3ff !important;
    border-color: #b8caf0 !important;
    color: #1f3a5f !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-brand,
body.crm-sidebar-collapsed .main-sidebar .sidebar-brand {
    display: none !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-brand-sm,
body.crm-sidebar-collapsed .main-sidebar .sidebar-brand-sm {
    height: 74px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-brand__mark,
body.crm-sidebar-collapsed .main-sidebar .sidebar-brand__mark {
    width: 40px !important;
    max-width: 40px !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-menu,
body.crm-sidebar-collapsed .main-sidebar .sidebar-menu {
    padding: 6px 8px !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar #sidebar-wrapper > .sidebar-menu:first-of-type,
body.crm-sidebar-collapsed .main-sidebar #sidebar-wrapper > .sidebar-menu:first-of-type {
    padding-top: 2px !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar #sidebar-wrapper > .sidebar-menu:first-of-type > li.menu-header:first-child,
body.crm-sidebar-collapsed .main-sidebar #sidebar-wrapper > .sidebar-menu:first-of-type > li.menu-header:first-child {
    margin-top: 4px !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-menu li,
body.crm-sidebar-collapsed .main-sidebar .sidebar-menu li {
    margin: 2px 0 !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-menu li.menu-header,
body.crm-sidebar-collapsed .main-sidebar .sidebar-menu li.menu-header {
    height: 8px !important;
    padding: 0 !important;
    margin: 8px 0 !important;
    overflow: hidden !important;
    color: transparent !important;
    font-size: 0 !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-menu li a,
body.crm-sidebar-collapsed .main-sidebar .sidebar-menu li a {
    width: 56px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 14px !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-menu li a i,
body.crm-sidebar-collapsed .main-sidebar .sidebar-menu li a i {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 18px !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-menu li a span,
body.crm-sidebar-collapsed .main-sidebar .sidebar-menu li a span,
html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-menu li a.has-dropdown::after,
body.crm-sidebar-collapsed .main-sidebar .sidebar-menu li a.has-dropdown::after,
html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-menu li ul.dropdown-menu,
body.crm-sidebar-collapsed .main-sidebar .sidebar-menu li ul.dropdown-menu {
    display: none !important;
}

html.crm-sidebar-collapsed-ready .main-sidebar .sidebar-menu li.crm-sidebar-flyout-open > a,
body.crm-sidebar-collapsed .main-sidebar .sidebar-menu li.crm-sidebar-flyout-open > a {
    background: #eef3ff !important;
    color: #1f3a5f !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12) !important;
}

.crm-sidebar-flyout {
    position: fixed;
    z-index: 1200;
    min-width: 238px;
    max-width: 300px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.crm-sidebar-flyout::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 22px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 1px solid #dbe3ee;
    border-bottom: 1px solid #dbe3ee;
    transform: rotate(45deg);
}

.crm-sidebar-flyout__list {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
    list-style: none;
}

.crm-sidebar-flyout__list li {
    margin: 0;
    padding: 0;
}

.crm-sidebar-flyout__list a {
    min-height: 42px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    border-radius: 9px;
    color: #64748b !important;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none !important;
}

.crm-sidebar-flyout__list a:hover,
.crm-sidebar-flyout__list a:focus,
.crm-sidebar-flyout__list a.active {
    background: #eef3ff;
    color: #1f3a5f !important;
    outline: none;
}

.main-navbar .navbar-nav.navbar-right {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
}

.main-navbar .crm-task-dropdown {
    margin-right: 8px;
}

.main-navbar .crm-task-toggle {
    position: relative;
    display: inline-flex !important;
    min-height: 44px !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 0 11px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

.main-navbar .crm-task-toggle:hover,
.main-navbar .crm-task-toggle:focus,
.main-navbar .crm-task-dropdown.show .crm-task-toggle {
    background: rgba(255, 255, 255, 0.16) !important;
    outline: none !important;
}

.main-navbar .crm-task-toggle > i {
    margin: 0 !important;
    font-size: 16px;
}

.main-navbar .crm-task-toggle__label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.main-navbar .crm-task-toggle__badge {
    display: inline-flex;
    min-width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    background: #334155;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.main-navbar .crm-task-toggle__badge.has-overdue {
    background: #dc2626;
}

.main-navbar .crm-task-menu {
    width: 410px !important;
    max-width: calc(100vw - 24px);
    margin-top: 10px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-md) !important;
}

.crm-task-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 16px 12px;
}

.crm-task-menu__head > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.crm-task-menu__head strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
}

.crm-task-menu__head span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.crm-task-menu__head > a {
    color: var(--primary) !important;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none !important;
}

.crm-task-menu__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 0 16px 12px;
}

.crm-task-menu__stats span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 9px;
    border-radius: 9px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

.crm-task-menu__stats strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
}

.crm-task-menu__stats .is-danger,
.crm-task-menu__stats .is-danger strong {
    color: var(--danger);
}

.crm-task-menu__list {
    max-height: 345px;
    overflow-y: auto;
    border-top: 1px solid var(--border);
}

.crm-task-menu__item {
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px 16px !important;
    border-bottom: 1px solid var(--border);
    color: var(--text) !important;
    text-decoration: none !important;
}

.crm-task-menu__item:hover {
    background: var(--surface-muted);
}

.crm-task-menu__item.is-overdue {
    background: #fff7ed;
}

.crm-task-menu__item-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
}

.crm-task-menu__item-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.crm-task-menu__item-main strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-task-menu__item-main small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-task-menu__deadline {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.crm-task-menu__item.is-overdue .crm-task-menu__deadline {
    color: var(--danger);
}

.crm-task-menu__empty {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 22px;
    color: var(--text-muted);
    text-align: center;
}

.crm-task-menu__empty i {
    margin-bottom: 5px;
    color: var(--success);
    font-size: 25px;
}

.crm-task-menu__empty strong {
    color: var(--text);
    font-size: 13px;
}

.crm-task-menu__empty span {
    font-size: 11px;
}

.crm-task-menu__footer {
    display: flex !important;
    min-height: 45px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px !important;
    background: var(--surface-muted);
    color: var(--primary) !important;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none !important;
}

@media (max-width: 575px) {
    .main-navbar .crm-task-toggle__label {
        display: none;
    }

    .main-navbar .crm-task-menu {
        position: fixed !important;
        top: 58px !important;
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: none;
    }
}

.main-navbar .crm-user-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 0 8px 0 12px !important;
    min-height: 44px !important;
    color: #ffffff !important;
    background: transparent !important;
    border-radius: 999px !important;
    transition: background-color 0.16s ease, color 0.16s ease !important;
}

.main-navbar .crm-user-toggle:hover,
.main-navbar .crm-user-toggle:focus,
.main-navbar .crm-user-dropdown.show .crm-user-toggle {
    background: rgba(255, 255, 255, 0.08) !important;
    outline: none !important;
}

.main-navbar .crm-user-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    object-fit: cover !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.main-navbar .crm-user-name {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
}

.main-navbar .crm-user-unread-badge,
.main-navbar .crm-user-menu__badge {
    min-width: 44px !important;
    height: 28px !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    background: #ff5652 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
}

.main-navbar .crm-user-menu {
    width: 290px !important;
    min-width: 290px !important;
    margin-top: 10px !important;
    padding: 8px !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-md) !important;
    overflow: visible !important;
}

.main-navbar .crm-user-menu::before {
    content: "" !important;
    position: absolute !important;
    top: -7px !important;
    right: 24px !important;
    width: 14px !important;
    height: 14px !important;
    background: var(--surface) !important;
    border-left: 1px solid var(--border) !important;
    border-top: 1px solid var(--border) !important;
    transform: rotate(45deg) !important;
}

.main-navbar .crm-user-menu .dropdown-divider {
    margin: 8px -8px !important;
    border-top: 1px solid #eef2f7 !important;
}

.main-navbar .crm-user-menu__item {
    min-height: 44px !important;
    padding: 8px 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    border-radius: 9px !important;
    color: var(--text) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    transition: background-color 0.16s ease, color 0.16s ease !important;
}

.main-navbar .crm-user-menu__item i {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background: var(--surface-muted) !important;
    color: var(--primary) !important;
    font-size: 14px !important;
}

.main-navbar .crm-user-menu__item:hover,
.main-navbar .crm-user-menu__item:focus {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
    outline: none !important;
}

.main-navbar .crm-user-menu__item:hover i,
.main-navbar .crm-user-menu__item:focus i {
    background: #e4ebf5 !important;
    color: var(--primary) !important;
}

.main-navbar .crm-user-menu__item--danger {
    color: #ef4444 !important;
}

.main-navbar .crm-user-menu__item--danger i {
    background: #fff1f2 !important;
    color: #ef4444 !important;
}

.main-navbar .crm-user-menu__item--danger:hover,
.main-navbar .crm-user-menu__item--danger:focus {
    background: #fff1f2 !important;
    color: #dc2626 !important;
}

.main-navbar .crm-user-menu__item--danger:hover i,
.main-navbar .crm-user-menu__item--danger:focus i {
    background: #ffe4e6 !important;
    color: #dc2626 !important;
}

.main-navbar .nav-link,
.main-navbar .nav-link i,
.main-navbar .dropdown-toggle,
.main-navbar .dropdown-toggle i {
    color: rgba(255, 255, 255, 0.92) !important;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link:hover i,
.main-navbar .dropdown-toggle:hover,
.main-navbar .dropdown-toggle:hover i {
    color: #ffffff !important;
}

@media (max-width: 575px) {
    .main-navbar .crm-user-name {
        display: none !important;
    }

    .main-navbar .crm-user-menu {
        width: calc(100vw - 32px) !important;
        min-width: calc(100vw - 32px) !important;
        right: 8px !important;
    }
}

@media (max-width: 1024px) {
    .main-navbar,
    .navbar-bg {
        left: 0 !important;
        width: 100% !important;
    }

    html.crm-sidebar-collapsed-ready .main-sidebar,
    body.crm-sidebar-collapsed .main-sidebar,
    html.crm-sidebar-collapsed-ready .left-side,
    body.crm-sidebar-collapsed .left-side {
        transform: translateX(-270px) !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    html.crm-sidebar-collapsed-ready .main-content,
    body.crm-sidebar-collapsed .main-content,
    html.crm-sidebar-collapsed-ready .content-wrapper,
    body.crm-sidebar-collapsed .content-wrapper {
        padding-left: 30px !important;
    }
}

.main-header::before,
.main-header::after,
.navbar::before,
.navbar::after,
.navbar-bg::before,
.navbar-bg::after,
.topbar::before,
.topbar::after,
.content-header::before,
.content-header::after,
.header::before,
.header::after {
    display: none !important;
    background: transparent !important;
}

.main-sidebar,
.left-side,
.sidebar,
aside.main-sidebar,
.wrapper .main-sidebar,
.wrapper .left-side,
.sidebar-style-2,
.sidebar-style-2 .sidebar,
.side-menu,
.sidebar-wrapper,
.logo,
.main-header .logo,
.navbar-brand,
.brand-link,
.main-sidebar .sidebar-brand,
.main-sidebar .sidebar-brand-sm {
    background: var(--sidebar-bg) !important;
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

.main-sidebar::before,
.left-side::before,
.sidebar::before,
aside.main-sidebar::before,
.sidebar-wrapper::before,
.main-sidebar::after,
.left-side::after,
.sidebar::after,
aside.main-sidebar::after,
.sidebar-wrapper::after {
    display: none !important;
    background: transparent !important;
}

.main-sidebar .sidebar-menu,
.left-side .sidebar-menu,
.main-sidebar .sidebar-brand,
.main-sidebar .sidebar-brand-sm {
    background: transparent !important;
}

.main-sidebar .sidebar-menu li,
.left-side .sidebar-menu li {
    margin: 2px 10px !important;
}

.main-sidebar .sidebar-menu li a,
.left-side .sidebar-menu li a,
.sidebar a,
.sidebar-wrapper a,
.main-sidebar .sidebar-brand a,
.main-sidebar .sidebar-brand-sm a {
    color: var(--sidebar-text) !important;
    opacity: 1 !important;
}

.main-sidebar .sidebar-menu li a,
.left-side .sidebar-menu li a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 48px !important;
    padding: 0 16px !important;
    border-radius: 12px !important;
}

.main-sidebar .sidebar-menu li a span,
.left-side .sidebar-menu li a span {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.main-sidebar .sidebar-menu li a i,
.left-side .sidebar-menu li a i,
.sidebar i,
.sidebar-wrapper i {
    color: var(--sidebar-text) !important;
    opacity: 1 !important;
    width: 18px !important;
    text-align: center !important;
    margin-right: 0 !important;
}

.main-sidebar .sidebar-menu li a:hover,
.left-side .sidebar-menu li a:hover,
.sidebar a:hover,
.sidebar-wrapper a:hover {
    background: var(--sidebar-bg-hover) !important;
    color: #ffffff !important;
}

.main-sidebar .sidebar-menu li a:hover i,
.left-side .sidebar-menu li a:hover i,
.sidebar a:hover i,
.sidebar-wrapper a:hover i {
    color: #ffffff !important;
}

.main-sidebar .sidebar-menu > li.active > a,
.left-side .sidebar-menu > li.active > a {
    background: linear-gradient(180deg, #6d5dfc 0%, var(--sidebar-active) 100%) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28) !important;
}

.main-sidebar .sidebar-menu > li.active > a i,
.left-side .sidebar-menu > li.active > a i {
    color: #ffffff !important;
}

.main-sidebar .sidebar-menu > li > ul.dropdown-menu,
.main-sidebar .sidebar-menu > li.active > ul.dropdown-menu,
.left-side .sidebar-menu > li > ul.dropdown-menu,
.left-side .sidebar-menu > li.active > ul.dropdown-menu {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    float: none !important;
    transform: none !important;
    margin: 5px 0 10px !important;
    padding: 2px 0 2px 30px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.main-sidebar .sidebar-menu > li.active > ul.dropdown-menu,
.left-side .sidebar-menu > li.active > ul.dropdown-menu {
    display: block !important;
}

.main-sidebar .sidebar-menu > li > ul.dropdown-menu .dropdown-title,
.left-side .sidebar-menu > li > ul.dropdown-menu .dropdown-title {
    display: none !important;
}

.main-sidebar .sidebar-menu > li > ul.dropdown-menu > li,
.left-side .sidebar-menu > li > ul.dropdown-menu > li {
    margin: 1px 0 !important;
}

.main-sidebar .sidebar-menu > li.active > ul.dropdown-menu > li > a,
.left-side .sidebar-menu > li.active > ul.dropdown-menu > li > a,
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu li a,
body:not(.sidebar-mini) .sidebar-style-2 .sidebar-menu li.active ul.dropdown-menu li a {
    min-height: 36px !important;
    height: auto !important;
    padding: 0 12px !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: rgba(217, 227, 240, 0.74) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.main-sidebar .sidebar-menu > li.active > ul.dropdown-menu > li.active > a,
.left-side .sidebar-menu > li.active > ul.dropdown-menu > li.active > a,
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu li.active > a,
body:not(.sidebar-mini) .sidebar-style-2 .sidebar-menu li.active ul.dropdown-menu li.active > a {
    background: rgba(109, 93, 252, 0.2) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.main-sidebar .sidebar-menu > li.active > ul.dropdown-menu > li > a:hover,
.left-side .sidebar-menu > li.active > ul.dropdown-menu > li > a:hover,
body.sidebar-mini .main-sidebar .sidebar-menu > li ul.dropdown-menu li a:hover {
    background: var(--sidebar-bg-hover) !important;
    color: #ffffff !important;
}

.card,
.box,
.panel,
.white-box,
.filters-card,
.content-card,
.form-card,
.order-form-card,
.device-search-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.order-form-card,
.device-search-card,
.filters-card {
    padding: 22px;
}
.table {
    background: var(--surface);
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead th {
    background: #f8fafc !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle;
    letter-spacing: 0.01em;
}

.table td {
    vertical-align: middle;
    border-color: #edf2f7;
    font-size: 14px !important;
    color: var(--text) !important;
}

.table tbody tr:hover {
    background: #f8fbff !important;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--text);
    font-weight: 700;
}

label,
.form-group label,
.control-label {
    font-size: 13px;
    font-weight: 700;
    color: #2f3b52;
    margin-bottom: 6px;
}

.btn {
    border-radius: 12px !important;
    font-weight: 700 !important;
    padding: 12px 18px !important;
    line-height: 1.2 !important;
}

.btn-primary,
.btn.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn.btn-primary:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-success,
.btn.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
}

.btn-outline-secondary,
.btn.btn-outline-secondary,
.btn-secondary,
.btn.btn-secondary {
    background: #fff !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-sm);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="search"],
input[type="tel"],
input[type="password"],
textarea,
select,
.form-control {
    height: var(--field-height) !important;
    min-height: var(--field-height) !important;
    background: var(--surface-muted) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    color: var(--text) !important;
    box-shadow: none !important;
    padding: 11px 14px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    appearance: none;
    -webkit-appearance: none;
}

textarea,
textarea.form-control {
    min-height: 110px !important;
    height: auto !important;
    resize: vertical;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus,
.form-control:focus {
    border-color: var(--primary) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08) !important;
    outline: none !important;
}

input[readonly],
textarea[readonly],
select[readonly],
.form-control[readonly] {
    background: #eef2f7 !important;
    color: #374151 !important;
    opacity: 1 !important;
}

::placeholder {
    color: #9aa4b2 !important;
    opacity: 1;
}

.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single,
.select2-container--default .select2-selection--single,
.select2-selection {
    height: var(--field-height) !important;
    min-height: var(--field-height) !important;
    padding: 0 !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: var(--surface-muted) !important;
    box-shadow: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-selection__rendered {
    display: flex !important;
    align-items: center !important;
    height: calc(var(--field-height) - 2px) !important;
    line-height: 1.2 !important;
    color: var(--text) !important;
    padding-left: 14px !important;
    padding-right: 36px !important;
    font-size: 14px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-selection__arrow {
    height: var(--field-height) !important;
    right: 8px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08) !important;
}

.select2-dropdown {
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.input-group {
    display: flex !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
}

.input-group .form-control,
.input-group input,
.input-group select {
    flex: 1 1 auto !important;
    width: 1% !important;
    margin: 0 !important;
}

.input-group-append {
    display: flex !important;
    align-items: stretch !important;
    margin-left: 8px !important;
    flex: 0 0 auto !important;
}

.input-group-append .input-group-text,
.input-group-addon,
.input-group-append button,
.input-group-append .btn {
    width: 42px !important;
    min-width: 42px !important;
    height: var(--field-height) !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    border: 1px solid var(--border) !important;
    background: #f3f6fa !important;
    color: #4b5563 !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.orders-filter-panel .input-group > .form-control,
.orders-filter-panel .input-group > input.form-control,
.orders-filter-panel .input-group > input {
    border-radius: 12px !important;
}

.orders-filter-panel .input-group > .input-group-append,
.orders-filter-panel .input-group > .input-group-addon,
.orders-filter-panel .input-group > .input-group-text,
.orders-filter-panel .input-group > .btn,
.orders-filter-panel .input-group > button {
    margin-left: 8px !important;
}

.orders-filter-panel .input-group-append .input-group-text,
.orders-filter-panel .input-group-addon,
.orders-filter-panel .input-group-append button,
.orders-filter-panel .input-group-append .btn,
.orders-filter-panel .input-group > .input-group-text,
.orders-filter-panel .input-group > .btn,
.orders-filter-panel .input-group > button {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 10px !important;
}

.orders-filter-panel .input-group-append .input-group-text i,
.orders-filter-panel .input-group-addon i,
.orders-filter-panel .input-group-append button i,
.orders-filter-panel .input-group-append .btn i,
.orders-filter-panel .input-group > .input-group-text i,
.orders-filter-panel .input-group > .btn i,
.orders-filter-panel .input-group > button i {
    font-size: 14px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.form-group {
    margin-bottom: 18px !important;
}

.row.small-form > [class*="col-"] {
    margin-bottom: 6px;
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.status-new { background: #eaf2ff; color: var(--info); }
.status-progress { background: #eefbf3; color: var(--success); }
.status-warning { background: #fff7e6; color: var(--warning); }
.status-danger { background: #feecec; color: var(--danger); }
.status-done { background: #ecfdf3; color: #15803d; }


.overdue-row {
    border-left: 4px solid var(--danger);
    background: #fff8f8 !important;
}


/* ===== Shared list pages and filters ===== */

.list-page-head,
.page-head,
.orders-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 14px !important;
}

.list-page-title,
.page-title,
.orders-page-title {
    margin: 0;
    font-size: 28px !important;
    line-height: 1.1 !important;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1f2937;
}

.list-page-head__actions,
.orders-page-head__right,
.page-head__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.list-page-head__actions .btn,
.orders-page-head__right .btn,
.page-head__actions .btn {
    height: auto !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
}

.orders-queues {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 12px;
}

.orders-queue {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 50px;
    padding: 9px 14px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    color: #475569 !important;
    text-decoration: none !important;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.orders-queue:hover,
.orders-queue.is-active {
    background: #f3f7ff;
    border-color: #b8caf0;
    box-shadow: 0 3px 10px rgba(31, 58, 95, 0.08);
}

.orders-queue__label {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.orders-queue__value {
    flex: 0 0 auto;
    min-width: 27px;
    height: 27px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef3ff;
    color: #1f3a5f;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.orders-queue--consideration .orders-queue__value { background: #e0f2fe; color: #075985; }
.orders-queue--inspection .orders-queue__value { background: #e0f2fe; color: #0369a1; }
.orders-queue--on_coordination .orders-queue__value { background: #fef3c7; color: #b45309; }
.orders-queue--coordinate .orders-queue__value { background: #dcfce7; color: #15803d; }
.orders-queue--need_detail .orders-queue__value { background: #ffedd5; color: #c2410c; }
.orders-queue--in_progress .orders-queue__value { background: #ede9fe; color: #6d28d9; }
.orders-queue--done .orders-queue__value { background: #e0e7ff; color: #3730a3; }
.orders-queue--wait_asc .orders-queue__value { background: #fef3c7; color: #92400e; }
.orders-queue--adopted_from_asc .orders-queue__value { background: #dcfce7; color: #15803d; }
.orders-queue--rejection .orders-queue__value { background: #fee2e2; color: #b91c1c; }
.orders-queue--issued_to_client .orders-queue__value { background: #f1f5f9; color: #475569; }

.list-filter-panel,
.filter-panel,
.orders-filter-panel {
    background: #ffffff !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 14px !important;
    padding: 16px 18px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
    margin-bottom: 14px !important;
}

.list-filter-panel,
.orders-filter-panel {
    padding: 12px 14px !important;
    margin-bottom: 10px !important;
}

.list-filter-grid,
.filter-grid,
.orders-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 14px !important;
    margin-bottom: 10px !important;
}

.list-filter-grid,
.orders-filter-grid {
    gap: 8px 12px !important;
    margin-bottom: 8px !important;
}

.list-filter-grid--extra,
.orders-filter-grid--extra {
    margin-top: 2px;
}

.list-filter-item,
.list-filter-item .form-group,
.filter-item,
.filter-item .form-group,
.orders-filter-item,
.orders-filter-item .form-group {
    margin-bottom: 0 !important;
}

.list-filter-item label,
.list-filter-panel label,
.list-filter-panel .control-label,
.filter-item label,
.filter-panel label,
.filter-panel .control-label,
.orders-filter-item label,
.orders-filter-panel label,
.orders-filter-panel .control-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
    text-transform: none !important;
}

.list-filter-panel input,
.list-filter-panel select,
.list-filter-panel .form-control,
.list-filter-panel .select2-container .select2-selection--single,
.list-filter-panel .select2-container--default .select2-selection--single,
.filter-panel input,
.filter-panel select,
.filter-panel .form-control,
.filter-panel .select2-container .select2-selection--single,
.filter-panel .select2-container--default .select2-selection--single,
.orders-filter-panel input,
.orders-filter-panel select,
.orders-filter-panel .form-control,
.orders-filter-panel .select2-container .select2-selection--single,
.orders-filter-panel .select2-container--default .select2-selection--single {
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    border: 1px solid #d4dbe6 !important;
    font-size: 14px !important;
    color: var(--text) !important;
    line-height: 1.2 !important;
    padding: 0 12px !important;
    box-shadow: none !important;
}

.list-filter-panel select,
.list-filter-panel .form-control,
.list-filter-panel input,
.filter-panel select,
.orders-filter-panel select,
.orders-filter-panel .form-control,
.orders-filter-panel input {
    font-weight: 500 !important;
    height: 36px !important;
    min-height: 36px !important;
}

.list-filter-panel .select2-container .select2-selection--single,
.list-filter-panel .select2-container--default .select2-selection--single,
.filter-panel .select2-container .select2-selection--single,
.filter-panel .select2-container--default .select2-selection--single,
.orders-filter-panel .select2-container .select2-selection--single,
.orders-filter-panel .select2-container--default .select2-selection--single {
    padding: 0 !important;
}

.list-filter-panel select:not(.select2-hidden-accessible),
.filter-panel select:not(.select2-hidden-accessible),
.orders-filter-panel select:not(.select2-hidden-accessible) {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #ffffff !important;
    background-image:
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%) !important;
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50% !important;
    background-repeat: no-repeat !important;
    background-size: 5px 5px, 5px 5px !important;
    line-height: 1.2 !important;
    padding-right: 36px !important;
}

.list-filter-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
.list-filter-panel .select2-selection__rendered,
.filter-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
.filter-panel .select2-selection__rendered,
.orders-filter-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
.orders-filter-panel .select2-selection__rendered {
    display: flex !important;
    align-items: center !important;
    height: 34px !important;
    min-height: 34px !important;
    line-height: 1.2 !important;
    padding-left: 12px !important;
    padding-right: 36px !important;
    color: var(--text) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.list-filter-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
.list-filter-panel .select2-selection__rendered,
.filter-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
.filter-panel .select2-selection__rendered,
.orders-filter-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
.orders-filter-panel .select2-selection__rendered {
    height: 34px !important;
    line-height: 1.2 !important;
}

.list-filter-panel .select2-container.crm-filter-select--empty .select2-selection__rendered,
.filter-panel .select2-container.crm-filter-select--empty .select2-selection__rendered,
.orders-filter-panel .select2-container.crm-filter-select--empty .select2-selection__rendered,
.list-filter-panel .select2-selection__placeholder,
.filter-panel .select2-selection__placeholder,
.orders-filter-panel .select2-selection__placeholder {
    color: #9aa7b8 !important;
    font-weight: 500 !important;
}

.list-filter-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
.list-filter-panel .select2-selection__arrow,
.orders-filter-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
.orders-filter-panel .select2-selection__arrow {
    height: 40px !important;
    right: 8px !important;
}

.list-filter-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
.list-filter-panel .select2-selection__arrow,
.orders-filter-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
.orders-filter-panel .select2-selection__arrow {
    height: 36px !important;
}

.list-filter-panel .select2-container,
.orders-filter-panel .select2-container {
    z-index: 20 !important;
}

.list-filter-panel .gj-datepicker .input-group-append,
.list-filter-panel .gj-datepicker .input-group-append button,
.list-filter-panel .gj-datepicker .input-group-append .btn {
    height: 36px !important;
    min-height: 36px !important;
}

.list-filter-panel .gj-datepicker .input-group-append button,
.list-filter-panel .gj-datepicker .input-group-append .btn {
    width: 40px !important;
    min-width: 40px !important;
    border-radius: 10px !important;
}

.list-filter-panel .gj-datepicker .input-group-append button i,
.list-filter-panel .gj-datepicker .input-group-append .btn i {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

.list-filter-panel input:hover,
.list-filter-panel select:hover,
.list-filter-panel .form-control:hover,
.orders-filter-panel input:hover,
.orders-filter-panel select:hover,
.orders-filter-panel .form-control:hover {
    border-color: #94a3b8 !important;
}

.list-filter-panel input:focus,
.list-filter-panel select:focus,
.list-filter-panel .form-control:focus,
.list-filter-panel .select2-container--default.select2-container--focus .select2-selection--single,
.list-filter-panel .select2-container--default.select2-container--open .select2-selection--single,
.orders-filter-panel input:focus,
.orders-filter-panel select:focus,
.orders-filter-panel .form-control:focus,
.orders-filter-panel .select2-container--default.select2-container--focus .select2-selection--single,
.orders-filter-panel .select2-container--default.select2-container--open .select2-selection--single {
    background: #ffffff !important;
    border-color: #1f3a5f !important;
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08) !important;
}

.list-filter-actions,
.filter-actions,
.orders-filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid #edf2f7 !important;
}

.list-filter-actions,
.orders-filter-actions {
    margin-top: 8px !important;
    padding-top: 8px !important;
}


.orders-filter-checkbox {
    display: flex;
    align-items: center;
    min-height: 36px;
}

.orders-filter-checkbox .form-group,
.orders-filter-checkbox .checkbox,
.orders-filter-checkbox .form-check {
    display: flex;
    align-items: center;
    margin: 0 !important;
    gap: 10px;
}

.orders-filter-checkbox .checkbox label,
.orders-filter-checkbox .form-check label,
.orders-filter-checkbox label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px;
    padding-left: 0 !important;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 !important;
    cursor: pointer;
}

.orders-filter-checkbox .checkbox label::before,
.orders-filter-checkbox .checkbox label::after,
.orders-filter-checkbox .form-check label::before,
.orders-filter-checkbox .form-check label::after {
    display: none !important;
}

.orders-filter-checkbox input[type="checkbox"] {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: auto !important;
    width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    flex: 0 0 16px;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    top: auto !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.list-filter-actions__right,
.filter-actions__right,
.orders-filter-actions__right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center !important;
    margin-left: auto !important;
}

.list-filter-actions .btn,
.list-filter-actions__right .btn,
.filter-actions .btn,
.filter-actions__right .btn,
.orders-filter-actions .btn,
.orders-filter-actions__right .btn {
    height: auto !important;
    min-width: 0 !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
    margin-bottom: 0 !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
}

.list-filter-actions .btn,
.list-filter-actions__right .btn,
.orders-filter-actions .btn,
.orders-filter-actions__right .btn {
    padding: 9px 14px !important;
}

@media (max-width: 1200px) {
    .orders-queues {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .list-filter-grid,
    .orders-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .orders-queues {
        grid-template-columns: 1fr;
    }

    .list-page-head,
    .orders-page-head,
    .page-head {
        flex-direction: column;
    }

    .list-page-head__actions,
    .orders-page-head__right,
    .page-head__actions {
        width: 100%;
        flex-direction: column;
    }

    .list-page-head__actions .btn,
    .orders-page-head__right .btn,
    .page-head__actions .btn {
        width: 100%;
    }

    .list-filter-grid,
    .orders-filter-grid {
        grid-template-columns: 1fr;
    }

    .list-filter-actions,
    .orders-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .list-filter-actions__right,
    .orders-filter-actions__right {
        width: 100% !important;
        flex-direction: column;
        margin-left: 0 !important;
    }

    .list-filter-actions__right .btn,
    .orders-filter-actions__right .btn {
        width: 100% !important;
    }
}

/* ===== Shared list table toolbar ===== */

.list-toolbar,
.orders-toolbar {
    margin-top: 6px !important;
    margin-bottom: 6px !important;
}

.list-toolbar__summary,
.orders-toolbar__summary {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px !important;
    padding: 8px 12px !important;
    background: #ffffff !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

.orders-toolbar__count {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
}

.orders-legend {
    display: flex;
    gap: 12px !important;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 0 0 auto !important;
}

.orders-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px !important;
    color: #64748b !important;
}

.orders-bulk-panel {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

.orders-bulk-panel__inner {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 8px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    border: 1px solid #dbe3ee !important;
    box-shadow: none !important;
}

.orders-bulk-panel__inner .btn {
    height: 34px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    border: 1px solid #dbe3ee !important;
    color: #334155 !important;
    box-shadow: none !important;
}

.table-responsive {
    background: #ffffff !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 14px !important;
    overflow: hidden !important;
}

.list-toolbar ~ .table-responsive,
.orders-toolbar ~ .table-responsive {
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

.table {
    margin-bottom: 0 !important;
    border: 0 !important;
    background: #ffffff !important;
}

.table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    text-transform: none !important;
    border-bottom: 1px solid #dbe3ee !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.table td {
    background: #ffffff !important;
    border-top: 1px solid #eef2f7 !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    font-size: 13px !important;
    color: #1f2937 !important;
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover td {
    background: #f8fbff !important;
    color: #0f172a !important;
}

.table tbody td:first-child,
.table thead th:first-child {
    padding-left: 16px !important;
}

.table tbody td:last-child,
.table thead th:last-child {
    padding-right: 16px !important;
}

.table tbody td a {
    color: #1f3a5f !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

.table tbody td a:hover {
    color: #29466d !important;
    text-decoration: underline !important;
}

.table input[type="checkbox"] {
    transform: scale(1.05);
}

.order-number-cell {
    display: grid;
    gap: 6px;
    min-width: 110px;
}

.order-number-cell__link {
    width: fit-content;
    color: #1f3a5f !important;
    font-weight: 800 !important;
}

.order-chain-trigger {
    width: fit-content;
    height: 26px;
    min-height: 26px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #d6e4f4;
    border-radius: 999px;
    background: #f8fbff;
    color: #42617f;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
}

.order-chain-trigger:hover,
.order-chain-trigger:focus {
    border-color: #9ec5fe;
    background: #eef6ff;
    color: #1f3a5f;
    outline: none;
}

.order-chain-trigger i {
    font-size: 10px;
}

.order-status-cell__form {
    margin: 0;
}

.order-status-service {
    width: 148px;
    max-width: 148px;
    display: block;
    overflow: hidden;
    margin-top: 4px;
    padding: 0 6px;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

select[name="per_page"],
select#per_page {
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    padding: 6px 28px 6px 10px !important;
    background: #ffffff !important;
}

.list-pagination-bar {
    display: grid;
    grid-template-columns: minmax(96px, 1fr) auto minmax(96px, 1fr);
    align-items: center;
    gap: 12px;
    margin: 10px 0 8px !important;
}

.list-pagination-size {
    justify-self: start;
}

.list-pagination-size .btn {
    min-width: 50px;
    height: 32px;
    padding: 0 12px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #334155 !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

.list-pagination-size .btn:hover,
.list-pagination-size .btn:focus {
    background: #eef3ff !important;
    color: #1f3a5f !important;
}

.list-pagination-pages {
    justify-self: center;
    min-width: 0;
}

.list-pagination-pages nav {
    line-height: 1;
}

.list-pagination-spacer {
    min-width: 96px;
}

.pagination {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    gap: 2px;
}

.page-item {
    display: flex !important;
    align-items: center !important;
}

.page-link {
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    border-radius: 8px !important;
    margin: 0 !important;
    border: none !important;
    color: #475569 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-weight: 700 !important;
}

.page-item.active .page-link {
    background: #1f3a5f !important;
    color: #ffffff !important;
}

.page-item.disabled .page-link {
    opacity: 0.55;
}

.order-money-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 7px;
    min-width: 118px;
}

.order-money-cell__total {
    color: #1f2937;
    font-weight: 700;
    white-space: nowrap;
}

.order-prepayment-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.order-prepayment-chip__label {
    color: #16a34a;
}

.order-prepayment-chip__value {
    color: #166534;
}

@media (max-width: 768px) {
    .list-pagination-bar {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .list-pagination-size,
    .list-pagination-pages {
        justify-self: center;
    }

    .list-pagination-spacer {
        display: none;
    }

    .list-toolbar__summary,
    .orders-toolbar__summary {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px !important;
    }

    .orders-legend {
        display: none !important;
    }

    .orders-bulk-panel {
        display: none !important;
    }

    .table thead th,
    .table td {
        font-size: 12px !important;
    }
}

/* ===== Shared list summary and empty state ===== */

.list-summary,
.summary-pill,
.orders-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    font-size: 13px;
    line-height: 1;
}

.list-summary__label,
.summary-pill__label,
.orders-summary__label {
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 11px;
}

.list-summary__value,
.summary-pill__value,
.orders-summary__value {
    color: #1f2937;
    font-weight: 800;
    font-size: 16px;
}

.list-page-subtitle {
    margin: 6px 0 0 !important;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.messages-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.messages-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.messages-head h1 {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0;
}

.messages-head p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

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

.messages-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 10px;
}

.messages-stat {
    min-width: 0;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.messages-stat span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.messages-stat strong {
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.messages-stat--accent {
    border-color: rgba(31, 58, 95, 0.22);
    background: var(--primary-soft);
}

.messages-stat--accent strong {
    color: var(--primary);
}

.messages-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr) minmax(220px, 1fr);
    gap: 8px 12px;
    margin-bottom: 8px;
}

.messages-filter__search {
    min-width: 0;
}

.messages-filter-note {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.messages-table-wrap {
    margin-top: 0;
}

.messages-row--unread td {
    background: #f5fbff !important;
}

.messages-order-link {
    color: var(--primary) !important;
    font-weight: 900;
    text-decoration: none !important;
}

.messages-type {
    min-height: 28px;
    padding: 6px 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.messages-type--chat {
    background: #e0f2fe;
    color: #0369a1;
}

.messages-type--action {
    background: #fef3c7;
    color: #92400e;
}

.messages-type--status {
    background: #eef2ff;
    color: #3730a3;
}

.messages-type--system {
    background: #f1f5f9;
    color: #475569;
}

.messages-text-cell {
    min-width: 320px;
}

.messages-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
}

.messages-text {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.messages-unread-badge {
    min-height: 26px;
    padding: 6px 9px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.messages-actions-cell {
    width: 62px;
    text-align: right;
}

.messages-actions-cell form {
    margin: 0;
}

@media (max-width: 1180px) {
    .messages-stats {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .messages-filter-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .messages-head {
        flex-direction: column;
    }

    .messages-head__actions,
    .messages-head__actions form,
    .messages-head__actions .btn {
        width: 100%;
    }

    .messages-stats,
    .messages-filter-grid {
        grid-template-columns: 1fr;
    }

    .messages-filter-note {
        width: 100%;
    }
}

.list-filter-grid--single {
    grid-template-columns: minmax(280px, 520px);
}

.list-empty-state {
    padding: 42px 20px 48px;
    border: 1px dashed #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    text-align: center;
}

.list-empty-state__icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #eef3ff;
    color: #1f3a5f;
    font-size: 18px;
}

.list-empty-state h3 {
    margin: 0 0 7px !important;
    color: #1f2937;
    font-size: 18px !important;
    font-weight: 800 !important;
}

.list-empty-state p {
    margin: 0 !important;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .list-filter-grid--single {
        grid-template-columns: 1fr;
    }
}

.order-row-actions {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.order-row-actions .btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
    box-shadow: none !important;
}

.order-row-actions .btn i {
    margin: 0 !important;
}

.order-row-delete-form {
    display: inline-flex;
    margin: 0;
}

.order-edit-delete-form {
    display: inline-flex;
    margin: 0;
}

.order-edit-delete-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.crm-confirm-modal .modal-dialog {
    max-width: 460px;
}

.crm-confirm-modal .modal-content {
    overflow: hidden;
    border: 1px solid #dbe3ee !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22) !important;
}

.crm-confirm-modal .modal-header {
    align-items: flex-start;
    padding: 24px 26px 18px !important;
    border-bottom: 1px solid #eef2f7 !important;
}

.crm-confirm-modal__heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.crm-confirm-modal__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 16px;
}

.crm-confirm-modal .modal-title {
    margin: 0 0 7px !important;
    color: #1f2937 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
}

.crm-confirm-modal__message {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
}

.crm-confirm-modal .close {
    width: 34px;
    height: 34px;
    margin: -6px -8px 0 8px !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #94a3b8 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

.crm-confirm-modal .close:hover,
.crm-confirm-modal .close:focus {
    background: #f1f5f9;
    color: #334155 !important;
    outline: none;
}

.crm-confirm-modal .modal-footer {
    gap: 10px;
    padding: 16px 26px 24px !important;
    border-top: 0 !important;
}

.crm-confirm-modal .modal-footer .btn {
    min-height: 42px !important;
    min-width: 124px;
    margin: 0 !important;
    padding: 0 18px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
}

.crm-confirm-modal .btn-danger,
.crm-confirm-modal .btn.btn-danger {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 18px rgba(220, 38, 38, 0.16) !important;
}

.crm-confirm-modal .btn-danger:hover,
.crm-confirm-modal .btn.btn-danger:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}


.change_status,
.status-select {
    min-width: 148px;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 34px 0 12px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    border: 1px solid #dbe3ee !important;
    box-shadow: none !important;
    background-image: none !important;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.15s ease;
}

.status-select:focus,
.change_status:focus {
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08) !important;
}


/* ===== STATUS SYSTEM (final) ===== */

/* 🔵 старт */
.status-select--new {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #2563eb !important;
}

/* 🔷 диагностика */
.status-select--inspection {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    color: #0284c7 !important;
}

/* 🟣 согласование */
.status-select--consideration,
.status-select--on_coordination,
.status-select--coordinate {
    background: #f5f3ff !important;
    border-color: #ddd6fe !important;
    color: #6d28d9 !important;
}

/* 🟠 работа */
.status-select--in_progress,
.status-select--need_detail {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    color: #c2410c !important;
}

/* 🟦 АСЦ / логистика */
.status-select--wait_asc,
.status-select--prepared_asc,
.status-select--adopted_from_asc {
    background: #ecfeff !important;
    border-color: #a5f3fc !important;
    color: #0f766e !important;
}

/* 🟢 завершено */
.status-select--done,
.status-select--finished,
.status-select--issued,
.status-select--issued_to_client {
    background: #ecfdf3 !important;
    border-color: #bbf7d0 !important;
    color: #15803d !important;
}

/* 🔴 отказ */
.status-select--rejection,
.status-select--rejected,
.status-select--done_rejected {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #b91c1c !important;
}

/* ⚪ fallback */

.status-select--unknown {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

/* ===== STATUS FILTER SYSTEM ===== */
.status-filter-select {
    font-weight: 700 !important;
}

.status-filter-select[data-current-status="new"] {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #2563eb !important;
}

.status-filter-select[data-current-status="inspection"] {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    color: #0284c7 !important;
}

.status-filter-select[data-current-status="consideration"],
.status-filter-select[data-current-status="on_coordination"],
.status-filter-select[data-current-status="coordinate"] {
    background: #f5f3ff !important;
    border-color: #ddd6fe !important;
    color: #6d28d9 !important;
}

.status-filter-select[data-current-status="in_progress"],
.status-filter-select[data-current-status="need_detail"] {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    color: #c2410c !important;
}

.status-filter-select[data-current-status="wait_asc"],
.status-filter-select[data-current-status="prepared_asc"],
.status-filter-select[data-current-status="adopted_from_asc"] {
    background: #ecfeff !important;
    border-color: #a5f3fc !important;
    color: #0f766e !important;
}

.status-filter-select[data-current-status="done"],
.status-filter-select[data-current-status="finished"],
.status-filter-select[data-current-status="issued"],
.status-filter-select[data-current-status="issued_to_client"] {
    background: #ecfdf3 !important;
    border-color: #bbf7d0 !important;
    color: #15803d !important;
}

.status-filter-select[data-current-status="rejection"],
.status-filter-select[data-current-status="rejected"],
.status-filter-select[data-current-status="done_rejected"] {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #b91c1c !important;
}

.status-filter-select[data-current-status="unknown"],
.status-filter-select[data-current-status=""],
.status-filter-select:not([data-current-status]) {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}


@media (max-width: 768px) {
    .orders-summary {
        width: 100%;
        justify-content: space-between;
    }

    .order-row-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ===== Related order chain modal ===== */

.order-chain-modal .modal-dialog {
    max-width: 440px;
}

.order-chain-modal .modal-content {
    overflow: hidden;
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 20px 52px rgba(15, 23, 42, 0.18) !important;
}

.order-chain-modal .modal-header {
    align-items: flex-start;
    gap: 18px;
    padding: 22px 24px 16px !important;
    border-bottom: 1px solid #eef2f7 !important;
}

.order-chain-modal__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.order-chain-modal .modal-title {
    margin: 0;
    color: var(--text) !important;
    font-size: 19px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
}

.order-chain-modal .close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--border) !important;
    border-radius: 11px;
    background: #f8fafc !important;
    color: #64748b !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

.order-chain-modal .close:hover {
    border-color: #c7d2fe !important;
    background: #eef3ff !important;
    color: #3347a9 !important;
}

.order-chain-modal .modal-body {
    padding: 18px 24px 22px !important;
    background: #f8fafc !important;
}

.order-chain-modal__list {
    display: grid;
    gap: 8px;
}

.order-chain-modal__item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 11px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    color: var(--text) !important;
    text-decoration: none !important;
}

.order-chain-modal__item:hover {
    border-color: #9ec5fe;
    background: #f7fbff;
    text-decoration: none !important;
}

.order-chain-modal__item.is-current {
    border-color: #8bd6ff;
    background: #e0f5ff;
}

.order-chain-modal__number {
    color: var(--primary);
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.order-chain-modal__content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.order-chain-modal__state {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.order-chain-modal__reason {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

/* ===== Order details modal ===== */

.order-details-modal .modal-dialog {
    max-width: 960px;
}

.order-details-modal .modal-content {
    overflow: hidden;
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 20px 52px rgba(15, 23, 42, 0.18) !important;
}

.order-details-modal .modal-header {
    align-items: flex-start;
    gap: 22px;
    padding: 24px 26px 18px !important;
    border-bottom: 1px solid #eef2f7 !important;
}

.order-details-modal__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.order-details-modal__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.order-details-modal__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.order-details-modal .modal-title {
    margin: 0;
    color: var(--text) !important;
    font-size: 21px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
}

.order-details-status {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.order-details-status--new {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
}

.order-details-status--inspection {
    border-color: #7dd3fc;
    background: #e0f2fe;
    color: #0284c7;
}

.order-details-status--consideration,
.order-details-status--on_coordination,
.order-details-status--coordinate {
    border-color: #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}

.order-details-status--in_progress,
.order-details-status--need_detail {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.order-details-status--wait_asc,
.order-details-status--adopted_from_asc {
    border-color: #a5f3fc;
    background: #ecfeff;
    color: #0f766e;
}

.order-details-status--done,
.order-details-status--issued_to_client {
    border-color: #bbf7d0;
    background: #ecfdf3;
    color: #15803d;
}

.order-details-status--rejection {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.order-details-modal__subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 9px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.order-details-modal .close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--border) !important;
    border-radius: 11px;
    background: #f8fafc !important;
    color: #64748b !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

.order-details-modal .close:hover {
    border-color: #c7d2fe !important;
    background: #eef3ff !important;
    color: #3347a9 !important;
}

.order-details-modal .modal-body {
    max-height: calc(100vh - 262px);
    overflow-y: auto;
    padding: 18px 26px !important;
    background: #f8fafc !important;
}

.order-details-chain-card {
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid #dbe5f3;
    border-radius: 14px;
    background: #ffffff;
}

.order-details-chain-card__title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
    color: #1f2937;
    font-size: 13px;
    font-weight: 800;
}

.order-details-chain-card__title i {
    color: #1f3a5f;
}

.order-details-chain {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 7px;
}

.order-details-chain__item {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-width: 86px;
    min-height: 48px;
    padding: 8px 11px;
    border: 1px solid #cfe0f6;
    border-radius: 12px;
    background: #f8fbff;
    color: #1f3a5f !important;
    text-decoration: none !important;
}

.order-details-chain__item:hover {
    border-color: #9ec5fe;
    background: #eef6ff;
    text-decoration: none !important;
}

.order-details-chain__item.is-current {
    border-color: #8bd6ff;
    background: #e0f5ff;
}

.order-details-chain__number {
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.order-details-chain__reason {
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.order-details-chain__arrow {
    align-self: center;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 900;
}

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

.order-details-card {
    padding: 17px 18px 8px;
    border: 1px solid #e5ebf3;
    border-radius: 14px;
    background: #ffffff;
}

.order-details-card--wide {
    grid-column: 1 / -1;
    padding-bottom: 16px;
}

.order-details-card__title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 9px;
    color: #1f2937;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.order-details-card__title i {
    display: inline-flex;
    width: 29px;
    height: 29px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #eef3ff;
    color: #1f3a5f;
    font-size: 13px;
}

.order-details-list {
    margin: 0;
}

.order-details-list__row {
    display: grid;
    grid-template-columns: minmax(112px, 43%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-height: 38px;
    padding: 10px 0;
    border-top: 1px solid #eef2f7;
}

.order-details-list__row dt {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.order-details-list__row dd {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.order-details-description {
    margin: 0;
    padding: 13px 14px;
    border-radius: 11px;
    background: #f8fafc;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.order-details-modal .modal-footer {
    gap: 10px;
    padding: 16px 26px 20px !important;
    border-top: 1px solid #eef2f7 !important;
    background: #ffffff;
}

.order-details-modal .modal-footer .btn {
    min-height: 44px !important;
    padding: 0 18px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 42px !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.order-details-modal .modal-footer .btn-primary {
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .order-details-modal .modal-dialog {
        margin: 12px;
    }

    .order-details-modal .modal-content {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 24px);
    }

    .order-details-modal .modal-header {
        flex: 0 0 auto;
        padding: 18px 16px 14px !important;
    }

    .order-details-modal__title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .order-details-modal .modal-title {
        font-size: 18px !important;
    }

    .order-details-modal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: 14px 16px !important;
    }

    .order-details-grid {
        grid-template-columns: 1fr;
    }

    .order-details-card {
        padding-left: 14px;
        padding-right: 14px;
    }

    .order-details-modal .modal-footer {
        flex: 0 0 auto;
        padding: 14px 16px 16px !important;
    }
}


/* ===== Staff tasks block ===== */

.deadline-issues-section {
    margin: 0 0 20px !important;
}

.deadline-issues-section--compact {
    margin-bottom: 10px !important;
    padding: 0 14px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
}

.deadline-issues-section--compact .deadline-issues-section__head {
    min-height: 52px;
    margin-bottom: 0;
}

.deadline-issues-section--compact .deadline-issues-section__title {
    font-size: 17px !important;
}

.deadline-issues-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.deadline-issues-section__tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.deadline-issues-section__toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 9px !important;
    background: #ffffff !important;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.deadline-issues-section__toggle i {
    font-size: 10px;
    transition: transform 0.18s ease;
}

.deadline-issues-section__toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.deadline-issues-section--compact .deadline-issues-list {
    padding-bottom: 12px;
}

.deadline-issues-section__title {
    margin: 0 !important;
    font-size: 26px !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
    color: var(--text) !important;
}

.deadline-issues-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.deadline-issues-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.deadline-issue-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-top: 3px solid #6d5dfc;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.deadline-issue-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.deadline-issue-card__title {
    display: inline-block;
    color: #6d5dfc !important;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none !important;
}

.deadline-issue-card__title:hover {
    color: #4f46e5 !important;
}

.deadline-issue-card__date {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.deadline-issue-card__date strong {
    color: var(--text);
    font-weight: 800;
}

.deadline-issue-card__labels {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.deadline-issue-card__labels .badge {
    border-radius: 999px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

.deadline-issue-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.main-page-card {
    margin-top: 0 !important;
}

.main-page-card--flat {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.main-page-card--flat > .card-body {
    padding: 0 !important;
}


@media (max-width: 768px) {
    .deadline-issues-section__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .deadline-issues-section__title {
        font-size: 22px !important;
    }

    .deadline-issues-list {
        grid-template-columns: 1fr;
    }

    .deadline-issue-card {
        min-height: auto;
        padding: 16px;
    }

    .deadline-issue-card__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .deadline-issue-card__date {
        text-align: left;
        white-space: normal;
    }
}

/* ===== Order edit page ===== */

.order-edit-page {
    align-items: flex-start;
}

.order-edit-page--workspace {
    display: grid;
    grid-template-columns: minmax(620px, 1fr) 320px;
    gap: 18px;
    margin-right: 0;
    margin-left: 0;
}

.order-edit-page--workspace > .order-edit-main-col,
.order-edit-page--workspace > .order-edit-sidebar-col {
    width: auto;
    max-width: none;
    flex: none;
    padding-right: 0;
    padding-left: 0;
}

.order-edit-head {
    margin-bottom: 16px !important;
    padding: 18px 20px !important;
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-sm) !important;
}

.order-edit-head__main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-edit-head__heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.order-edit-head__status {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 34px;
    padding: 0 14px !important;
    border-radius: 999px !important;
    background: #eef3ff !important;
    color: #3347a9 !important;
    border: 1px solid #d6defe !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}

.order-edit-head__status--inspection,
.order-edit-head__status--new {
    background: #eef3ff !important;
    border-color: #c7d2fe !important;
    color: #3347a9 !important;
}

.order-edit-head__status--coordinate,
.order-edit-head__status--in_progress,
.order-edit-head__status--done,
.order-edit-head__status--adopted_from_asc,
.order-edit-head__status--issued_to_client {
    background: #ecfdf3 !important;
    border-color: #bbf7d0 !important;
    color: #15803d !important;
}

.order-edit-head__status--on_coordination,
.order-edit-head__status--need_detail,
.order-edit-head__status--wait_asc {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    color: #c2410c !important;
}

.order-edit-head__status--rejection {
    background: #fff1f2 !important;
    border-color: #fecdd3 !important;
    color: #be123c !important;
}

.order-edit-head__title {
    margin: 0 !important;
    font-size: 30px !important;
}

.order-edit-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--text-muted) !important;
    font-size: 15px !important;
    font-weight: 600;
}

.order-edit-head__meta span {
    position: relative;
}


.order-edit-head__meta span:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -10px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #cbd5e1;
    transform: translateY(-50%);
}

.order-edit-head__status-line {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
}

.order-edit-head__status-line-title {
    display: none;
}

.order-edit-head__status-line-track {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.order-edit-head__status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.order-edit-head__status-chip--done {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #15803d;
}

.order-edit-head__status-chip--current {
    background: #eef3ff;
    border-color: #c7d2fe;
    color: #3347a9;
}

.order-edit-head__status-chip--danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.order-edit-head__status-separator {
    display: none;
}



.order-edit-head__actions {
    align-items: center !important;
}

.order-edit-head__btn {
    min-height: 44px !important;
}

.order-edit-tabs {
    margin-bottom: 14px !important;
    border-bottom: 0 !important;
    gap: 8px;
}

.order-edit-tabs .nav-item {
    margin-bottom: 0 !important;
}

.order-edit-tabs .nav-link {
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: var(--text-muted) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 10px 14px !important;
    box-shadow: none !important;
}

.order-edit-tabs .nav-link:hover {
    color: var(--text) !important;
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
}

.order-edit-tabs .nav-link.active,
.order-edit-tabs .nav-item.show .nav-link {
    background: #eef3ff !important;
    border-color: #c7d2fe !important;
    color: #3347a9 !important;
    box-shadow: none !important;
}

.order-edit-tab-content {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible;
}

.order-edit-tab-content > .tab-pane {
    margin: 0 !important;
}

.order-edit-jump-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef2f7;
}

.order-edit-jump-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    color: #475569 !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
}

.order-edit-jump-nav a:hover {
    border-color: #c7d2fe;
    background: #eef3ff;
    color: #3347a9 !important;
}

.order-edit-anchor {
    scroll-margin-top: 88px;
}

.order-edit-form-actions {
    margin-top: 18px !important;
    padding-top: 16px !important;
}

.order-edit-sidebar-col {
    margin-top: 0 !important;
}

.order-edit-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-edit-sidebar > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.order-edit-sidebar__section {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 16px 18px !important;
}

.order-edit-sidebar__title {
    margin: 0 0 8px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--text) !important;
}

.order-edit-sidebar__logs small {
    color: var(--text-muted) !important;
}

.order-edit-sidebar__logs-count {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
}

.order-edit-events {
    display: flex;
    flex-direction: column;
}

.order-edit-event {
    position: relative;
    margin: 0;
    padding: 0 0 17px 19px;
    border-left: 1px solid #dbe3ee;
}

.order-edit-event:last-child {
    padding-bottom: 0;
}

.order-edit-event::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 4px;
    width: 9px;
    height: 9px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #4f46e5;
    box-shadow: 0 0 0 1px #c7d2fe;
}

.order-edit-event__description {
    margin: 0 0 5px !important;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.order-edit-event__date {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.order-edit-events__empty {
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.order-edit-sidebar__logs hr {
    margin: 12px 0 !important;
}

.order-edit-sidebar__logs .btn {
    width: 100%;
}

.order-task-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-task-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.order-task-panel__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.order-task-panel__head .order-edit-sidebar__title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 !important;
}

.order-task-panel__count {
    display: inline-flex;
    min-width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    color: #4338ca;
    background: #eef2ff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.order-task-panel__list {
    display: grid;
    gap: 7px;
}

.order-task-panel__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    padding: 10px;
    color: var(--text) !important;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-left: 3px solid #4f46e5;
    border-radius: 9px;
    text-decoration: none !important;
}

.order-task-panel__item.is-overdue {
    border-left-color: #dc2626;
}

.order-task-panel__item:hover {
    border-color: #a5b4fc;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .06);
}

.order-task-panel__item-main {
    min-width: 0;
}

.order-task-panel__item-main strong,
.order-task-panel__item-main small {
    display: block;
}

.order-task-panel__item-main strong {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-task-panel__item-main small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

.order-task-panel__status {
    display: inline-flex;
    min-height: 23px;
    flex: 0 0 auto;
    align-items: center;
    padding: 0 7px;
    color: #075985;
    background: #e0f2fe;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

.order-task-panel__status--done {
    color: #166534;
    background: #dcfce7;
}

.order-task-panel__status--cancelled {
    color: #475569;
    background: #e2e8f0;
}

.order-task-panel__empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px dashed var(--border);
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
}

.order-task-panel__more {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.order-task-panel__create {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
}

/* ===== Order info cards ===== */
.order-edit-tab-content #view .card {
    height: 100%;
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-sm) !important;
}

.order-edit-tab-content #view .card-body {
    padding: 18px 20px !important;
}

.order-edit-tab-content #view .card-title {
    margin: 0 0 14px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    color: var(--text) !important;
}

.order-edit-tab-content #view .table.table-sm {
    margin-bottom: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.order-edit-tab-content #view .table.table-sm tbody tr:first-child td {
    border-top: 0 !important;
}

.order-edit-tab-content #view .table.table-sm td {
    padding: 11px 0 !important;
    border-top: 1px solid #eef2f7 !important;
    background: transparent !important;
    vertical-align: top !important;
    font-size: 14px !important;
    color: var(--text) !important;
}

.order-edit-tab-content #view .table.table-sm td:first-child {
    width: 240px;
    padding-right: 18px !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
}

.order-edit-tab-content #view .table.table-sm td:first-child b {
    font-weight: 700 !important;
    color: inherit !important;
}

.order-edit-tab-content #view .table.table-sm td:last-child {
    font-weight: 600 !important;
    color: #1f2937 !important;
    word-break: break-word;
}

.order-edit-tab-content #view .col-12 .card-body > div {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: var(--text) !important;
}

.order-edit-tab-content #view .row {
    margin-left: -8px;
    margin-right: -8px;
}

.order-edit-tab-content #view .row > [class*="col-"] {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

@media (max-width: 1399px) {
    .order-edit-head {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .order-edit-head__actions {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .order-edit-head {
        padding: 16px !important;
    }

    .order-edit-head__meta {
        flex-direction: column;
        gap: 6px;
    }

    .order-edit-head__meta span::after {
        display: none !important;
    }

    .order-edit-head__status-line {
        margin-top: 12px;
    }

    .order-edit-head__status-line-track {
        gap: 6px;
    }

    .order-edit-head__status-chip {
        min-height: 30px;
        padding: 0 12px;
        font-size: 12px;
    }

    .order-edit-head__status-separator {
        font-size: 13px;
    }

    .order-edit-head__actions {
        width: 100%;
        flex-direction: column;
    }

    .order-edit-head__actions .btn {
        width: 100%;
    }

    .order-edit-tabs {
        flex-wrap: wrap;
    }

    .order-edit-tab-content {
        padding: 16px !important;
    }

    .order-edit-tab-content #view .card-body {
        padding: 16px !important;
    }

    .order-edit-tab-content #view .card-title {
        margin-bottom: 12px !important;
        font-size: 14px !important;
    }

    .order-edit-tab-content #view .table.table-sm td {
        display: block;
        width: 100% !important;
        padding: 8px 0 !important;
    }

    .order-edit-tab-content #view .table.table-sm td:first-child {
        padding-right: 0 !important;
        padding-bottom: 2px !important;
    }

    .order-edit-tab-content #view .row {
        margin-left: 0;
        margin-right: 0;
    }

    .order-edit-tab-content #view .row > [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

@media (max-width: 1399px) {
    .order-edit-page--workspace {
        display: block;
    }

    .order-edit-page--workspace > .order-edit-sidebar-col {
        margin-top: 18px !important;
    }
}

/* ===== Order edit form sections ===== */

.order-edit-section {
    padding: 18px 0 !important;
    border-top: 1px solid #eef2f7;
}

.order-edit-tab-content > .order-edit-section:first-child,
.order-edit-tab-content form > .order-edit-section:first-child {
    padding-top: 0 !important;
    border-top: 0 !important;
}

.order-edit-section + .order-edit-section {
    margin-top: 4px;
}

.order-edit-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.order-edit-section__title {
    margin: 0 !important;
    font-size: 17px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    color: var(--text) !important;
}

.order-edit-grid {
    row-gap: 2px;
}

.order-edit-grid > [class*="col-"] {
    margin-bottom: 0 !important;
}

.order-edit-grid .form-group {
    margin-bottom: 14px !important;
}

.order-edit-grid label,
.order-edit-section label,
.order-edit-tab-content label,
.order-edit-tab-content .control-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
}

.order-edit-grid .form-control,
.order-edit-grid input,
.order-edit-grid select,
.order-edit-grid textarea,
.order-edit-section .form-control,
.order-edit-section input,
.order-edit-section select,
.order-edit-section textarea {
    background: #ffffff !important;
}

.order-edit-grid textarea,
.order-edit-section textarea {
    min-height: 104px !important;
}

.order-edit-section--details {
    padding-bottom: 0 !important;
}

.order-edit-section--details .table,
.order-edit-section--details .table-responsive {
    border-radius: 14px !important;
}

.order-edit-section--request {
    padding-bottom: 0 !important;
}

.order-edit-request-fields {
    align-items: flex-end;
}

.order-edit-request-fields .form-group {
    margin-bottom: 0 !important;
}

.order-edit-customer-heading {
    margin: 14px 0 10px;
}

.order-edit-customer-heading h6 {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.order-edit-parts {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eef2f7;
}

.order-edit-section--request .order-detail-item {
    padding: 10px 12px !important;
    background: #f8fafc !important;
    box-shadow: none !important;
}

.order-edit-section--request .order-details-formset__items {
    gap: 8px;
}

.order-edit-section--request .order-details-formset__actions {
    padding-top: 10px !important;
}

.order-edit-section--request .order-details-formset__actions .btn {
    min-height: 42px !important;
}

/* ===== Device two-column layout (edit page) ===== */
.order-edit-device-layout {
    display: flex;
    align-items: flex-start;
    margin-left: -12px;
    margin-right: -12px;
}

.order-edit-device-layout > [class*="col-"] {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.order-edit-device-layout > [class*="col-"]:first-child {
    border-right: 1px solid #eef2f7;
}

.order-edit-device-layout .order-edit-grid .form-group {
    margin-bottom: 12px !important;
}

.order-edit-device-layout .input-group {
    align-items: center !important;
}

.order-edit-section .row.order-edit-grid + .row.order-edit-grid {
    margin-top: 8px;
}

@media (max-width: 991px) {
    .order-edit-device-layout {
        margin-left: 0;
        margin-right: 0;
    }

    .order-edit-device-layout > [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .order-edit-device-layout > [class*="col-"]:first-child {
        border-right: 0;
        margin-bottom: 16px;
    }
}

@media (max-width: 768px) {
    .order-edit-section {
        padding: 16px 0 !important;
    }

    .order-edit-section__head {
        margin-bottom: 12px;
    }

    .order-edit-section__title {
        font-size: 16px !important;
    }
}

/* ===== Order status card ===== */

.order-edit-status-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-edit-sidebar__head {
    margin-bottom: 2px;
}

.order-edit-status-card__summary {
    display: none;
}

.order-edit-status-card__summary-label {
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.order-edit-status-card__summary-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: #eef3ff;
    border: 1px solid #c7d2fe;
    color: #3347a9;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.order-edit-status-card__summary-badge--danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.order-edit-status-card__summary-note {
    font-size: 13px;
    line-height: 1.45;
    font-weight: 600;
    color: #475569;
}

.order-edit-status-card__note {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fffaf0;
    border: 1px solid #fde7c2;
    font-size: 13px;
    font-weight: 600;
    color: #9a6700;
}

.order-edit-status-card__actions-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Status flow (stages) ===== */
.order-edit-status-card__flow {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
    border: 1px solid #dbe7f3;
    overflow: hidden;
}

.order-edit-status-card__flow-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.order-edit-status-card__flow-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(72px, 1fr));
    gap: 0;
    align-items: start;
    position: relative;
}

.order-edit-status-card__flow-list::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 6%;
    right: 6%;
    height: 2px;
    background: #dbe3ee;
    z-index: 0;
}

.order-edit-status-card__flow-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 84px;
    padding: 0 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.order-edit-status-card__flow-step::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    box-shadow: 0 0 0 6px #f3f7fc;
    flex: 0 0 14px;
}

.order-edit-status-card__flow-step--done {
    color: #15803d;
}

.order-edit-status-card__flow-step--done::before {
    background: #22c55e;
    border-color: #22c55e;
}

.order-edit-status-card__flow-step--current {
    color: #3347a9;
    font-weight: 800;
}

.order-edit-status-card__flow-step--current::before {
    background: #4f46e5;
    border-color: #4f46e5;
    box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.12);
}

.order-edit-status-card__flow-step--danger {
    min-height: auto;
    align-items: flex-start;
    text-align: left;
    color: #b91c1c;
}

.order-edit-status-card__flow-step--danger::before {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.08);
}

.order-edit-status-card__danger {
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid #eef2f7;
}

.order-edit-status-card .btn {
    width: 100%;
    min-height: 44px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}

.order-edit-status-card form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-edit-status-card form + form {
    margin-top: 0 !important;
}

.order-edit-status-card .btn + .btn {
    margin-top: 0 !important;
}

.order-edit-status-card .btn-primary,
.order-edit-status-card .btn.btn-primary {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

.order-edit-status-card .btn-primary:hover,
.order-edit-status-card .btn.btn-primary:hover {
    background: #15803d !important;
    border-color: #15803d !important;
}

.order-edit-status-card .btn-warning,
.order-edit-status-card .btn.btn-warning {
    background: #fff7ed !important;
    border: 1px solid #fdba74 !important;
    color: #c2410c !important;
}

.order-edit-status-card .btn-warning:hover,
.order-edit-status-card .btn.btn-warning:hover {
    background: #ffedd5 !important;
    border-color: #fb923c !important;
    color: #9a3412 !important;
}

.order-edit-status-card .btn-danger,
.order-edit-status-card .btn.btn-danger {
    background: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
    color: #be123c !important;
}

.order-edit-status-card .btn-danger:hover,
.order-edit-status-card .btn.btn-danger:hover {
    background: #ffe4e6 !important;
    border-color: #fda4af !important;
    color: #9f1239 !important;
}

.order-edit-status-card .btn-secondary,
.order-edit-status-card .btn.btn-secondary,
.order-edit-status-card .btn-outline-secondary,
.order-edit-status-card .btn.btn-outline-secondary {
    background: #ffffff !important;
    border: 1px solid #dbe3ee !important;
    color: #334155 !important;
}


.order-edit-status-card .btn-secondary:hover,
.order-edit-status-card .btn.btn-secondary:hover,
.order-edit-status-card .btn-outline-secondary:hover,
.order-edit-status-card .btn.btn-outline-secondary:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* ===== Order status modals ===== */
.order-edit-page .modal-dialog .modal-content,
.order-edit-tab-content .modal-dialog .modal-content,
.order-edit-sidebar .modal-dialog .modal-content,
.modal[id$="_modal"] .modal-content,
.order-status-modal {
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    box-shadow: var(--shadow-md) !important;
    overflow: hidden;
}

.order-edit-page .modal-dialog .modal-header,
.order-edit-page .modal-dialog .modal-body,
.order-edit-page .modal-dialog .modal-footer,
.order-edit-tab-content .modal-dialog .modal-header,
.order-edit-tab-content .modal-dialog .modal-body,
.order-edit-tab-content .modal-dialog .modal-footer,
.order-edit-sidebar .modal-dialog .modal-header,
.order-edit-sidebar .modal-dialog .modal-body,
.order-edit-sidebar .modal-dialog .modal-footer,
.modal[id$="_modal"] .modal-header,
.modal[id$="_modal"] .modal-body,
.modal[id$="_modal"] .modal-footer,
.order-status-modal .modal-header,
.order-status-modal .modal-body,
.order-status-modal .modal-footer {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.order-edit-page .modal-dialog .modal-header,
.order-edit-tab-content .modal-dialog .modal-header,
.order-edit-sidebar .modal-dialog .modal-header,
.modal[id$="_modal"] .modal-header,
.order-status-modal .modal-header {
    padding-top: 18px !important;
    padding-bottom: 10px !important;
    align-items: flex-start !important;
    border-bottom: 0 !important;
}

.order-edit-page .modal-dialog .modal-title,
.order-edit-tab-content .modal-dialog .modal-title,
.order-edit-sidebar .modal-dialog .modal-title,
.modal[id$="_modal"] .modal-title,
.order-status-modal .modal-title {
    font-size: 20px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    color: var(--text) !important;
}

.order-edit-page .modal-dialog .modal-header .text-muted,
.order-edit-tab-content .modal-dialog .modal-header .text-muted,
.order-edit-sidebar .modal-dialog .modal-header .text-muted,
.modal[id$="_modal"] .modal-header .text-muted,
.order-status-modal .modal-header .text-muted {
    font-size: 13px !important;
    line-height: 1.45 !important;
    color: var(--text-muted) !important;
}

.order-edit-page .modal-dialog .close,
.order-edit-tab-content .modal-dialog .close,
.order-edit-sidebar .modal-dialog .close,
.modal[id$="_modal"] .close,
.order-status-modal .close {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 10px;
    background: #f8fafc !important;
    border: 1px solid var(--border) !important;
    color: #64748b !important;
    opacity: 1 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

.order-edit-page .modal-dialog .close:hover,
.order-edit-tab-content .modal-dialog .close:hover,
.order-edit-sidebar .modal-dialog .close:hover,
.modal[id$="_modal"] .close:hover,
.order-status-modal .close:hover {
    background: #eef3ff !important;
    border-color: #c7d2fe !important;
    color: #3347a9 !important;
}



.order-edit-page .modal-dialog .modal-body,
.order-edit-tab-content .modal-dialog .modal-body,
.order-edit-sidebar .modal-dialog .modal-body,
.modal[id$="_modal"] .modal-body,
.order-status-modal .modal-body {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.order-edit-page .modal-dialog select,
.order-edit-page .modal-dialog select.form-control,
.order-edit-page .modal-dialog .custom-select,
.order-edit-tab-content .modal-dialog select,
.order-edit-tab-content .modal-dialog select.form-control,
.order-edit-tab-content .modal-dialog .custom-select,
.order-edit-sidebar .modal-dialog select,
.order-edit-sidebar .modal-dialog select.form-control,
.order-edit-sidebar .modal-dialog .custom-select,
.modal[id$="_modal"] select,
.modal[id$="_modal"] select.form-control,
.modal[id$="_modal"] .custom-select,
.order-status-modal select,
.order-status-modal select.form-control,
.order-status-modal .custom-select {
    display: block !important;
    width: 100% !important;
    min-height: 52px !important;
    height: auto !important;
    padding: 14px 38px 14px 14px !important;
    line-height: 1.2 !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    background-position: right 14px center !important;
    background-repeat: no-repeat !important;
    vertical-align: middle !important;
}

.order-edit-page .modal-dialog .select2-container .select2-selection--single,
.order-edit-tab-content .modal-dialog .select2-container .select2-selection--single,
.order-edit-sidebar .modal-dialog .select2-container .select2-selection--single,
.modal[id$="_modal"] .select2-container .select2-selection--single,
.order-status-modal .select2-container .select2-selection--single,
.order-edit-page .modal-dialog .select2-container--default .select2-selection--single,
.order-edit-tab-content .modal-dialog .select2-container--default .select2-selection--single,
.order-edit-sidebar .modal-dialog .select2-container--default .select2-selection--single,
.modal[id$="_modal"] .select2-container--default .select2-selection--single,
.order-status-modal .select2-container--default .select2-selection--single {
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 !important;
    border-radius: 14px !important;
}

.order-edit-page .modal-dialog .select2-container--default .select2-selection--single .select2-selection__rendered,
.order-edit-tab-content .modal-dialog .select2-container--default .select2-selection--single .select2-selection__rendered,
.order-edit-sidebar .modal-dialog .select2-container--default .select2-selection--single .select2-selection__rendered,
.modal[id$="_modal"] .select2-container--default .select2-selection--single .select2-selection__rendered,
.order-status-modal .select2-container--default .select2-selection--single .select2-selection__rendered,
.order-edit-page .modal-dialog .select2-selection__rendered,
.order-edit-tab-content .modal-dialog .select2-selection__rendered,
.order-edit-sidebar .modal-dialog .select2-selection__rendered,
.modal[id$="_modal"] .select2-selection__rendered,
.order-status-modal .select2-selection__rendered {
    height: 50px !important;
    line-height: 50px !important;
    padding-left: 14px !important;
    padding-right: 40px !important;
    display: block !important;
    box-sizing: border-box !important;
}

.order-edit-page .modal-dialog .select2-container--default .select2-selection--single .select2-selection__arrow,
.order-edit-tab-content .modal-dialog .select2-container--default .select2-selection--single .select2-selection__arrow,
.order-edit-sidebar .modal-dialog .select2-container--default .select2-selection--single .select2-selection__arrow,
.modal[id$="_modal"] .select2-container--default .select2-selection--single .select2-selection__arrow,
.order-status-modal .select2-container--default .select2-selection--single .select2-selection__arrow,
.order-edit-page .modal-dialog .select2-selection__arrow,
.order-edit-tab-content .modal-dialog .select2-selection__arrow,
.order-edit-sidebar .modal-dialog .select2-selection__arrow,
.modal[id$="_modal"] .select2-selection__arrow,
.order-status-modal .select2-selection__arrow {
    height: 52px !important;
    right: 10px !important;
    top: 0 !important;
}

.order-edit-page .modal-dialog .alert,
.order-edit-tab-content .modal-dialog .alert,
.order-edit-sidebar .modal-dialog .alert,
.modal[id$="_modal"] .alert,
.order-status-modal .alert {
    margin-bottom: 0 !important;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    border-width: 1px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
}

.order-edit-page .modal-dialog .alert-warning,
.order-edit-tab-content .modal-dialog .alert-warning,
.order-edit-sidebar .modal-dialog .alert-warning,
.modal[id$="_modal"] .alert-warning,
.order-status-modal .alert-warning {
    background: #fff8eb !important;
    border-color: #fde7c2 !important;
    color: #9a6700 !important;
}

.order-edit-page .modal-dialog .alert-light,
.order-edit-tab-content .modal-dialog .alert-light,
.order-edit-sidebar .modal-dialog .alert-light,
.modal[id$="_modal"] .alert-light,
.order-status-modal .alert-light {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}

.order-edit-page .modal-dialog .alert ul,
.order-edit-tab-content .modal-dialog .alert ul,
.order-edit-sidebar .modal-dialog .alert ul,
.modal[id$="_modal"] .alert ul,
.order-status-modal .alert ul {
    margin: 0 !important;
}

.order-edit-page .modal-dialog .alert li + li,
.order-edit-tab-content .modal-dialog .alert li + li,
.order-edit-sidebar .modal-dialog .alert li + li,
.modal[id$="_modal"] .alert li + li,
.order-status-modal .alert li + li {
    margin-top: 4px;
}

.order-edit-page .modal-dialog .modal-footer,
.order-edit-tab-content .modal-dialog .modal-footer,
.order-edit-sidebar .modal-dialog .modal-footer,
.modal[id$="_modal"] .modal-footer,
.order-status-modal .modal-footer {
    padding-top: 10px !important;
    padding-bottom: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px;
    border-top: 0 !important;
}

.order-edit-page .modal-dialog .modal-footer form,
.order-edit-tab-content .modal-dialog .modal-footer form,
.order-edit-sidebar .modal-dialog .modal-footer form,
.modal[id$="_modal"] .modal-footer form,
.order-status-modal .modal-footer .change-status-form {
    margin: 0 !important;
}

.order-edit-page .modal-dialog .modal-footer .btn,
.order-edit-tab-content .modal-dialog .modal-footer .btn,
.order-edit-sidebar .modal-dialog .modal-footer .btn,
.modal[id$="_modal"] .modal-footer .btn,
.order-status-modal .modal-footer .btn {
    min-height: 44px !important;
    padding: 0 18px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}

.order-edit-page .modal-dialog .modal-footer .btn-light,
.order-edit-tab-content .modal-dialog .modal-footer .btn-light,
.order-edit-sidebar .modal-dialog .modal-footer .btn-light,
.modal[id$="_modal"] .modal-footer .btn-light,
.order-status-modal .modal-footer .btn-light {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}

.order-edit-page .modal-dialog .modal-footer .btn-light:hover,
.order-edit-tab-content .modal-dialog .modal-footer .btn-light:hover,
.order-edit-sidebar .modal-dialog .modal-footer .btn-light:hover,
.modal[id$="_modal"] .modal-footer .btn-light:hover,
.order-status-modal .modal-footer .btn-light:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

@media (max-width: 576px) {
    .order-edit-page .modal-dialog .modal-header,
    .order-edit-page .modal-dialog .modal-body,
    .order-edit-page .modal-dialog .modal-footer,
    .order-edit-tab-content .modal-dialog .modal-header,
    .order-edit-tab-content .modal-dialog .modal-body,
    .order-edit-tab-content .modal-dialog .modal-footer,
    .order-edit-sidebar .modal-dialog .modal-header,
    .order-edit-sidebar .modal-dialog .modal-body,
    .order-edit-sidebar .modal-dialog .modal-footer,
    .modal[id$="_modal"] .modal-header,
    .modal[id$="_modal"] .modal-body,
    .modal[id$="_modal"] .modal-footer,
    .order-status-modal .modal-header,
    .order-status-modal .modal-body,
    .order-status-modal .modal-footer {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .order-edit-page .modal-dialog .modal-title,
    .order-edit-tab-content .modal-dialog .modal-title,
    .order-edit-sidebar .modal-dialog .modal-title,
    .modal[id$="_modal"] .modal-title,
    .order-status-modal .modal-title {
        font-size: 18px !important;
    }

    .order-edit-page .modal-dialog .modal-footer,
    .order-edit-tab-content .modal-dialog .modal-footer,
    .order-edit-sidebar .modal-dialog .modal-footer,
    .modal[id$="_modal"] .modal-footer,
    .order-status-modal .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch !important;
    }

    .order-edit-page .modal-dialog .modal-footer .btn,
    .order-edit-page .modal-dialog .modal-footer form,
    .order-edit-page .modal-dialog .modal-footer form .btn,
    .order-edit-tab-content .modal-dialog .modal-footer .btn,
    .order-edit-tab-content .modal-dialog .modal-footer form,
    .order-edit-tab-content .modal-dialog .modal-footer form .btn,
    .order-edit-sidebar .modal-dialog .modal-footer .btn,
    .order-edit-sidebar .modal-dialog .modal-footer form,
    .order-edit-sidebar .modal-dialog .modal-footer form .btn,
    .modal[id$="_modal"] .modal-footer .btn,
    .modal[id$="_modal"] .modal-footer form,
    .modal[id$="_modal"] .modal-footer form .btn,
    .order-status-modal .modal-footer .btn,
    .order-status-modal .modal-footer .change-status-form,
    .order-status-modal .modal-footer .change-status-form .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .order-edit-status-card {
        gap: 10px;
    }

    .order-edit-status-card__summary {
        padding: 12px 14px;
    }

    .order-edit-status-card__flow {
        padding: 12px 14px;
    }

    .order-edit-status-card__flow-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .order-edit-status-card__flow-list::before {
        display: none;
    }

    .order-edit-status-card__flow-step {
        min-height: auto;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        padding: 0;
    }

    .order-edit-status-card__flow-step::before {
        box-shadow: none;
    }

    .order-edit-status-card .btn {
        min-height: 42px !important;
    }
}

/* ===== Order chat (Telegram-style bubbles) ===== */

.order-chat-tabs {
    margin-bottom: 8px !important;
    border-bottom: 0 !important;
    gap: 6px;
    padding: 2px;
}

.order-chat-tabs .nav-item {
    margin-bottom: 0 !important;
}

.order-chat-tabs .nav-link {
    min-height: 34px;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #668094 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 7px 14px !important;
    box-shadow: none !important;
}

.order-chat-tabs .nav-link:hover {
    color: #1d3b53 !important;
    background: #eef6fb !important;
}

.order-chat-tabs .nav-link.active,
.order-chat-tabs .nav-item.show .nav-link {
    background: #e0f0fa !important;
    color: #168acd !important;
    box-shadow: inset 0 0 0 1px rgba(83, 151, 194, 0.18) !important;
}

.order-chat-content {
    margin-top: 0 !important;
}

/* ===== Chat thread / bubbles ===== */

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-scroll {
    height: clamp(260px, 38vh, 390px);
    min-height: 260px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #dbe7f0;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
    scrollbar-color: rgba(73, 116, 143, 0.36) transparent;
}

.chat-scroll::-webkit-scrollbar {
    width: 8px;
}

.chat-scroll::-webkit-scrollbar-thumb {
    background: rgba(73, 116, 143, 0.32);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.chat-bubbles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.chat-bubble {
    position: relative;
    width: fit-content;
    min-width: 92px;
    max-width: min(76%, 560px);
    padding: 7px 9px 5px;
    border-radius: 17px;
    box-shadow: 0 1px 1px rgba(22, 55, 76, 0.14);
    font-size: 14px;
    line-height: 1.36;
    color: #10202d;
    overflow-wrap: anywhere;
    word-break: normal;
    animation: chatBubbleIn 0.16s ease;
}

@keyframes chatBubbleIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble--other {
    align-self: flex-start;
    margin-left: 8px;
    background: #f6f8fb;
    border: 1px solid #e4ebf2;
    border-bottom-left-radius: 5px;
}

.chat-bubble--other::after {
    content: "";
    position: absolute;
    left: -7px;
    bottom: 0;
    width: 14px;
    height: 14px;
    background: #f6f8fb;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.chat-bubble--mine {
    align-self: flex-end;
    margin-right: 8px;
    background: #d9fdd3;
    border-bottom-right-radius: 5px;
}

.chat-bubble--mine::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: 0;
    width: 14px;
    height: 14px;
    background: #d9fdd3;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.chat-bubble--empty {
    align-self: center;
    min-width: 0;
    max-width: 100%;
    margin: 12px 0;
    padding: 7px 12px;
    background: rgba(70, 96, 116, 0.42);
    border-radius: 999px;
    box-shadow: none;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.chat-bubble--empty::after {
    content: none;
}

.chat-bubble__identity {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    margin: 0 24px 5px 0;
}

.chat-bubble--mine .chat-bubble__identity {
    justify-content: flex-end;
    margin-right: 0;
    margin-left: 24px;
}

.chat-bubble__avatar {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: #e8eef7;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.chat-bubble__author {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #168acd;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

.chat-bubble--mine .chat-bubble__author {
    color: #3f8a46;
}

.chat-bubble__text {
    white-space: pre-wrap;
}

.chat-bubble__meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    min-height: 14px;
    margin-top: 2px;
    margin-left: 36px;
    color: #6f8a9b;
    font-size: 10.5px;
    line-height: 1;
    white-space: nowrap;
}

.chat-bubble--mine .chat-bubble__meta {
    color: #4f9250;
}

.chat-bubble__time {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: nowrap;
}

.chat-bubble__meta .fa-check-double {
    color: #3aa7e8;
    font-size: 10px;
}

.chat-bubble__gallery {
    display: grid;
    gap: 4px;
    margin-top: 6px;
}

.chat-bubble__gallery:has(.chat-bubble__media:only-child) {
    grid-template-columns: minmax(0, 270px);
}

.chat-bubble__gallery:not(:has(.chat-bubble__media:only-child)) {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
}

.chat-bubble__media {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    background: rgba(0, 0, 0, 0.04);
}

.chat-bubble__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.18s ease;
}

.chat-bubble__media:hover img {
    transform: scale(1.04);
}

.chat-bubble__file {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 12px;
    background: rgba(21, 83, 122, 0.08);
    color: inherit !important;
    font-size: 12px;
    text-decoration: none !important;
}

.chat-bubble__file i {
    color: #168acd;
}

.chat-bubble--mine .chat-bubble__file {
    background: rgba(72, 145, 64, 0.1);
}

/* ===== Chat composer ===== */

.chat-composer-form {
    width: 100%;
}

.chat-composer__previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 54px 8px 58px;
}

.chat-composer__previews:empty {
    margin-bottom: 0;
}

.chat-composer-author {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin: 2px 54px 8px 58px;
    color: #5f7487;
}

.chat-composer-author__avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #e8eef7;
    box-shadow: 0 0 0 1px rgba(203, 219, 231, 0.9);
}

.chat-composer-author__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.chat-composer-author__text span {
    color: #7f91a4;
    font-size: 11px;
    font-weight: 700;
}

.chat-composer-author__text strong {
    max-width: 260px;
    overflow: hidden;
    color: #1f3347;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-preview {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #c8dde9;
    background: #fff;
}

.chat-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-preview__remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
}

.chat-composer {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.chat-composer__attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 50px;
    height: 50px;
    margin: 0 !important;
    border-radius: 50%;
    background: #25282d;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
    font-size: 22px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.chat-composer__attach:hover {
    background: #30343b;
    color: #fff;
    transform: translateY(-1px);
}

.chat-composer__message {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: end;
    min-width: 0;
    min-height: 50px;
    padding: 0 5px 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 25px;
    background: #25282d;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 12px rgba(15, 23, 42, 0.14);
}

.chat-composer__input {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 50px !important;
    height: auto !important;
    max-height: 132px !important;
    padding: 14px 0 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    resize: none !important;
    color: #f8fafc !important;
    font-size: 15px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.35 !important;
    overflow-y: hidden;
    appearance: none;
    -webkit-appearance: none;
    caret-color: #4d96ff;
}

.chat-composer__input::placeholder {
    color: #9aa0a9;
}

.chat-composer__input:focus {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.chat-composer__message:focus-within {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 3px rgba(77, 150, 255, 0.18);
}

.chat-composer__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: end;
    width: 40px;
    height: 40px;
    margin: 5px 0;
    padding: 0 2px 1px 0;
    border: 0;
    border-radius: 50%;
    background: #4d96ff;
    color: #fff;
    cursor: pointer;
    box-shadow: none;
    font-size: 17px;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.chat-composer__send:hover:not(:disabled) {
    background: #3b82f6;
    transform: translateY(-1px);
}

.chat-composer__send:disabled {
    opacity: 0.46;
    cursor: not-allowed;
    box-shadow: none;
}

.chat-composer__send.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== Chat lightbox ===== */

.chat-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.9);
}

.chat-lightbox.is-open {
    display: flex;
}

.chat-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.chat-lightbox__close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.chat-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 768px) {
    .order-chat-tabs {
        flex-wrap: wrap;
    }

    .chat-scroll {
        height: 36vh;
        min-height: 240px;
        padding: 12px;
        border-radius: 14px;
    }

    .chat-bubble {
        max-width: calc(100% - 42px);
    }

    .chat-bubble__gallery:not(:has(.chat-bubble__media:only-child)) {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .chat-composer {
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 7px;
    }

    .chat-composer__attach {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .chat-composer__message {
        grid-template-columns: minmax(0, 1fr) 40px;
        min-height: 44px;
        border-radius: 22px;
    }

    .chat-composer__input {
        min-height: 44px !important;
        padding: 12px 0 10px !important;
        font-size: 15px !important;
    }

    .chat-composer__send {
        width: 36px;
        height: 36px;
        margin: 4px 0;
        font-size: 15px;
    }

    .chat-composer__previews {
        margin-right: 0;
        margin-left: 44px;
    }

    .chat-composer-author {
        margin-right: 0;
        margin-left: 51px;
    }

    .chat-composer-author__text strong {
        max-width: 190px;
    }
}

/* ===== Order details formset ===== */

.order-details-formset {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-details-formset__items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-details-formset__actions {
    margin-top: 2px !important;
    padding-top: 14px !important;
}

.order-detail-item {
    padding: 14px 16px !important;
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    box-shadow: var(--shadow-sm) !important;
}

.order-detail-item__row {
    align-items: flex-end;
    row-gap: 10px;
}

.order-detail-item__field .form-group {
    margin-bottom: 0 !important;
}

.order-detail-item__remove-col {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.order-detail-item__remove-btn {
    min-height: 42px !important;
    white-space: nowrap;
}

.order-detail-item__remove-btn i {
    margin-right: 6px;
}

@media (max-width: 991px) {
    .order-detail-item__remove-col {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .order-detail-item {
        padding: 14px !important;
    }

    .order-detail-item__remove-btn {
        width: 100%;
    }
}

/* ===== Order chat polish ===== */

.order-chat-form-wrap {
    margin-top: 6px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.order-chat-message__author {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.order-chat-message__author b {
    margin: 0;
}

.order-chat-message--empty {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--text-muted) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    background: #f8fafc !important;
}

.order-chat-form .form-group:last-child {
    margin-bottom: 0 !important;
}

.order-chat-form .form-control,
.order-chat-form textarea,
.order-chat-form input[type="text"],
.order-chat-form input[type="file"],
.order-chat-form select {
    background: #ffffff !important;
}

.order-chat-form textarea {
    min-height: 120px !important;
}

.order-chat-form .helptext,
.order-chat-form small,
.order-chat-form .text-muted {
    color: var(--text-muted) !important;
    font-size: 12px !important;
}

.order-chat-form__actions .filter-actions__right {
    margin-left: auto;
}

.order-chat-message__files p {
    margin: 0 !important;
}

.order-chat-message__files a {
    display: inline-block;
}

.order-chat-card + .order-chat-form-wrap {
    margin-top: 10px;
}

.order-chat-pane__meta {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.order-chat-card .list-group-item:last-child {
    border-bottom: 0 !important;
}

@media (max-width: 768px) {
    .order-chat-form-wrap {
        padding: 14px;
    }

    .order-chat-message__file-link {
        width: 100%;
        justify-content: flex-start;
    }

    .order-chat-form__actions .filter-actions__right,
    .order-chat-form__actions .btn {
        width: 100%;
    }
}
/* ===== Order create / edit form card ===== */

.order-create-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 18px 20px !important;
}

.order-edit-work-card {
    gap: 14px;
}

.order-edit-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-edit-form > script {
    display: none;
}

.order-create-card .order-edit-section:first-child {
    padding-top: 0 !important;
    border-top: 0 !important;
}

.order-create-card .order-edit-jump-nav + .order-edit-section {
    padding-top: 0 !important;
    border-top: 0 !important;
}

.order-edit-work-card .order-edit-section,
.order-edit-work-card .order-edit-section:first-child,
.order-edit-work-card .order-edit-jump-nav + .order-edit-section {
    padding: 16px !important;
    border: 1px solid #e7edf6 !important;
    border-radius: 14px !important;
    background: #fbfdff !important;
}

.order-edit-work-card .order-edit-section + .order-edit-section {
    margin-top: 0;
}

.order-edit-work-card .order-edit-section__head {
    margin-bottom: 12px;
}

.order-edit-work-card .order-edit-section__title {
    font-size: 16px !important;
}

.order-edit-work-card .order-edit-grid .form-group {
    margin-bottom: 10px !important;
}

.order-edit-work-card .order-edit-device-layout {
    margin-left: -10px;
    margin-right: -10px;
}

.order-edit-work-card .order-edit-device-layout > [class*="col-"] {
    padding-left: 10px !important;
    padding-right: 10px !important;
}

.order-edit-section--notes textarea,
.order-edit-section--financial textarea {
    min-height: 92px !important;
}

.order-create-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
}

.order-edit-work-card .order-create-actions {
    margin-top: 0;
    padding-top: 14px;
}

.order-create-save-btn {
    min-height: 44px !important;
    min-width: 180px !important;
}

.order-create-card .order-details-formset__actions {
    padding-top: 16px !important;
}

.order-create-card .order-edit-section--details {
    margin-bottom: 0 !important;
}

.order-edit-financial-actions,
.order-edit-work-card .order-edit-financial-actions {
    margin-top: 0;
}

.order-edit-finance-only-card {
    margin-top: 14px;
}

.order-edit-financial-actions__section {
    padding: 0 !important;
}

.order-edit-financial-actions__summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.order-edit-financial-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.order-edit-financial-list__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 30px;
}

.order-edit-financial-list__head h6 {
    margin: 0 !important;
    color: var(--text) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
}

.order-edit-financial-list__head span {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.order-edit-financial-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e7edf6;
    border-radius: 12px;
    background: #ffffff;
}

.order-edit-financial-item__main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.order-edit-financial-item__main strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.order-edit-financial-item__main span {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.order-edit-financial-item__main small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.order-edit-financial-item__main p {
    margin: 4px 0 0 !important;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.order-edit-financial-item__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.order-edit-financial-item__actions form {
    margin: 0 !important;
}

.order-edit-financial-item__actions .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap;
}

.order-edit-financial-item__actions .btn i {
    margin-right: 0;
}

.order-edit-financial-list__empty {
    padding: 12px 14px;
    border: 1px dashed #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.order-edit-financial-actions__title {
    margin: 0 0 12px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    color: var(--text) !important;
}

.order-edit-financial-actions .btn {
    min-height: 42px !important;
}

.order-edit-financial-actions .btn i {
    margin-right: 6px;
}

.order-edit-inline-delete-form {
    display: inline;
}

.order-detail-item__cost-input {
    cursor: default !important;
}

/* ===== External service shipments ===== */

.shipment-page-head {
    align-items: flex-start;
}

.shipment-page-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.shipment-page-head__meta span {
    position: relative;
}

.shipment-page-head__meta span:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -10px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #cbd5e1;
    transform: translateY(-50%);
}

.shipment-list-card,
.shipment-info-card,
.shipment-form-card {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-sm) !important;
}

.shipment-list-card {
    padding: 0;
    overflow: hidden;
}

.shipment-table {
    width: 100%;
    margin-bottom: 0 !important;
    background: #ffffff;
}

.shipment-table thead th {
    padding: 14px 18px !important;
    border-top: 0 !important;
    border-bottom: 1px solid #e7edf6 !important;
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
}

.shipment-table tbody td {
    padding: 16px 18px !important;
    border-top: 1px solid #eef2f7 !important;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    vertical-align: middle !important;
}

.shipment-table tbody tr:first-child td {
    border-top: 0 !important;
}

.shipment-table tbody tr:hover td {
    background: #fbfdff !important;
}

.shipment-table td small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.shipment-table__date,
.shipment-table__service {
    color: var(--text) !important;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none !important;
}

.shipment-table__service:hover {
    color: var(--primary) !important;
}

.shipment-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #eef3ff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.shipment-progress-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.shipment-progress-summary small {
    margin-top: 0 !important;
}

.shipment-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.shipment-overview-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 126px;
    padding: 18px 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.shipment-overview-card--work {
    border-color: #fed7aa;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 74%);
}

.shipment-overview-card--returned {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 74%);
}

.shipment-overview-card--shipments {
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 74%);
}

.shipment-overview-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 19px;
}

.shipment-overview-card--work .shipment-overview-card__icon {
    background: #ffedd5;
    color: #c2410c;
}

.shipment-overview-card--returned .shipment-overview-card__icon {
    background: #dcfce7;
    color: #15803d;
}

.shipment-overview-card--shipments .shipment-overview-card__icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.shipment-overview-card__label,
.shipment-overview-card strong,
.shipment-overview-card small {
    display: block;
}

.shipment-overview-card__label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shipment-overview-card strong {
    margin-top: 4px;
    color: var(--text);
    font-size: 29px;
    font-weight: 900;
    line-height: 1;
}

.shipment-overview-card small {
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.shipment-list-section__head {
    min-height: 76px;
    padding: 14px 18px;
}

.shipment-list-section__head h2 {
    margin: 0 !important;
    color: var(--text) !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
}

.shipment-list-section__head p {
    margin: 5px 0 0 !important;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.shipment-list-section--completed .shipment-list-section__head {
    background: #f7fdf9;
}

.shipment-count-badge--work {
    border-color: #fed7aa;
    background: #ffedd5;
    color: #c2410c;
}

.shipment-count-badge--returned {
    border-color: #bbf7d0;
    background: #dcfce7;
    color: #15803d;
}

.shipment-list-table th:nth-child(1) {
    width: 165px;
}

.shipment-list-table th:nth-child(3) {
    width: 360px;
}

.shipment-list-table th:nth-child(4) {
    width: 150px;
}

.shipment-list-table th:nth-child(5) {
    width: 110px;
}

.shipment-list-row--completed td {
    background: #fbfefc;
}

.shipment-list-row--completed:hover td {
    background: #f3fbf6 !important;
}

.shipment-list-row--empty td {
    background: #fffdf7;
}

.shipment-device-progress {
    display: grid;
    gap: 9px;
}

.shipment-device-progress__head,
.shipment-device-counts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.shipment-device-progress__head {
    justify-content: space-between;
}

.shipment-state,
.shipment-device-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.shipment-state {
    padding: 0 10px;
}

.shipment-state--active {
    border-color: #fed7aa;
    background: #ffedd5;
    color: #c2410c;
}

.shipment-state--completed {
    border-color: #bbf7d0;
    background: #dcfce7;
    color: #15803d;
}

.shipment-state--empty {
    border-color: #e2e8f0;
    background: #f1f5f9;
    color: #64748b;
}

.shipment-device-progress__total {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.shipment-device-count {
    gap: 5px;
    padding: 0 10px;
}

.shipment-device-count strong {
    font-size: 14px;
    font-weight: 900;
}

.shipment-device-count--work {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.shipment-device-count--returned {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.shipment-device-progress__bar {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #ffedd5;
}

.shipment-device-progress__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #22c55e;
}

.shipment-device-progress__percent {
    margin-top: -4px !important;
    color: var(--text-muted) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
}

.shipment-device-progress__empty {
    padding: 10px 12px;
    border: 1px dashed #f59e0b;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.shipment-empty-state--compact {
    min-height: 190px;
}

.shipment-result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shipment-outbound-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #e7edf6;
}

.shipment-save-outbound-form {
    display: flex;
    justify-content: flex-end;
    padding: 14px 18px 18px;
    border-top: 1px solid #e7edf6;
}

.shipment-save-outbound-form .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.shipment-return-status--returned {
    background: #dcfce7;
    color: #166534;
}

.shipment-return-status--work {
    background: #f1f5f9;
    color: #475569;
}

.shipment-return-select {
    width: 150px !important;
    min-height: 34px !important;
    margin-top: 8px;
    padding: 5px 10px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.shipment-table__actions {
    text-align: right;
    white-space: nowrap;
}

.shipment-table__actions .btn,
.shipment-page-head__actions .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.shipment-empty-state {
    margin: 0;
    border: 0;
    box-shadow: none;
}

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

.shipment-summary-card {
    min-height: 96px;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.shipment-summary-card__label {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.shipment-summary-card strong,
.shipment-summary-card span,
.shipment-summary-card a {
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
}

.shipment-summary-card a {
    color: var(--primary) !important;
    font-size: 16px;
}

.shipment-info-card {
    margin-bottom: 14px;
    padding: 18px 20px;
}

.shipment-info-card h5,
.shipment-section-head h5 {
    margin: 0 !important;
    color: var(--text) !important;
    font-size: 16px !important;
    font-weight: 800 !important;
}

.shipment-info-card p {
    margin: 10px 0 0 !important;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
}

.shipment-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 18px;
    border-bottom: 1px solid #e7edf6;
    background: #ffffff;
}

.shipment-table--items tbody td {
    vertical-align: top !important;
}

.shipment-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shipment-form-card {
    padding: 18px 20px !important;
}

.shipment-form-card .form-group {
    margin-bottom: 14px !important;
}

.shipment-form-card label,
.shipment-form-card .control-label {
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    margin-bottom: 5px !important;
}

.shipment-form-card .form-control,
.shipment-form-card input,
.shipment-form-card select,
.shipment-form-card textarea {
    background: #ffffff !important;
}

.shipment-form-card .help-block,
.shipment-form-card .helptext,
.shipment-form-card small {
    color: var(--text-muted) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* ===== Fast salary calculation ===== */

.fast-salary-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fast-salary-page-head {
    margin-bottom: 0 !important;
}

.fast-salary-form-card textarea {
    min-height: 220px;
    color: var(--text) !important;
    font-weight: 700;
}

.fast-salary-preview-card {
    overflow: hidden;
}

.fast-salary-apply-form {
    display: flex;
    justify-content: flex-end;
    padding: 14px 18px;
    border-top: 1px solid #e7edf6;
    background: #ffffff;
}

.fast-salary-table td {
    white-space: nowrap;
}

.fast-salary-sheet-card {
    margin-bottom: 14px;
}

.fast-salary-sheet-head span {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.fast-salary-sheet-scroll {
    border-bottom: 1px solid #e7edf6;
}

.fast-salary-excel-table,
.fast-salary-summary-table {
    margin-bottom: 0 !important;
    background: #ffffff;
}

.fast-salary-excel-table {
    min-width: 1020px;
}

.fast-salary-excel-table th,
.fast-salary-summary-table th {
    padding: 10px 12px !important;
    border: 1px solid #dbe3ee !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

.fast-salary-excel-table td,
.fast-salary-summary-table td {
    padding: 9px 12px !important;
    border: 1px solid #e7edf6 !important;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    vertical-align: middle !important;
    white-space: nowrap;
}

.fast-salary-excel-table tfoot th,
.fast-salary-summary-table tfoot th {
    background: #eef3ff !important;
    color: var(--text) !important;
}

.fast-salary-excel-table a {
    color: var(--primary) !important;
    font-weight: 800;
    text-decoration: none !important;
}

.fast-salary-excel-table small,
.fast-salary-summary-table small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.fast-salary-excel-table__number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fast-salary-summary-wrap {
    max-width: 720px;
    padding: 16px 18px;
    overflow-x: auto;
}

.fast-salary-summary-table {
    border: 1px solid #dbe3ee;
}

.fast-salary-history-detail-row td {
    padding-top: 0 !important;
    border-top: 0 !important;
}

.fast-salary-history-detail-row:hover td {
    background: #ffffff !important;
}

.fast-salary-details summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.fast-salary-details summary::before {
    content: "\f0ca";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.fast-salary-details summary::-webkit-details-marker {
    display: none;
}

.fast-salary-details[open] summary {
    margin-bottom: 12px;
}

.fast-salary-items {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #e7edf6;
    border-radius: 8px;
    background: #ffffff;
}

.fast-salary-items-table {
    min-width: 760px;
    margin-bottom: 0 !important;
}

.fast-salary-items-table thead th {
    padding: 10px 12px !important;
    border-top: 0 !important;
    border-bottom: 1px solid #e7edf6 !important;
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
}

.fast-salary-items-table tbody td {
    padding: 11px 12px !important;
    border-top: 1px solid #eef2f7 !important;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    vertical-align: top !important;
}

.fast-salary-items-table tbody tr:first-child td {
    border-top: 0 !important;
}

.fast-salary-items-table small {
    display: block;
    margin-top: 3px;
    max-width: 260px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: normal;
}

.shipment-orders-source,
.shipment-pdf-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.shipment-pdf-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.shipment-pdf-button,
.shipment-pdf-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    text-decoration: none !important;
}

.shipment-pdf-button {
    border: 1px solid #263b61;
    background: #263b61;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(38, 59, 97, 0.18);
}

.shipment-form-card .shipment-pdf-button,
.shipment-form-card .shipment-pdf-button i,
.shipment-form-card .shipment-pdf-button span {
    color: #ffffff !important;
}

.shipment-pdf-button:hover {
    background: #1f3152;
    border-color: #1f3152;
}

.shipment-pdf-link {
    border: 1px solid #dbe3ee;
    background: #ffffff;
    color: var(--text) !important;
}

.shipment-pdf-file {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    min-width: 180px;
    max-width: min(440px, 100%);
    padding: 0 14px;
    border: 1px solid #e7edf6;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shipment-device-picker {
    margin-bottom: 0 !important;
}

.shipment-device-search {
    position: relative;
}

.shipment-device-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    z-index: 2;
    color: #94a3b8;
    transform: translateY(-50%);
}

.shipment-device-search__input,
.shipment-form-card input.shipment-device-search__input {
    min-height: 48px !important;
    padding-left: 44px !important;
}

.shipment-device-results {
    max-height: 310px;
    margin-top: 10px;
    overflow: auto;
    border: 1px solid #e7edf6;
    border-radius: 8px;
    background: #ffffff;
}

.shipment-device-results__empty,
.shipment-selected-empty {
    padding: 13px 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.shipment-device-result,
.shipment-selected-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-top: 1px solid #eef2f7;
}

.shipment-device-result:first-child,
.shipment-selected-row:first-child {
    border-top: 0;
}

.shipment-device-result:hover {
    background: #fbfdff;
}

.shipment-device-result__main,
.shipment-selected-row__main {
    min-width: 0;
}

.shipment-device-result__main strong,
.shipment-selected-row__main strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.shipment-device-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.shipment-device-meta span {
    overflow-wrap: anywhere;
}

.shipment-device-meta strong {
    display: inline !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

.shipment-device-result .btn,
.shipment-selected-row__remove,
.shipment-bulk-panel__head .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

.shipment-device-result .btn {
    min-width: 118px;
}

.shipment-bulk-panel,
.shipment-selected-panel {
    margin-top: 14px;
    border: 1px solid #e7edf6;
    border-radius: 8px;
    background: #f8fafc;
}

.shipment-bulk-panel {
    padding: 14px;
}

.shipment-bulk-panel__head,
.shipment-selected-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.shipment-bulk-panel__head {
    margin-bottom: 10px;
}

.shipment-bulk-panel__head label,
.shipment-selected-panel__head h6 {
    margin: 0 !important;
    color: var(--text) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.shipment-bulk-input {
    min-height: 118px !important;
    resize: vertical;
}

.shipment-bulk-feedback {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 18px;
    margin-top: 8px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.shipment-bulk-feedback small {
    color: #dc2626 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.shipment-selected-panel {
    overflow: hidden;
    background: #ffffff;
}

.shipment-selected-panel__head {
    min-height: 48px;
    padding: 0 14px;
    border-bottom: 1px solid #e7edf6;
    background: #f8fafc;
}

.shipment-selected-panel__head span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #eef3ff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.shipment-selected-list {
    max-height: 430px;
    overflow: auto;
}

.shipment-selected-row__note {
    margin: 6px 0 0 !important;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.shipment-selected-row__remove {
    width: 34px;
    min-width: 34px;
    padding: 0 !important;
}

.shipment-form-actions {
    margin-top: 0;
    padding-top: 14px;
}

@media (max-width: 768px) {
    .order-create-card {
        padding: 16px !important;
    }

    .order-edit-work-card {
        gap: 12px;
    }

    .order-edit-form {
        gap: 12px;
    }

    .order-edit-work-card .order-edit-section,
    .order-edit-work-card .order-edit-section:first-child,
    .order-edit-work-card .order-edit-jump-nav + .order-edit-section {
        padding: 14px !important;
    }

    .order-edit-financial-actions__summary {
        grid-template-columns: 1fr;
    }

    .order-edit-financial-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .order-edit-financial-item__actions,
    .order-edit-financial-item__actions .btn,
    .order-edit-financial-item__actions form {
        width: 100%;
    }

    .shipment-page-head__meta {
        flex-direction: column;
        gap: 5px;
    }

    .shipment-page-head__meta span::after {
        display: none;
    }

    .shipment-detail-grid {
        grid-template-columns: 1fr;
    }

    .shipment-table thead {
        display: none;
    }

    .shipment-table,
    .shipment-table tbody,
    .shipment-table tr,
    .shipment-table td {
        display: block;
        width: 100%;
    }

    .shipment-table tbody td {
        padding: 10px 14px !important;
        border-top: 0 !important;
    }

    .shipment-table tbody tr {
        padding: 8px 0;
        border-top: 1px solid #eef2f7;
    }

    .shipment-table tbody tr:first-child {
        border-top: 0;
    }

    .shipment-table__actions {
        text-align: left;
    }

    .shipment-table__actions .btn,
    .shipment-form-actions .btn,
    .fast-salary-apply-form .btn {
        width: 100%;
    }

    .fast-salary-table td {
        white-space: normal;
    }

    .fast-salary-history-detail-row,
    .fast-salary-history-detail-row td,
    .fast-salary-details,
    .fast-salary-items,
    .fast-salary-items-table,
    .fast-salary-items-table tbody,
    .fast-salary-items-table tr,
    .fast-salary-items-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .fast-salary-history-card .fast-salary-history-table {
        min-width: 0 !important;
    }

    .fast-salary-items-table thead {
        display: none;
    }

    .fast-salary-items .fast-salary-items-table {
        min-width: 0 !important;
    }

    .fast-salary-items-table tbody td {
        padding: 8px 10px !important;
        border-top: 0 !important;
    }

    .fast-salary-items-table tbody tr {
        padding: 8px 0;
        border-top: 1px solid #eef2f7;
    }

    .fast-salary-items-table tbody tr:first-child {
        border-top: 0;
    }

    .fast-salary-apply-form {
        justify-content: stretch;
    }

    .shipment-pdf-control,
    .shipment-bulk-panel__head,
    .shipment-selected-panel__head,
    .shipment-device-result,
    .shipment-selected-row {
        align-items: stretch;
        flex-direction: column;
    }

    .shipment-pdf-button,
    .shipment-pdf-link,
    .shipment-pdf-file,
    .shipment-device-result .btn,
    .shipment-bulk-panel__head .btn,
    .shipment-selected-row__remove {
        width: 100%;
    }

    .order-create-actions {
        justify-content: stretch;
    }

    .order-create-save-btn {
        width: 100%;
        min-width: 0 !important;
    }
}

@media (max-width: 1100px) {
    .shipment-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shipment-overview-card--shipments {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .shipment-overview {
        grid-template-columns: 1fr;
    }

    .shipment-list-table {
        min-width: 0 !important;
    }

    .shipment-overview-card--shipments {
        grid-column: auto;
    }

    .shipment-overview-card {
        min-height: 108px;
        padding: 15px 16px;
    }

    .shipment-list-section__head {
        align-items: flex-start;
        gap: 12px;
    }

    .shipment-list-table tbody td {
        position: relative;
        min-height: 40px;
        padding: 9px 14px 9px 128px !important;
    }

    .shipment-list-table tbody td::before {
        content: attr(data-label);
        position: absolute;
        top: 10px;
        left: 14px;
        width: 96px;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .shipment-list-table tbody .shipment-list-table__progress-cell {
        padding: 12px 14px !important;
    }

    .shipment-list-table__progress-cell::before {
        position: static !important;
        display: block;
        width: auto !important;
        margin-bottom: 9px;
    }
}

@media (max-width: 575px) {
    .shipment-list-section__head {
        flex-direction: column;
    }

    .shipment-overview-card {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 11px;
    }

    .shipment-overview-card__icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        font-size: 17px;
    }

    .shipment-overview-card strong {
        font-size: 25px;
    }
}

/* ===== External shipment detail status workflow ===== */

.shipment-detail-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.shipment-detail-overview__card {
    min-height: 112px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.shipment-detail-overview__card--total {
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 76%);
}

.shipment-detail-overview__card--work {
    border-color: #fed7aa;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 76%);
}

.shipment-detail-overview__card--returned {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 76%);
}

.shipment-detail-overview__card span,
.shipment-detail-overview__card strong,
.shipment-detail-overview__card small {
    display: block;
}

.shipment-detail-overview__card span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shipment-detail-overview__card strong {
    margin-top: 7px;
    color: var(--text);
    font-size: 31px;
    font-weight: 900;
    line-height: 1;
}

.shipment-detail-overview__card--work strong {
    color: #c2410c;
}

.shipment-detail-overview__card--returned strong {
    color: #15803d;
}

.shipment-detail-overview__card small {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.shipment-document-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.shipment-document-strip > div {
    min-width: 0;
    min-height: 82px;
    padding: 15px 18px;
}

.shipment-document-strip > div + div {
    border-left: 1px solid var(--border);
}

.shipment-document-strip span,
.shipment-document-strip strong,
.shipment-document-strip a {
    display: block;
}

.shipment-document-strip span {
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shipment-document-strip strong,
.shipment-document-strip a {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.3;
}

.shipment-document-strip a {
    color: var(--primary) !important;
    text-decoration: none !important;
}

.shipment-status-section {
    overflow: hidden;
}

.shipment-status-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.shipment-status-section--work .shipment-status-section__head {
    background: #fffdf8;
}

.shipment-status-section--returned .shipment-status-section__head {
    background: #f7fdf9;
}

.shipment-status-section__title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shipment-status-section__head h2 {
    margin: 0 !important;
    color: var(--text) !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
}

.shipment-status-section__head p {
    margin: 5px 0 0 !important;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.shipment-returned-toggle {
    min-width: 154px;
}

.shipment-returned-toggle i {
    margin-left: 7px;
    transition: transform 0.16s ease;
}

.shipment-returned-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.shipment-work-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.shipment-select-all {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.shipment-select-all input {
    width: 17px;
    height: 17px;
}

.shipment-work-toolbar .btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: 3px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 11px;
    font-weight: 900;
}

.shipment-status-table-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.shipment-status-table {
    min-width: 1160px;
    table-layout: fixed;
}

.shipment-status-table th:nth-child(1) {
    width: 54px;
}

.shipment-status-table th:nth-child(2) {
    width: 112px;
}

.shipment-status-table th:nth-child(3) {
    width: 180px;
}

.shipment-status-table th:nth-child(4) {
    width: 210px;
}

.shipment-status-table th:nth-child(5) {
    width: 180px;
}

.shipment-status-table th:nth-child(7) {
    width: 235px;
}

.shipment-status-table__check-cell {
    text-align: center;
}

.shipment-status-row--work td {
    background: #fffefa;
}

.shipment-status-row--work:hover td {
    background: #fffaf0 !important;
}

.shipment-status-row--returned td {
    background: #fbfefc;
}

.shipment-status-row--returned:hover td {
    background: #f3fbf6 !important;
}

.shipment-item-check {
    position: relative;
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.shipment-item-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.shipment-item-check span {
    width: 19px;
    height: 19px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
}

.shipment-item-check input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 3px #ffffff;
}

.shipment-item-check input:focus + span {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.shipment-snt-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 900;
}

.shipment-snt-position--empty {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 11px;
}

.shipment-status-row__device,
.shipment-status-row__identifier {
    display: block;
    margin-top: 5px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.shipment-status-row__problem {
    color: #334155 !important;
    font-size: 13px !important;
    line-height: 1.45;
}

.shipment-match-status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 11px;
    font-weight: 900;
}

.shipment-match-status--warning {
    background: #fff7ed;
    color: #c2410c;
}

.shipment-return-status {
    gap: 6px;
}

.shipment-return-status--manual {
    background: #dbeafe;
    color: #1d4ed8;
}

.shipment-status-table__action-cell .btn {
    width: 100%;
    margin-top: 10px;
    white-space: normal;
}

.shipment-status-empty {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 112px;
    padding: 22px;
}

.shipment-status-empty i {
    color: #16a34a;
    font-size: 30px;
}

.shipment-status-empty strong,
.shipment-status-empty span {
    display: block;
}

.shipment-status-empty strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
}

.shipment-status-empty span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.shipment-action-modal {
    overflow: hidden;
    border: 0;
    border-radius: 16px;
}

.shipment-action-modal .modal-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.shipment-action-modal .modal-header p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.shipment-action-modal__selection {
    display: grid;
    gap: 8px;
    max-height: 220px;
    margin-bottom: 16px;
    overflow-y: auto;
}

.shipment-action-modal__item {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.shipment-action-modal__item strong,
.shipment-action-modal__item span {
    display: block;
}

.shipment-action-modal__item strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.shipment-action-modal__item span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.shipment-action-modal label {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.shipment-action-modal__warning {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 16px;
    padding: 11px 12px;
    border: 1px solid #fdba74;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
}

.shipment-action-modal__warning[hidden] {
    display: none !important;
}

@media (max-width: 991px) {
    .shipment-document-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shipment-document-strip > div:nth-child(3) {
        border-left: 0;
        border-top: 1px solid var(--border);
    }

    .shipment-document-strip > div:nth-child(4) {
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .shipment-detail-overview {
        grid-template-columns: 1fr;
    }

    .shipment-detail-overview__card {
        min-height: 96px;
    }

    .shipment-status-section__head,
    .shipment-work-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .shipment-returned-toggle,
    .shipment-work-toolbar .btn {
        width: 100%;
    }

    .shipment-status-table {
        min-width: 0 !important;
    }

    .shipment-status-table tbody td {
        position: relative;
        min-height: 42px;
        padding: 10px 14px 10px 132px !important;
    }

    .shipment-status-table tbody td::before {
        content: attr(data-label);
        position: absolute;
        top: 11px;
        left: 14px;
        width: 102px;
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .shipment-status-table tbody .shipment-status-table__check-cell {
        min-height: 34px;
        padding: 8px 14px !important;
        text-align: left;
    }

    .shipment-status-row--returned .shipment-status-table__check-cell {
        display: none;
    }

    .shipment-status-table__check-cell::before {
        display: none;
    }

    .shipment-status-table__action-cell .btn {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .shipment-document-strip {
        grid-template-columns: 1fr;
    }

    .shipment-document-strip > div + div,
    .shipment-document-strip > div:nth-child(4) {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .shipment-status-table tbody td {
        padding-left: 112px !important;
    }

    .shipment-status-table tbody td::before {
        width: 84px;
    }
}

/* ===== Order create page layout ===== */

.order-create-meta {
    margin-bottom: 12px;
}

.order-device-search {
    margin-bottom: 16px !important;
}

.order-device-search__head {
    margin-bottom: 12px;
}

.order-device-search__row {
    align-items: center;
    row-gap: 12px;
}

.order-device-search__actions {
    align-items: center !important;
}

.order-device-search__actions .btn {
    min-height: 42px !important;
}

.order-device-search__loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.order-create-layout {
    align-items: flex-start;
    row-gap: 16px;
}

.order-create-main-section {
    padding-top: 0 !important;
    border-top: 0 !important;
}

.order-create-main-section > .row {
    align-items: flex-start;
}

.order-create-description-section {
    padding-bottom: 0 !important;
}

.order-create-description-section .form-group {
    margin-bottom: 0 !important;
}

.order-create-customer-card {
    height: 100%;
}

.order-create-customer-tabs {
    margin-bottom: 12px !important;
}

.order-create-customer-content .tab-pane {
    margin: 0 !important;
}

.order-create-customer-content .form-group:last-child {
    margin-bottom: 0 !important;
}

@media (max-width: 991px) {
    .order-device-search__actions {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .order-device-search__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

    .order-device-search__actions .btn,
    .order-device-search__loading {
        width: 100%;
        justify-content: center;
    }
}
/* ===== Warranty status badge field ===== */

.warranty-status-field {
    margin-bottom: 14px !important;
}

.warranty-status-field label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
}

.warranty-status-display,
input.warranty-status-display,
.form-control.warranty-status-display {
    height: var(--field-height) !important;
    min-height: var(--field-height) !important;
    padding: 11px 14px !important;
    line-height: 1.2 !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-align-last: center !important;
    letter-spacing: 0.01em;
    cursor: default !important;
    box-shadow: none !important;
}

select[name="warranty"],
select.warranty-status-select,
select[name="warranty"] + .select2 .select2-selection__rendered {
    text-align: center !important;
    text-align-last: center !important;
    -moz-text-align-last: center !important;
}

select[name="warranty"],
select.warranty-status-select {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

select[name="warranty"] + .select2 .select2-selection--single {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

select[name="warranty"] + .select2 .select2-selection__rendered {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.warranty-status-display[readonly],
input.warranty-status-display[readonly],
.form-control.warranty-status-display[readonly] {
    opacity: 1 !important;
    background-image: none !important;
    -webkit-text-fill-color: currentColor !important;
}

.warranty-status-field--active .warranty-status-display,
.warranty-status-field--active input.warranty-status-display,
.warranty-status-field--active .form-control.warranty-status-display,
.warranty-status-field--active .warranty-status-display[readonly] {
    background: #ecfdf3 !important;
    background-color: #ecfdf3 !important;
    border: 1px solid #bbf7d0 !important;
    color: #15803d !important;
    -webkit-text-fill-color: #15803d !important;
}

.warranty-status-field--expired .warranty-status-display,
.warranty-status-field--expired input.warranty-status-display,
.warranty-status-field--expired .form-control.warranty-status-display,
.warranty-status-field--expired .warranty-status-display[readonly] {
    background: #fef2f2 !important;
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
}



.warranty-status-field--unknown .warranty-status-display,
.warranty-status-field--unknown input.warranty-status-display,
.warranty-status-field--unknown .form-control.warranty-status-display,
.warranty-status-field--unknown .warranty-status-display[readonly] {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

/* ===== Warranty select2 status colors ===== */
.select2-container.warranty-status--yes .select2-selection,
.select2-container.warranty-status--yes .select2-selection--single,
.select2-container--default.warranty-status--yes .select2-selection--single {
    background: #ecfdf3 !important;
    background-color: #ecfdf3 !important;
    border: 1px solid #bbf7d0 !important;
    box-shadow: none !important;
}

.select2-container.warranty-status--yes .select2-selection__rendered,
.select2-container--default.warranty-status--yes .select2-selection--single .select2-selection__rendered {
    color: #15803d !important;
    -webkit-text-fill-color: #15803d !important;
    font-weight: 700 !important;
}

.select2-container.warranty-status--no .select2-selection,
.select2-container.warranty-status--no .select2-selection--single,
.select2-container--default.warranty-status--no .select2-selection--single {
    background: #fef2f2 !important;
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    box-shadow: none !important;
}

.select2-container.warranty-status--no .select2-selection__rendered,
.select2-container--default.warranty-status--no .select2-selection--single .select2-selection__rendered {
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
    font-weight: 700 !important;
}

.select2-container.warranty-status--unknown .select2-selection,
.select2-container.warranty-status--unknown .select2-selection--single,
.select2-container--default.warranty-status--unknown .select2-selection--single {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
}

.select2-container.warranty-status--unknown .select2-selection__rendered,
.select2-container--default.warranty-status--unknown .select2-selection--single .select2-selection__rendered {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    font-weight: 700 !important;
}

/* ===== FMI select2 status colors ===== */
.select2-container.fmi-status--yes .select2-selection,
.select2-container.fmi-status--yes .select2-selection--single,
.select2-container--default.fmi-status--yes .select2-selection--single {
    background: #fef2f2 !important;
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    box-shadow: none !important;
}

.select2-container.fmi-status--yes .select2-selection__rendered,
.select2-container--default.fmi-status--yes .select2-selection--single .select2-selection__rendered {
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
    font-weight: 700 !important;
}

.select2-container.fmi-status--no .select2-selection,
.select2-container.fmi-status--no .select2-selection--single,
.select2-container--default.fmi-status--no .select2-selection--single {
    background: #ecfdf3 !important;
    background-color: #ecfdf3 !important;
    border: 1px solid #bbf7d0 !important;
    box-shadow: none !important;
}

.select2-container.fmi-status--no .select2-selection__rendered,
.select2-container--default.fmi-status--no .select2-selection--single .select2-selection__rendered {
    color: #15803d !important;
    -webkit-text-fill-color: #15803d !important;
    font-weight: 700 !important;
}

.select2-container.fmi-status--unknown .select2-selection,
.select2-container.fmi-status--unknown .select2-selection--single,
.select2-container--default.fmi-status--unknown .select2-selection--single {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
}

.select2-container.fmi-status--unknown .select2-selection__rendered,
.select2-container--default.fmi-status--unknown .select2-selection--single .select2-selection__rendered {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    font-weight: 700 !important;
}

/* ===== FMI display field (same as Warranty) ===== */

.fmi-status-field {
    margin-bottom: 14px !important;
}

.fmi-status-field label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
}

.fmi-status-display,
input.fmi-status-display,
.form-control.fmi-status-display {
    height: var(--field-height) !important;
    min-height: var(--field-height) !important;
    padding: 11px 14px !important;
    line-height: 1.2 !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center !important;
    letter-spacing: 0.01em;
    cursor: default !important;
    box-shadow: none !important;
}

.fmi-status-display[readonly],
input.fmi-status-display[readonly],
.form-control.fmi-status-display[readonly] {
    opacity: 1 !important;
    background-image: none !important;
    -webkit-text-fill-color: currentColor !important;
}

.fmi-status-field--enabled .fmi-status-display,
.fmi-status-field--enabled input.fmi-status-display,
.fmi-status-field--enabled .form-control.fmi-status-display,
.fmi-status-field--enabled .fmi-status-display[readonly] {
    background: #fef2f2 !important;
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
}

.fmi-status-field--disabled .fmi-status-display,
.fmi-status-field--disabled input.fmi-status-display,
.fmi-status-field--disabled .form-control.fmi-status-display,
.fmi-status-field--disabled .fmi-status-display[readonly] {
    background: #ecfdf3 !important;
    background-color: #ecfdf3 !important;
    border: 1px solid #bbf7d0 !important;
    color: #15803d !important;
    -webkit-text-fill-color: #15803d !important;
}

.fmi-status-field--unknown .fmi-status-display,
.fmi-status-field--unknown input.fmi-status-display,
.fmi-status-field--unknown .form-control.fmi-status-display,
.fmi-status-field--unknown .fmi-status-display[readonly] {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

/* ===== Unified customer card ===== */

.customer-card-unified {
    padding: 18px 20px !important;
}

.customer-card-unified .order-edit-sidebar__title {
    margin-bottom: 14px !important;
}

.customer-card-unified__tabs {
    display: flex !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    border-bottom: 0 !important;
}

.customer-card-unified__tabs .nav-item {
    margin: 0 !important;
}

.customer-card-unified__tabs .nav-link {
    min-width: 150px;
    min-height: 48px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 18px !important;
    border-radius: 16px !important;
    border: 1px solid #dbe3ee !important;
    background: #ffffff !important;
    color: #64748b !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.customer-card-unified__tabs .nav-link:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

.customer-card-unified__tabs .nav-link.active,
.customer-card-unified__tabs .nav-item.show .nav-link {
    background: #eef3ff !important;
    border-color: #c7d2fe !important;
    color: #3347a9 !important;
    box-shadow: inset 0 0 0 1px rgba(51, 71, 169, 0.04) !important;
}

.customer-card-unified__pane {
    margin: 0 !important;
}

.customer-card-unified__field {
    margin-bottom: 14px !important;
}

.customer-card-unified__field:last-child {
    margin-bottom: 0 !important;
}

.customer-card-unified .form-group {
    margin-bottom: 0 !important;
}

.customer-card-unified label,
.customer-card-unified .control-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
}

.customer-card-unified .form-control,
.customer-card-unified select,
.customer-card-unified input,
.customer-card-unified .select2-container .select2-selection--single,
.customer-card-unified .select2-container--default .select2-selection--single {
    height: var(--field-height) !important;
    min-height: var(--field-height) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
}

.customer-card-unified select,
.customer-card-unified select.form-control {
    padding-right: 14px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: none !important;
}

.customer-card-unified .select2-container--default .select2-selection--single .select2-selection__rendered,
.customer-card-unified .select2-selection__rendered {
    height: calc(var(--field-height) - 2px) !important;
    line-height: calc(var(--field-height) - 2px) !important;
    padding-left: 14px !important;
    padding-right: 38px !important;
    color: var(--text) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.customer-card-unified .select2-container--default .select2-selection--single .select2-selection__arrow,
.customer-card-unified .select2-selection__arrow {
    height: var(--field-height) !important;
    right: 8px !important;
}

.customer-card-unified .select2-container--default.select2-container--focus .select2-selection--single,
.customer-card-unified .select2-container--default.select2-container--open .select2-selection--single,
.customer-card-unified .form-control:focus,
.customer-card-unified select:focus,
.customer-card-unified input:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08) !important;
    color: var(--text) !important;
}

.customer-card-unified__field--contractor .select2-container {
    width: 100% !important;
}

/* ===== Standalone contractor field (edit page) ===== */
.customer-card-unified__field--contractor label,
.customer-card-unified__field--contractor .control-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
}

.customer-card-unified__field--contractor .form-group {
    margin-bottom: 0 !important;
}

.customer-card-unified__field--contractor .form-control,
.customer-card-unified__field--contractor select,
.customer-card-unified__field--contractor input,
.customer-card-unified__field--contractor .select2-container .select2-selection--single,
.customer-card-unified__field--contractor .select2-container--default .select2-selection--single {
    height: var(--field-height) !important;
    min-height: var(--field-height) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
}

.customer-card-unified__field--contractor select,
.customer-card-unified__field--contractor select.form-control {
    padding-right: 14px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: none !important;
}

.customer-card-unified__field--contractor .select2-container--default .select2-selection--single .select2-selection__rendered,
.customer-card-unified__field--contractor .select2-selection__rendered {
    height: calc(var(--field-height) - 2px) !important;
    line-height: calc(var(--field-height) - 2px) !important;
    padding-left: 14px !important;
    padding-right: 38px !important;
    color: var(--text) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.customer-card-unified__field--contractor .select2-container--default .select2-selection--single .select2-selection__arrow,
.customer-card-unified__field--contractor .select2-selection__arrow {
    height: var(--field-height) !important;
    right: 8px !important;
}

.customer-card-unified__field--contractor .select2-container--default.select2-container--focus .select2-selection--single,
.customer-card-unified__field--contractor .select2-container--default.select2-container--open .select2-selection--single,
.customer-card-unified__field--contractor .form-control:focus,
.customer-card-unified__field--contractor select:focus,
.customer-card-unified__field--contractor input:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08) !important;
    color: var(--text) !important;
}

@media (max-width: 768px) {
    .customer-card-unified {
        padding: 16px !important;
    }

    .customer-card-unified__tabs {
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .customer-card-unified__tabs .nav-link {
        min-width: 0;
        width: 100%;
    }
}
/* ===== Standard Select2 dropdown UI ===== */

.select2-dropdown {
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-md) !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

.select2-search--dropdown {
    padding: 10px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #eef2f7 !important;
}

.select2-search--dropdown .select2-search__field {
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 10px !important;
    border: 1px solid var(--border) !important;
    background: #ffffff !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08) !important;
    outline: none !important;
}

.select2-results__options {
    padding: 6px !important;
    max-height: 260px !important;
}

.select2-results__option {
    border-radius: 10px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    background: #ffffff !important;
}

.select2-results__option--highlighted[aria-selected],
.select2-results__option--highlighted[data-selected] {
    background: #eef3ff !important;
    color: #1f2937 !important;
}

.select2-results__option[aria-selected="true"],
.select2-results__option[data-selected="true"] {
    background: #f8fafc !important;
    color: var(--text) !important;
    font-weight: 700 !important;
}

/* ===== Service statistics ===== */

.statistics-filter-row [hidden] {
    display: none !important;
}

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

.statistics-filter-group {
    min-width: 0;
}

.statistics-filter-group__title {
    margin: 0 0 9px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.statistics-filter-row {
    margin-left: -6px !important;
    margin-right: -6px !important;
}

.statistics-filter-row > [class*="col-"] {
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.statistics-compare-date--disabled {
    opacity: 0.55;
}

.statistics-compare-date--disabled input {
    cursor: not-allowed;
}

.statistics-period-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -4px;
    padding-top: 2px;
}

.statistics-period-preset {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.statistics-period-preset:hover,
.statistics-period-preset:focus,
.statistics-period-preset.is-active {
    border-color: #b8caf0;
    background: #eef3ff;
    color: #1f3a5f;
    outline: none;
}

.statistics-period-preset--accent {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

@media (max-width: 991px) {
    .statistics-filter-layout {
        grid-template-columns: 1fr;
    }
}

.statistics-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.statistics-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.statistics-title {
    margin: 0 !important;
    color: var(--text) !important;
    font-size: 26px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
}

.statistics-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.statistics-periods strong {
    color: var(--text);
    font-weight: 900;
}

.statistics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 12px;
}

.statistics-kpi-card,
.statistics-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.statistics-kpi-card {
    min-height: 132px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.statistics-kpi-card__head span {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.statistics-kpi-card__head small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
}

.statistics-kpi-card__value {
    margin-top: 12px;
    color: var(--text);
    font-size: 24px;
    font-weight: 900;
    line-height: 1.1;
}

.statistics-kpi-card__compare {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.statistics-kpi-card__compare strong {
    padding: 3px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
}

.statistics-kpi-card--up .statistics-kpi-card__compare strong {
    background: #dcfce7;
    color: #15803d;
}

.statistics-kpi-card--down .statistics-kpi-card__compare strong {
    background: #fee2e2;
    color: #b91c1c;
}

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

.statistics-grid--main {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
}

.statistics-card {
    padding: 18px;
    overflow: hidden;
}

.statistics-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.statistics-card__head h2 {
    margin: 0 !important;
    color: var(--text) !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
}

.statistics-card__head p {
    margin: 5px 0 0 !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
}

.statistics-flow-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.statistics-flow-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
}

.statistics-flow-chart__legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.statistics-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.statistics-dot--received { background: #2563eb; }
.statistics-dot--issued { background: #16a34a; }
.statistics-dot--received-compare { background: #bfdbfe; }
.statistics-dot--issued-compare { background: #bbf7d0; }

.statistics-flow-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 76px;
    align-items: center;
    gap: 10px;
    min-height: 36px;
}

.statistics-flow-row__label,
.statistics-flow-row__value {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.statistics-flow-row__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.1;
}

.statistics-flow-row__label strong {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
}

.statistics-flow-row__label span {
    color: #a0aec0;
    font-size: 10px;
    font-weight: 800;
}

.statistics-flow-row__value {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
    line-height: 1.1;
}

.statistics-flow-row__value strong {
    color: var(--text);
    font-size: 11px;
    font-weight: 900;
}

.statistics-flow-row__value small {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
}

.statistics-flow-row__bars {
    position: relative;
    height: 28px;
    overflow: hidden;
    border-radius: 8px;
    background: #f8fafc;
}

.statistics-flow-bar {
    position: absolute;
    left: 0;
    height: 4px;
    min-width: 2px;
    border-radius: 999px;
}

.statistics-flow-bar--received {
    top: 4px;
    background: #2563eb;
}

.statistics-flow-bar--received-compare {
    top: 10px;
    background: #bfdbfe;
}

.statistics-flow-bar--issued {
    top: 17px;
    background: #16a34a;
}

.statistics-flow-bar--issued-compare {
    top: 23px;
    background: #bbf7d0;
}

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

.statistics-compare-row {
    min-width: 0;
}

.statistics-compare-row__top,
.statistics-compare-row__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.statistics-compare-row__label {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.statistics-compare-row__value {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.statistics-compare-row__bars {
    position: relative;
    height: 13px;
    margin: 5px 0;
    overflow: hidden;
    border-radius: 999px;
    background: #f1f5f9;
}

.statistics-compare-row__bar {
    position: absolute;
    left: 0;
    height: 5px;
    min-width: 2px;
    border-radius: 999px;
}

.statistics-compare-row__bar--current {
    top: 1px;
    background: #1f3a5f;
}

.statistics-compare-row__bar--compare {
    bottom: 1px;
    background: #cbd5e1;
}

.statistics-compare-row__bottom {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
}

.statistics-compare-row__bottom strong {
    padding: 2px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 900;
}

.statistics-compare-row--up .statistics-compare-row__bottom strong {
    background: #dcfce7;
    color: #15803d;
}

.statistics-compare-row--down .statistics-compare-row__bottom strong {
    background: #fee2e2;
    color: #b91c1c;
}

.statistics-empty {
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 1399px) {
    .statistics-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .statistics-grid--main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .statistics-grid {
        grid-template-columns: 1fr;
    }

    .statistics-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .statistics-kpi-grid {
        grid-template-columns: 1fr;
    }

    .statistics-flow-row {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .statistics-flow-row__value {
        display: none;
    }
}

/* ===== Contractor activity report ===== */

.contractor-activity-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contractor-activity-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.contractor-activity-title {
    margin: 0 !important;
    color: var(--text) !important;
    font-size: 26px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
}

.contractor-activity-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.contractor-activity-periods strong {
    color: var(--text);
    font-weight: 900;
}

.contractor-activity-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.contractor-activity-kpi__item {
    min-height: 92px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.contractor-activity-kpi__item span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.contractor-activity-kpi__item strong {
    color: var(--text);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.contractor-activity-kpi__item--warning strong { color: #b45309; }
.contractor-activity-kpi__item--danger strong { color: #b91c1c; }
.contractor-activity-kpi__item--muted strong { color: #475569; }

.contractor-activity-section {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.contractor-activity-section__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.contractor-activity-section__head h2 {
    margin: 0 !important;
    color: var(--text) !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
}

.contractor-activity-section__head p {
    margin: 5px 0 0 !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.contractor-activity-categories {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.contractor-activity-categories__label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 900;
}

.contractor-activity-categories__list,
.contractor-activity-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.contractor-activity-category-chip,
.contractor-activity-result-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.contractor-activity-category-chip strong,
.contractor-activity-result-meta strong {
    margin-left: 5px;
    color: var(--text);
    font-weight: 900;
}

.contractor-activity-category-chip--empty {
    color: var(--text-muted);
}

.contractor-activity-table-wrap {
    overflow-x: auto;
}

.contractor-activity-table {
    min-width: 1180px;
    margin: 0 !important;
}

.contractor-activity-table th {
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    white-space: nowrap;
}

.contractor-activity-table td {
    vertical-align: middle !important;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.contractor-activity-contractor {
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.contractor-activity-contractor strong {
    color: var(--text);
    font-weight: 900;
    line-height: 1.2;
}

.contractor-activity-contractor span,
.contractor-activity-muted {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.contractor-activity-decline {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.contractor-activity-risk {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.contractor-activity-risk--normal {
    background: #dcfce7;
    color: #15803d;
}

.contractor-activity-risk--warning {
    background: #fef3c7;
    color: #b45309;
}

.contractor-activity-risk--high,
.contractor-activity-risk--lost {
    background: #fee2e2;
    color: #b91c1c;
}

.contractor-activity-risk--sleeping {
    background: #f1f5f9;
    color: #475569;
}

.contractor-activity-empty {
    padding: 20px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 991px) {
    .contractor-activity-kpi {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .contractor-activity-kpi {
        grid-template-columns: 1fr;
    }
}

/* ===== Bulk create page ===== */

.bulk-create-page {
    max-width: 1440px;
    margin: 0 auto;
}

.bulk-create-page__head {
    margin-bottom: 20px !important;
}

.bulk-create-page__subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.bulk-create-form {
    display: grid;
    gap: 16px;
}

.bulk-create-panel {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
}

.bulk-create-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.bulk-create-panel__title {
    margin: 0 0 5px !important;
    color: var(--text) !important;
    font-size: 19px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
}

.bulk-create-panel__hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.bulk-create-contractor {
    max-width: 660px;
}

.bulk-create-contractor .form-group {
    margin: 0 !important;
}

.bulk-create-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bulk-create-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.bulk-create-stat strong {
    color: var(--text);
    font-size: 14px;
}

.bulk-create-stat--success {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #15803d;
}

.bulk-create-stat--pending {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.bulk-create-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.bulk-create-toolbar .btn {
    min-height: 44px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.bulk-create-progress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 13px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.bulk-order-table-head,
.bulk-order-row__grid {
    display: grid;
    grid-template-columns: 42px minmax(200px, 1.4fr) minmax(175px, 1.15fr) minmax(255px, 2fr) 132px 46px;
    gap: 10px;
    align-items: center;
}

.bulk-order-table-head {
    margin: 0 0 8px;
    padding: 0 14px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
}

.bulk-order-table-head__number {
    text-align: center;
}

#formset-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bulk-order-row {
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.bulk-order-row.not_checked {
    background: #fffdfb;
    border-color: #fed7aa;
}

.bulk-order-row.checked {
    background: #f7fef9;
    border-color: #bbf7d0;
}

.bulk-order-row.has-error {
    background: #fff8f8;
    border-color: #fecaca;
}

.bulk-order-row__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eef3ff;
    color: #3347a9;
    font-size: 13px;
    font-weight: 800;
}

.bulk-order-row.checked .bulk-order-row__number {
    background: #dcfce7;
    color: #15803d;
}

.bulk-order-row__term .form-group,
.bulk-order-row__description .form-group {
    margin: 0 !important;
}

.bulk-order-row__term input,
.bulk-order-row__description textarea {
    min-height: 44px !important;
    height: 44px !important;
    background: #ffffff !important;
}

.bulk-order-row__description textarea {
    padding-top: 11px !important;
    resize: none !important;
}

.bulk-fault-description-autocomplete {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 25;
    width: 100%;
    max-height: 230px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.bulk-fault-description-autocomplete.d-none {
    display: none !important;
}

.bulk-fault-description-autocomplete .fault-description-suggestion {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.bulk-fault-description-autocomplete .fault-description-suggestion:hover,
.bulk-fault-description-autocomplete .fault-description-suggestion:focus {
    background: #f5f8fc;
    outline: none;
}

.bulk-fault-description-autocomplete .fault-description-suggestion__text {
    color: #1f2937;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
}

.bulk-order-row__device-name {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.bulk-order-row.checked .bulk-order-row__device-name {
    background: #ecfdf3;
    color: #166534;
}

.bulk-order-row__search,
.bulk-order-row__delete-btn {
    min-height: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
}

.bulk-order-row__search {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    white-space: nowrap;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.bulk-order-row__delete-btn {
    width: 46px;
    padding: 0 !important;
    background: #fff1f2 !important;
    border-color: #fecdd3 !important;
    color: #be123c !important;
}

.bulk-order-row__delete-btn:hover {
    background: #ffe4e6 !important;
    border-color: #fda4af !important;
    color: #9f1239 !important;
}

.bulk-order-mobile-label {
    display: none;
}

.bulk-create-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eef2f7;
}

.bulk-create-footer__note {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.bulk-create-submit {
    min-width: 205px;
    min-height: 46px !important;
}

.related-order-candidates,
.related-order-history {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #f8fafc;
}

.bulk-order-row .related-order-candidates {
    margin-top: 12px;
}

.related-order-candidates__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.related-order-candidates__title {
    margin: 0 0 4px !important;
    color: var(--text) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
}

.related-order-candidates__hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.related-order-candidates__list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.related-order-candidate {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.related-order-candidate--active {
    border-color: #fed7aa;
    background: #fff7ed;
}

.related-order-candidate__number,
.related-order-history__link {
    color: var(--primary);
    font-weight: 800;
}

.related-order-candidate__meta {
    margin-left: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.related-order-candidate__details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.related-order-candidate__details span,
.related-order-history__label,
.related-order-history__reason {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #ffffff;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.related-order-candidates__controls {
    margin-top: 0;
}

.related-order-history {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.related-order-history__item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 1199px) {
    .bulk-order-table-head {
        display: none;
    }

    .bulk-order-row__grid {
        grid-template-columns: 42px minmax(190px, 1fr) minmax(185px, 1fr) 132px 46px;
    }

    .bulk-order-row__description {
        grid-column: 2 / 5;
    }

    .bulk-order-mobile-label {
        display: block;
        margin: 0 0 6px;
        color: #64748b;
        font-size: 11px;
        font-weight: 700;
    }
}

@media (max-width: 767px) {
    .bulk-create-panel {
        padding: 16px;
    }

    .bulk-create-panel__head,
    .bulk-create-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .bulk-create-toolbar {
        flex-wrap: wrap;
    }

    .bulk-create-toolbar .btn,
    .bulk-create-progress,
    .bulk-create-submit {
        width: 100%;
    }

    .bulk-order-row__grid {
        grid-template-columns: 1fr 46px;
        align-items: end;
    }

    .bulk-order-row__number {
        grid-column: 1 / 3;
    }

    .bulk-order-row__term,
    .bulk-order-row__device,
    .bulk-order-row__description {
        grid-column: 1 / 3;
    }

    .bulk-order-row__state {
        grid-column: 1;
    }

    .bulk-order-row__delete {
        grid-column: 2;
    }
}

/* ===== Warehouse workspace ===== */

.warehouse-workspace-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 14px;
    padding: 6px;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    overflow-x: auto;
}

.warehouse-workspace-nav__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    color: #475569 !important;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    border-radius: 10px;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.warehouse-workspace-nav__item i {
    margin: 0 !important;
    font-size: 14px;
}

.warehouse-workspace-nav__item:hover,
.warehouse-workspace-nav__item:focus {
    color: #1f3a5f !important;
    background: #eef3ff;
    outline: none;
}

.warehouse-workspace-nav__item.is-active {
    color: #1f3a5f !important;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.warehouse-workspace-subnav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -6px 0 14px;
    overflow-x: auto;
}

.warehouse-workspace-subnav__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 13px;
    color: #64748b !important;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    text-decoration: none !important;
}

.warehouse-workspace-subnav__item:hover,
.warehouse-workspace-subnav__item:focus,
.warehouse-workspace-subnav__item.is-active {
    color: #1f3a5f !important;
    background: #eef3ff;
    border-color: #b8caf0;
    outline: none;
}

.warehouse-directory-edit-page {
    max-width: 1200px;
}

.warehouse-directory-edit-form {
    display: grid;
    gap: 16px;
}

.warehouse-directory-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
}

.warehouse-directory-edit-grid .form-group {
    margin-bottom: 0 !important;
}

.invoice-panel__icon--directory {
    background: #f1f5f9;
    color: #475569;
}

/* ===== Warehouse invoice create / edit ===== */

.invoice-edit-page {
    max-width: 1440px;
    margin: 0 auto;
}

.warehouse-item-edit-page {
    max-width: 1200px;
}

.warehouse-item-edit-form {
    display: grid;
    gap: 16px;
}

.warehouse-item-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
}

.warehouse-item-edit-grid .form-group {
    margin-bottom: 0 !important;
}

.warehouse-item-edit-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #edf2f7;
}

.warehouse-item-edit-footer .btn {
    min-width: 190px;
}

.write-off-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.write-off-stat {
    padding: 15px 17px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.write-off-stat__label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.write-off-stat__value {
    color: var(--text);
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
}

.write-off-stat--danger {
    background: #fffafb;
    border-color: #fee2e2;
}

.write-off-stat--danger .write-off-stat__value,
.write-off-deduction {
    color: #b91c1c;
}

.write-off-stat--money {
    background: #fffdf7;
    border-color: #fde68a;
}

.write-off-stat--money .write-off-stat__value {
    color: #a16207;
}

.write-off-filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.write-off-note {
    max-width: 280px;
    color: var(--text-muted) !important;
}

.write-off-create-page {
    max-width: 1120px;
}

.write-off-create-form {
    display: grid;
    gap: 16px;
}

.write-off-create-grid {
    display: grid;
    grid-template-columns: minmax(350px, 1.8fr) minmax(120px, 0.55fr) minmax(230px, 1fr);
    gap: 16px;
}

.write-off-create-grid .form-group,
.write-off-liability-grid .form-group {
    margin-bottom: 0 !important;
}

.write-off-comment {
    margin-top: 18px;
}

.write-off-comment .form-group {
    margin-bottom: 0 !important;
}

.invoice-panel__icon--write-off {
    background: #fff7ed;
    color: #c2410c;
}

.invoice-panel__icon--liability {
    background: #f1f5f9;
    color: #475569;
}

.write-off-liability {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.write-off-liability.is-required {
    border-color: #fecaca;
    box-shadow: 0 3px 14px rgba(185, 28, 28, 0.06);
}

.write-off-liability.is-required .invoice-panel__icon--liability {
    background: #fee2e2;
    color: #b91c1c;
}

.write-off-liability-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(340px, 1.2fr);
    gap: 20px;
    align-items: start;
}

.write-off-policy {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.write-off-policy i {
    margin-top: 2px;
    color: #64748b;
}

.write-off-policy p {
    margin: 0;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}

.write-off-liability.is-required .write-off-policy {
    background: #fff7ed;
    border-color: #fed7aa;
}

.write-off-create-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 4px;
}

.write-off-create-footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.write-off-create-footer p i {
    margin-right: 6px;
}

.write-off-create-footer .btn {
    min-width: 230px;
}

.invoice-edit-head {
    margin-bottom: 20px !important;
}

.invoice-edit-head__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.invoice-edit-head__subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.invoice-edit-form {
    display: grid;
    gap: 16px;
}

.invoice-panel {
    padding: 22px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.invoice-panel__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.invoice-panel__icon {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #eef3ff;
    color: #3347a9;
    font-size: 18px;
}

.invoice-panel__icon--items {
    background: #ecfdf3;
    color: #15803d;
}

.invoice-panel__title {
    margin: 1px 0 5px !important;
    color: var(--text) !important;
    font-size: 19px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
}

.invoice-panel__hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.invoice-details-grid {
    display: grid;
    grid-template-columns: minmax(190px, 0.7fr) minmax(300px, 1.3fr) minmax(270px, 1fr);
    gap: 16px;
    align-items: start;
}

.invoice-details-grid .form-group {
    margin-bottom: 0 !important;
}

.invoice-details-grid input:not([type="file"]),
.invoice-details-grid .form-control {
    background: #ffffff !important;
}

.invoice-supplier-field .input-group .select2-container,
.invoice-directory-field .input-group .select2-container {
    flex: 1 1 auto;
    width: 1% !important;
}

.invoice-supplier-field .input-group-append,
.invoice-directory-field .input-group-append {
    margin-left: 6px !important;
}

.invoice-supplier-field .input-group-append .btn {
    height: var(--field-height) !important;
    min-height: var(--field-height) !important;
}

.invoice-details-grid input[type="file"] {
    display: block;
    width: 100%;
    height: var(--field-height);
    padding: 7px 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.invoice-details-grid input[type="file"]::file-selector-button {
    height: 30px;
    margin-right: 10px;
    padding: 0 12px;
    color: var(--primary);
    font-weight: 700;
    background: #eef3f8;
    border: 0;
    border-radius: 8px;
}

.invoice-document-card {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.invoice-document-preview {
    position: relative;
    display: flex;
    flex: 0 0 110px;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 92px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.invoice-document-preview:hover,
.invoice-document-preview:focus {
    border-color: #b7c9e6;
    box-shadow: 0 5px 15px rgba(30, 64, 175, 0.14);
    outline: none;
}

.invoice-document-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.invoice-document-preview__zoom {
    position: absolute;
    right: 7px;
    bottom: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    color: #ffffff;
    font-size: 11px;
    background: rgba(30, 41, 59, 0.72);
    border-radius: 8px;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.invoice-document-preview:hover .invoice-document-preview__zoom,
.invoice-document-preview:focus .invoice-document-preview__zoom {
    opacity: 1;
    transform: translateY(0);
}

.invoice-document-preview__fallback {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.invoice-document-preview__fallback:not([hidden]) {
    display: flex;
}

.invoice-document-preview__fallback i {
    color: #3347a9;
    font-size: 25px;
}

.invoice-document-card__meta {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.invoice-document-card__badge {
    margin-bottom: 5px;
    padding: 3px 8px;
    color: #15803d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #dcfce7;
    border-radius: 99px;
}

.invoice-document-card__meta strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}

.invoice-document-card__hint {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.invoice-document-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: auto 0 0 !important;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.invoice-document-clear input {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0;
    accent-color: var(--primary);
}

.invoice-document-upload--replace {
    margin-top: 4px;
}

.invoice-document-upload__label {
    display: block;
    margin: 0 0 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.invoice-report-option {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 22px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 12px;
}

.invoice-report-option__field .form-group,
.invoice-report-option__field .form-check {
    margin: 0 !important;
}

.invoice-report-option__field label {
    margin-bottom: 0 !important;
}

.invoice-report-option__hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.invoice-items-formset__items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    counter-reset: invoice-position;
}

.invoice-items-table-head,
.invoice-item-row {
    display: grid;
    grid-template-columns: 40px minmax(120px, 1fr) minmax(150px, 1.15fr) minmax(175px, 1.4fr) minmax(118px, 0.8fr) minmax(94px, 0.62fr) 48px;
    gap: 10px;
    align-items: center;
}

.invoice-items-table-head {
    margin: 0 0 8px;
    padding: 0 14px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.invoice-items-table-head__number {
    text-align: center;
}

.invoice-item-row {
    counter-increment: invoice-position;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.invoice-item-row:focus-within {
    border-color: #cbd9eb;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.invoice-item-row__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eef3ff;
    color: #3347a9;
    font-size: 13px;
    font-weight: 800;
}

.invoice-item-row__number::before {
    content: counter(invoice-position);
}

.invoice-item-row__field .form-group {
    margin: 0 !important;
}

.invoice-item-row__field input,
.invoice-item-row__field .form-control {
    height: 44px !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    background: #ffffff !important;
}

.invoice-directory-field .select2-container .select2-selection--single,
.invoice-directory-field .select2-container--default .select2-selection--single {
    height: 44px !important;
    min-height: 44px !important;
    background: #ffffff !important;
    padding: 0 12px !important;
}

.invoice-directory-field .select2-container--default .select2-selection--single .select2-selection__rendered,
.invoice-directory-field .select2-selection__rendered {
    height: 42px !important;
    line-height: 42px !important;
    padding-left: 12px !important;
    padding-right: 28px !important;
}

.invoice-directory-field .select2-container--default .select2-selection--single .select2-selection__arrow,
.invoice-directory-field .select2-selection__arrow {
    height: 44px !important;
    right: 8px !important;
}

.invoice-directory-field .input-group-append .btn {
    width: 38px !important;
    min-width: 38px !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 10px !important;
}

.invoice-item-row__label {
    display: none;
}

.invoice-item-row__delete-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    color: #be123c !important;
    background: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

.invoice-item-row__delete-btn:hover {
    color: #9f1239 !important;
    background: #ffe4e6 !important;
    border-color: #fda4af !important;
}

.invoice-items-formset__actions {
    margin-top: 14px;
}

.invoice-items-formset__actions .btn {
    min-height: 44px !important;
}

.invoice-edit-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eef2f7;
}

.invoice-edit-footer__note {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.invoice-edit-submit {
    min-width: 218px;
    min-height: 46px !important;
}

.invoice-modal .modal-body .form-group:last-child {
    margin-bottom: 0 !important;
}

.invoice-modal .alert {
    margin-bottom: 16px !important;
}

@media (max-width: 1199px) {
    .write-off-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .write-off-create-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .write-off-field--item {
        grid-column: 1 / 3;
    }

    .invoice-details-grid {
        grid-template-columns: minmax(190px, 0.7fr) minmax(280px, 1.3fr);
    }

    .invoice-details-grid__file {
        grid-column: 1 / 3;
    }

    .invoice-items-table-head {
        display: none;
    }

    .invoice-item-row {
        grid-template-columns: 40px repeat(2, minmax(180px, 1fr)) 48px;
        align-items: end;
    }

    .invoice-item-row__number {
        align-self: center;
        grid-row: span 2;
    }

    .invoice-item-row__delete {
        align-self: end;
        grid-row: span 2;
    }

    .invoice-item-row__label {
        display: block;
        margin: 0 0 6px;
        color: #64748b;
        font-size: 11px;
        font-weight: 700;
    }
}

@media (max-width: 767px) {
    .warehouse-workspace-nav {
        align-items: stretch;
    }

    .warehouse-workspace-nav__item {
        flex: 1 0 auto;
    }

    .write-off-stats,
    .write-off-filter-grid,
    .write-off-create-grid,
    .write-off-liability-grid {
        grid-template-columns: 1fr;
    }

    .write-off-field--item {
        grid-column: auto;
    }

    .write-off-create-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .write-off-create-footer .btn {
        width: 100%;
    }

    .warehouse-item-edit-grid {
        grid-template-columns: 1fr;
    }

    .warehouse-directory-edit-grid {
        grid-template-columns: 1fr;
    }

    .warehouse-item-edit-footer .btn {
        width: 100%;
    }

    .invoice-edit-head,
    .invoice-panel__head,
    .invoice-report-option,
    .invoice-edit-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-edit-head .btn,
    .invoice-edit-submit,
    .invoice-items-formset__actions .btn {
        width: 100%;
    }

    .invoice-panel {
        padding: 16px;
    }

    .invoice-details-grid {
        display: block;
    }

    .invoice-details-grid > div + div {
        margin-top: 16px;
    }

    .invoice-details-grid__file {
        grid-column: auto;
    }

    .invoice-document-card {
        flex-direction: column;
    }

    .invoice-document-preview {
        flex-basis: 160px;
        width: 100%;
        height: 160px;
    }

    .invoice-document-clear {
        margin-top: 10px !important;
    }

    .invoice-item-row {
        grid-template-columns: 1fr 48px;
        padding: 12px;
    }

    .invoice-item-row__number {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .invoice-item-row__field {
        grid-column: 1 / 3;
    }

    .invoice-item-row__delete {
        grid-column: 2;
        grid-row: auto;
    }
}

.staff-edit-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.staff-edit-section {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.staff-edit-section__head {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.staff-edit-section__head h5,
.staff-permission-group h6 {
    margin: 0;
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0;
}

.staff-edit-note {
    margin: -2px 0 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.staff-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 14px 18px;
}

.staff-edit-grid--salary {
    grid-template-columns: minmax(220px, 0.7fr) repeat(3, minmax(180px, 1fr));
    align-items: end;
}

.staff-edit-access {
    display: grid;
    grid-template-columns: minmax(260px, 0.35fr) minmax(420px, 1fr);
    gap: 18px;
    align-items: start;
}

.staff-edit-access__groups .form-group {
    margin-bottom: 0;
}

.staff-permission-matrix {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
}

.staff-permission-group {
    min-width: 0;
    padding: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.staff-permission-group h6 {
    margin-bottom: 10px;
    font-size: 14px;
}

.staff-permission-group__items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.staff-permission-option {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px;
    align-items: start;
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}

.staff-permission-option input {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
}

@media (max-width: 1200px) {
    .staff-edit-grid,
    .staff-edit-grid--salary,
    .staff-edit-access,
    .staff-permission-matrix {
        grid-template-columns: 1fr;
    }
}

.receivables-toolbar {
    margin-bottom: 12px;
}

.receivables-overview {
    display: grid;
    grid-template-columns: minmax(240px, 0.72fr) minmax(0, 2fr);
    gap: 14px;
    align-items: stretch;
}

.receivables-overview__total,
.receivables-tabs {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.receivables-overview__total {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 126px;
    padding: 18px 20px;
}

.receivables-overview__total span,
.receivables-tab__label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.receivables-overview__total strong {
    margin-top: 7px;
    color: var(--text);
    font-size: 25px;
    font-weight: 900;
    line-height: 1.1;
}

.receivables-overview__total small,
.receivables-tab small {
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.receivables-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
}

.receivables-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 126px;
    padding: 18px 22px;
    color: var(--text) !important;
    text-decoration: none !important;
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.receivables-tab + .receivables-tab {
    border-left: 1px solid var(--border);
}

.receivables-tab:hover {
    background: #f8fbff;
}

.receivables-tab.is-active {
    background: var(--primary-soft);
    box-shadow: inset 0 -3px 0 var(--primary);
}

.receivables-tab.is-active .receivables-tab__label {
    color: var(--primary);
}

.receivables-tab strong {
    margin-top: 7px;
    overflow: hidden;
    color: var(--text);
    font-size: 21px;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receivables-card {
    overflow: hidden;
}

.receivables-table-wrap {
    overflow-x: auto;
}

.receivables-table {
    table-layout: fixed;
    min-width: 1040px;
    margin-bottom: 0;
}

.receivables-table th,
.receivables-table td {
    vertical-align: middle;
}

.receivables-table th:nth-child(1) {
    width: 210px;
}

.receivables-table th:nth-child(2) {
    width: 125px;
}

.receivables-table th:nth-child(4) {
    width: 190px;
}

.receivables-table th:nth-child(5) {
    width: 175px;
}

.receivables-table__device {
    display: block;
    margin: 5px 0 3px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.25;
}

.receivables-state {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.receivables-state--ready {
    background: #ecfdf5;
    color: #047857;
}

.receivables-state--postpayment {
    background: #fff7ed;
    color: #c2410c;
}

.receivables-table__money {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    line-height: 1.25;
}

.receivables-table td {
    overflow-wrap: anywhere;
}

.receivables-table__event {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.receivables-table__event span,
.receivables-table__event small {
    display: block;
}

.receivables-table__event small {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.receivables-table__actions,
.receivables-table__actions-head {
    position: sticky;
    right: 0;
    z-index: 1;
    width: 210px;
    min-width: 210px;
    background: var(--surface);
    box-shadow: -10px 0 14px rgba(15, 23, 42, 0.06);
}

.receivables-table thead .receivables-table__actions-head {
    z-index: 2;
    background: var(--surface-muted);
}

.receivables-table__actions {
    text-align: right;
}

.receivables-action-btn {
    width: 100%;
    min-height: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: normal !important;
}

.receivables-action-unavailable {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.issue-order-summary {
    margin-bottom: 18px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
}

.issue-order-summary__identity {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 13px;
}

.issue-order-summary__identity strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
}

.issue-order-summary__identity span {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.issue-order-summary__money {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.issue-order-summary__money > div {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.issue-order-summary__money dt,
.issue-order-summary__money dd {
    margin: 0;
}

.issue-order-summary__money dt {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
}

.issue-order-summary__money dd {
    margin-top: 4px;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.issue-order-summary__remaining {
    border-color: #fed7aa !important;
    background: #fff7ed !important;
}

.issue-order-summary__remaining dd {
    color: #c2410c;
}

.issue-payment-options {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.issue-payment-options legend {
    width: auto;
    margin: 0 0 2px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.issue-payment-option {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.issue-payment-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.issue-payment-option > span {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 50px;
    padding: 10px 12px 10px 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.issue-payment-option > span::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 14px;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background: #ffffff;
}

.issue-payment-option > span::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 19px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
}

.issue-payment-option input:focus + span {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.issue-payment-option input:checked + span {
    border-color: #93c5fd;
    background: #eff6ff;
}

.issue-payment-option input:checked + span::before {
    border-color: var(--primary);
}

.issue-payment-option input:checked + span::after {
    background: var(--primary);
}

.issue-payment-option strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.issue-payment-option small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.issue-payment-options--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.issue-payment-options--compact legend {
    grid-column: 1 / -1;
}

@media (max-width: 991px) {
    .receivables-overview {
        grid-template-columns: 1fr;
    }

    .receivables-overview__total {
        min-height: 105px;
    }

    .receivables-tab {
        min-height: 110px;
    }

    .receivables-table {
        min-width: 0;
    }

    .receivables-table thead {
        display: none;
    }

    .receivables-table,
    .receivables-table tbody,
    .receivables-table tr,
    .receivables-table td {
        display: block;
        width: 100%;
    }

    .receivables-table tbody tr {
        padding: 6px 0;
        border-top: 1px solid var(--border);
    }

    .receivables-table tbody tr:first-child {
        border-top: 0;
    }

    .receivables-table tbody td {
        position: relative;
        min-height: 40px;
        padding: 9px 14px 9px 138px !important;
        border-top: 0 !important;
    }

    .receivables-table tbody td::before {
        content: attr(data-label);
        position: absolute;
        top: 10px;
        left: 14px;
        width: 110px;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .receivables-table__actions,
    .receivables-table__actions-head {
        position: static;
        width: 100%;
        min-width: 0;
        box-shadow: none;
    }

    .receivables-table tbody .receivables-table__actions {
        padding-top: 12px !important;
        padding-bottom: 14px !important;
    }

    .receivables-action-btn {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .receivables-tabs,
    .issue-payment-options--compact,
    .issue-order-summary__money {
        grid-template-columns: 1fr;
    }

    .receivables-tab + .receivables-tab {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .receivables-tab {
        min-height: 96px;
    }

    .receivables-table tbody td {
        padding-left: 120px !important;
    }

    .receivables-table tbody td::before {
        width: 92px;
    }
}

.auth-main-content {
    min-height: calc(100vh - 70px);
}

.auth-section {
    min-height: calc(100vh - 150px);
}

.auth-page {
    min-height: calc(100vh - 240px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 46px 16px;
}

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

.auth-card__head {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
}

.auth-card__mark {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 21px;
}

.auth-card__head h1 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0;
}

.auth-card__head p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form__field label {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

.auth-form__field .form-control {
    width: 100%;
}

.auth-form__error {
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.auth-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.auth-alert--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.auth-alert--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.auth-primary-btn,
.auth-secondary-btn {
    width: 100%;
    min-height: var(--field-height);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-secondary-btn {
    margin-top: 2px;
}

.email-template-variables {
    margin-top: 14px;
    padding: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.email-template-variables__title {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

.email-template-variables__items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.email-template-variables code {
    padding: 6px 8px;
    border-radius: 8px;
    background: #eef3f8;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 575px) {
    .auth-page {
        min-height: auto;
        align-items: flex-start;
        padding: 22px 0;
    }

    .auth-card {
        padding: 20px;
    }

    .auth-card__head {
        grid-template-columns: 44px 1fr;
    }

    .auth-card__mark {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .auth-card__head h1 {
        font-size: 21px;
    }
}

.profile-page {
    width: 100%;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-card,
.profile-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.profile-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.profile-avatar-wrap {
    display: flex;
    justify-content: center;
}

.profile-avatar {
    width: 168px;
    height: 168px;
    object-fit: cover;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 1px solid var(--border);
}

.profile-identity {
    text-align: center;
}

.profile-identity h1 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0;
}

.profile-username {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.profile-badge {
    min-height: 28px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.profile-badge--primary {
    background: var(--primary-soft);
    color: var(--primary);
}

.profile-badge--success {
    background: #ecfdf5;
    color: #047857;
}

.profile-badge--muted {
    background: #f1f5f9;
    color: var(--text-muted);
}

.profile-file-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-file-control__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-file-control__btn,
.profile-actions .btn {
    width: 100%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-avatar-clear {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px;
    align-items: start;
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.profile-field-error {
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.profile-section {
    padding: 18px;
}

.profile-section__head {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.profile-section__head h2 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px 18px;
}

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

.profile-info-item {
    min-width: 0;
    padding: 13px 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.profile-info-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.profile-info-item strong {
    display: block;
    min-height: 18px;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.profile-save-row {
    display: flex;
    justify-content: flex-end;
    padding: 16px 0 0;
    border-top: 1px solid var(--border);
}

.profile-save-btn {
    min-width: 210px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 1180px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-card {
        display: grid;
        grid-template-columns: 180px 1fr;
        align-items: center;
    }

    .profile-avatar-wrap,
    .profile-identity,
    .profile-badges,
    .profile-file-control,
    .profile-actions {
        grid-column: auto;
    }

    .profile-actions {
        grid-column: 1 / 3;
        display: grid;
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .profile-form-grid,
    .profile-info-grid,
    .profile-actions {
        grid-template-columns: 1fr;
    }

    .profile-card {
        display: flex;
    }

    .profile-save-row {
        justify-content: stretch;
    }

    .profile-save-btn {
        width: 100%;
        min-width: 0;
    }
}

/* ===== Contractor user access groups ===== */
.user-access-group-row td {
    padding: 12px 16px !important;
    background: var(--surface-muted);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.user-access-group-row__title {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
}

.user-access-group-row__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    margin-left: 10px;
    padding: 0 10px;
    color: var(--primary);
    background: #eaf2ff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.user-row--inactive {
    color: var(--text-muted);
    background: #f8fafc;
}

/* ===== Order list redesign ===== */

.orders-page-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.orders-page-subtitle span {
    margin: 0 6px;
    color: #cbd5e1;
}

.orders-work-queues {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.orders-work-queue {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    min-height: 70px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #ffffff;
    color: var(--text) !important;
    box-shadow: var(--shadow-sm);
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.orders-work-queue:hover {
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.orders-work-queue.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: inset 0 -3px 0 var(--primary), var(--shadow-sm);
}

.orders-work-queue span {
    min-width: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.orders-work-queue strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 32px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 14px;
    font-weight: 900;
}

.orders-work-queue--intake strong { background: #e0f2fe; color: #0369a1; }
.orders-work-queue--coordination strong { background: #fef3c7; color: #b45309; }
.orders-work-queue--repair strong { background: #ede9fe; color: #6d28d9; }
.orders-work-queue--external_service strong { background: #e0e7ff; color: #3730a3; }
.orders-work-queue--ready strong { background: #dcfce7; color: #15803d; }

.orders-work-queue--directory {
    font-family: inherit;
}

.orders-work-queue--directory i {
    color: var(--text-muted);
    font-size: 14px;
    transition: transform 0.16s ease;
}

.orders-work-queue--directory[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.orders-status-directory {
    display: none;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin: -2px 0 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #f8fafc;
}

.orders-status-directory.show,
.orders-status-directory.collapsing {
    display: grid;
}

.orders-status-directory__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #ffffff;
    color: var(--text) !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
}

.orders-status-directory__item:hover,
.orders-status-directory__item.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
}

.orders-status-directory__item strong {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 900;
}

.orders-filter-panel--redesign {
    padding: 14px !important;
}

.orders-primary-search {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) repeat(2, minmax(180px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.orders-primary-search .form-group {
    margin-bottom: 0 !important;
}

.orders-primary-search__submit {
    min-width: 112px;
    min-height: 36px;
}

.orders-filter-panel--redesign .orders-filter-grid--extra {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.orders-filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.orders-filter-footer__left,
.orders-filter-footer__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.orders-filter-quick-toggle {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #ffffff;
}

.orders-sort-control {
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin: 0 0 0 4px !important;
    padding-left: 14px;
    border-left: 1px solid #dbe3ee;
}

.orders-sort-control__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
}

.orders-sort-control .form-control {
    width: 220px;
    min-height: 42px !important;
    border-color: #cbd5e1 !important;
    background-color: #ffffff !important;
    font-weight: 700;
}

.orders-filter-quick-toggle label {
    font-size: 13px;
    font-weight: 800;
}

.orders-filter-footer .btn {
    min-height: 36px;
}

.orders-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.orders-active-filters__label {
    margin-right: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.orders-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8 !important;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none !important;
}

.orders-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 54px;
    margin: 8px 0;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.orders-results-toolbar__count {
    display: flex;
    align-items: center;
    gap: 9px;
}

.orders-results-toolbar__count span,
.orders-results-toolbar__hint {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.orders-results-toolbar__count strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.orders-bulk-panel--sticky:not(.d-none) {
    position: sticky;
    top: 76px;
    z-index: 12;
    display: block !important;
}

.orders-results-toolbar ~ .table-responsive {
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

.orders-results-toolbar ~ .table-responsive .table {
    min-width: 1080px;
    table-layout: fixed;
}

.orders-results-toolbar ~ .table-responsive th:nth-child(1) { width: 44px; }
.orders-results-toolbar ~ .table-responsive th:nth-child(2) { width: 125px; }
.orders-results-toolbar ~ .table-responsive th:nth-child(3) { width: 220px; }
.orders-results-toolbar ~ .table-responsive th:nth-child(4) { width: 165px; }
.orders-results-toolbar ~ .table-responsive th:nth-child(5) { width: 140px; }
.orders-results-toolbar ~ .table-responsive th:nth-child(6) { width: 145px; }
.orders-results-toolbar ~ .table-responsive th:nth-child(7) { width: 131px; }
.orders-results-toolbar ~ .table-responsive th:nth-child(8) { width: 110px; }

.orders-results-toolbar ~ .table-responsive thead th {
    padding-top: 13px !important;
    padding-bottom: 13px !important;
    font-size: 13px !important;
    line-height: 1.25;
}

.order-list-row td {
    padding: 15px 12px !important;
    border-top: 1px solid #eef2f7 !important;
    background: #ffffff !important;
    color: var(--text);
    font-size: 14px !important;
    line-height: 1.4;
    vertical-align: top !important;
}

.order-list-row:hover td {
    background: #f8fbff !important;
}

.order-list-row td > small,
.order-list-row td > span > small,
.order-list-row__people > span {
    display: block;
}

.order-list-row td small {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.orders-list-table__check {
    text-align: center;
}

.orders-list-table__check input {
    width: 18px;
    height: 18px;
}

.order-number-cell__link {
    font-size: 15px;
    line-height: 1.3;
}

.order-list-row__device strong,
.order-list-row__party strong,
.order-list-row__money strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.order-fmi-state {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-top: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.order-fmi-state--on { background: #fef2f2; color: #b91c1c; }
.order-fmi-state--off { background: #ecfdf5; color: #047857; }
.order-fmi-state--unknown { background: #f1f5f9; color: #64748b; }

.order-device-heading {
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.order-device-heading > strong {
    min-width: 0;
}

.order-equipment-trigger {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #f5d58a;
    border-radius: 8px;
    background: #fff8e6;
    color: #8a5700;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.order-equipment-trigger:hover,
.order-equipment-trigger:focus {
    border-color: #e4b84e;
    background: #ffefc2;
    color: #6f4500;
    outline: none;
    transform: translateY(-1px);
}

.popover-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.orders-filter-item--checkbox {
    display: flex;
    align-items: flex-end;
    padding-bottom: 8px;
}

.orders-filter-item--checkbox .form-group {
    margin-bottom: 0;
}

.order-status-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    text-align: left;
}

button.order-status-trigger {
    cursor: pointer;
}

button.order-status-trigger:hover {
    filter: brightness(0.98);
}

.order-status-trigger--consideration,
.order-status-trigger--inspection { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }
.order-status-trigger--on_coordination,
.order-status-trigger--coordinate { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.order-status-trigger--need_detail,
.order-status-trigger--in_progress { border-color: #ddd6fe; background: #f5f3ff; color: #6d28d9; }
.order-status-trigger--done,
.order-status-trigger--wait_asc { border-color: #c7d2fe; background: #eef2ff; color: #3730a3; }
.order-status-trigger--adopted_from_asc { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.order-status-trigger--rejection { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.order-status-trigger--issued_to_client { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }

.order-status-age {
    margin-top: 7px !important;
}

.order-list-row__people > span + span {
    margin-top: 8px;
}

.order-list-row__people span small {
    display: block;
    margin: 0 0 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.order-money-empty {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.order-money-paid {
    color: #15803d !important;
}

.orders-list-table__actions,
.orders-list-table__actions-head {
    text-align: right;
}

.order-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.order-row-actions .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0 !important;
}

.order-status-modal {
    overflow: hidden;
    border: 0;
    border-radius: 16px;
}

.order-status-modal__eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.order-status-modal label {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.order-status-modal__hint {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.order-preview-drawer .modal-dialog {
    position: fixed;
    top: 0;
    right: 0;
    width: min(820px, calc(100vw - 80px));
    max-width: 820px;
    height: 100vh;
    margin: 0;
    transform: translateX(100%) !important;
    transition: transform 0.2s ease !important;
}

.order-preview-drawer.show .modal-dialog {
    transform: translateX(0) !important;
}

.order-preview-drawer .modal-content {
    height: 100vh;
    overflow: hidden;
    border: 0;
    border-radius: 18px 0 0 18px;
    box-shadow: -20px 0 55px rgba(15, 23, 42, 0.2);
}

.order-preview-drawer__content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.order-preview-drawer__head {
    flex: 0 0 auto;
    align-items: flex-start;
    padding: 22px 24px !important;
    border-bottom: 1px solid var(--border) !important;
}

.order-preview-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 24px !important;
}

.order-preview-drawer__footer {
    flex: 0 0 auto;
    padding: 14px 24px !important;
    border-top: 1px solid var(--border) !important;
}

.order-preview-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.order-preview-fact {
    display: flex;
    min-width: 0;
    min-height: 88px;
    flex-direction: column;
    justify-content: center;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
}

.order-preview-fact span,
.order-preview-fact small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
}

.order-preview-fact strong {
    margin: 4px 0 3px;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.order-preview-fact--money {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.order-preview-fact--money.has-balance {
    border-color: #fed7aa;
    background: #fff7ed;
}

.order-preview-fact--money.has-balance strong,
.order-preview-balance {
    color: #c2410c !important;
}

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

.order-preview-summary__card,
.order-preview-description {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
}

.order-preview-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.order-preview-card-heading h6 {
    margin-bottom: 0;
}

.order-preview-customer-type {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 9px;
    border: 1px solid #dbe5f3;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.order-preview-customer-type--client {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.order-preview-customer-type--contractor {
    border-color: #c4b5fd;
    background: #f5f3ff;
    color: #6d28d9;
}

.order-preview-summary__card h6,
.order-preview-description h6 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.order-preview-summary__card h6 i,
.order-preview-description h6 i {
    margin-right: 6px;
    color: var(--primary);
}

.order-preview-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.order-preview-notes--single {
    grid-template-columns: 1fr;
}

.order-preview-description p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
    white-space: pre-wrap;
}

.order-preview-loading,
.order-preview-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 100%;
    padding: 30px;
    color: var(--text-muted);
    text-align: center;
}

.order-preview-loading .spinner-border {
    width: 30px;
    height: 30px;
    color: var(--primary);
}

.order-preview-error i {
    color: var(--danger);
    font-size: 30px;
}

@media (max-width: 1200px) {
    .orders-work-queues {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .orders-status-directory {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .orders-primary-search {
        grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(160px, 1fr));
    }

    .orders-primary-search__submit {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .orders-page-subtitle span {
        display: none;
    }

    .orders-page-subtitle strong {
        margin-right: 10px;
    }

    .orders-work-queues {
        display: flex;
        gap: 8px;
        margin-right: -14px;
        overflow-x: auto;
        padding: 2px 14px 8px 0;
        scroll-snap-type: x proximity;
    }

    .orders-work-queue {
        flex: 0 0 184px;
        min-height: 66px;
        scroll-snap-align: start;
    }

    .orders-status-directory,
    .orders-status-directory.show,
    .orders-status-directory.collapsing {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .orders-primary-search {
        grid-template-columns: 1fr;
    }

    .orders-primary-search__submit {
        grid-column: auto;
    }

    .orders-filter-footer,
    .orders-filter-footer__left,
    .orders-filter-footer__actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .orders-sort-control {
        margin-left: 0 !important;
        padding-left: 0;
        border-left: 0;
    }

    .orders-sort-control .form-control,
    .orders-filter-footer .btn {
        width: 100%;
    }

    .orders-filter-quick-toggle,
    .orders-sort-control {
        width: 100%;
        min-width: 0;
    }

    .orders-results-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .orders-bulk-panel--sticky:not(.d-none) {
        position: sticky;
        top: auto;
        bottom: 10px;
        display: block !important;
        margin: 8px 0 !important;
    }

    .orders-bulk-panel--sticky .orders-bulk-panel__inner {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        background: #ffffff !important;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16) !important;
    }

    .orders-results-toolbar ~ .table-responsive {
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
    }

    .orders-results-toolbar ~ .table-responsive .table {
        display: block;
        min-width: 0;
        background: transparent !important;
    }

    .orders-results-toolbar ~ .table-responsive thead {
        display: none;
    }

    .orders-results-toolbar ~ .table-responsive tbody,
    .order-list-row {
        display: block;
        width: 100%;
    }

    .order-list-row {
        margin-bottom: 10px;
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 13px;
        background: #ffffff;
        box-shadow: var(--shadow-sm);
    }

    .order-list-row td {
        position: relative;
        display: block;
        width: 100% !important;
        min-height: 42px;
        padding: 10px 12px 10px 118px !important;
        border-top: 1px solid #eef2f7 !important;
    }

    .order-list-row td:first-child {
        border-top: 0 !important;
    }

    .order-list-row td::before {
        content: attr(data-label);
        position: absolute;
        top: 11px;
        left: 12px;
        width: 92px;
        color: var(--text-muted);
        font-size: 9px;
        font-weight: 900;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .order-list-row .orders-list-table__check {
        min-height: 34px;
        padding: 8px 12px !important;
        text-align: left;
    }

    .order-list-row .orders-list-table__check::before {
        display: none;
    }

    .order-status-trigger {
        max-width: 260px;
    }

    .orders-list-table__actions {
        padding-left: 12px !important;
    }

    .orders-list-table__actions::before {
        display: none;
    }

    .order-row-actions,
    .order-row-actions .btn,
    .order-row-actions form {
        width: 100%;
    }

    .order-row-actions .btn {
        flex: 1 1 0;
    }

    .order-preview-drawer .modal-dialog {
        width: 100vw;
        max-width: none;
    }

    .order-preview-drawer .modal-content {
        border-radius: 0;
    }

    .order-preview-summary {
        grid-template-columns: 1fr;
    }

    .order-preview-notes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .orders-status-directory,
    .orders-status-directory.show,
    .orders-status-directory.collapsing,
    .orders-bulk-panel--sticky .orders-bulk-panel__inner {
        grid-template-columns: 1fr;
    }

    .order-list-row td {
        padding-left: 104px !important;
    }

    .order-list-row td::before {
        width: 78px;
    }
}
