.skin-blue .table > tbody > tr.has-unread-messages > td {
    background: #fff7ed !important;
    border-top-color: #f4b38d;
    border-bottom-color: #f4b38d;
}

.skin-blue .table > tbody > tr.has-unread-messages > td:first-child {
    box-shadow: inset 4px 0 0 #e85d2a;
}

.skin-blue .admin-conversation-new {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 6px 5px 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fee8dc;
    color: #a63a15;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.skin-blue a .admin-conversation-new {
    margin-bottom: 0;
}

.skin-blue [data-conversation-unread-total] {
    margin-left: 5px;
}

/* Envelope + red count badge in Actions */
.skin-blue .grid-msg-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    margin: 0.15rem 0.35rem 0 0;
    border-radius: 0.4rem;
    color: #5a5458;
    font-size: 1.05rem;
    line-height: 1;
    overflow: visible;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.skin-blue .grid-msg-icon.has-unread {
    color: #3f393d;
}

.skin-blue .grid-msg-link:hover .grid-msg-icon,
.skin-blue .grid-msg-link:focus .grid-msg-icon {
    color: #212529;
    background-color: rgba(75, 70, 92, 0.1);
}

.skin-blue .grid-msg-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.35rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.28rem;
    border: 1.5px solid #fff;
    border-radius: 999px;
    background: #cf454c;
    color: #fff !important;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}

/* Show red count only when there are unread messages */
.skin-blue .grid-msg-icon:not(.has-unread) .grid-msg-badge {
    display: none;
}

.skin-blue .grid-msg-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: inherit;
    overflow: visible;
}

/* Chat tab unread badge (all order types) */
.skin-blue .nav-tabs .count-order-message-user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    margin-left: 0.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #cf454c;
    color: #fff !important;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.skin-blue .nav-tabs .count-order-message-user.is-empty {
    display: none !important;
}

.skin-blue .grid-actions .grid-msg-link,
.skin-blue .grid-actions .grid-msg-icon {
    margin: 0;
}

/* «Открыть заказ»: small absolute badges (new + unread chat) */
.skin-blue .grid-open-order {
    position: relative;
    display: inline-flex;
    align-items: center;
    overflow: visible;
    text-decoration: none !important;
}

.skin-blue .grid-open-order__badges {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    pointer-events: none;
}

.skin-blue .grid-open-order__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.28rem;
    border: 1.5px solid #fff;
    border-radius: 999px;
    color: #fff !important;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}

.skin-blue .grid-open-order__badge--new {
    background: #cf454c;
    padding: 0 0.4rem;
    min-width: auto;
    border-radius: 0.2rem;
    text-transform: lowercase;
}

.skin-blue .grid-open-order__badge--chat {
    background: #cf454c;
}

.skin-blue .grid-open-order__badge.is-empty {
    display: none !important;
}

/*
 * Order menu marks: the envelope (unread customer messages), the pencil
 * (orders the client changed since they were last opened), then the red
 * count of new requests. One box at the row's right edge holds them; the rows
 * of «Заявки» have no arrow, so the box sits close to the edge.
 */
body.skin-blue .sidebar-menu .menu-attention {
    position: absolute;
    top: 50%;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(-50%);
}

body.skin-blue .sidebar-menu .menu-attention .menu-order-tour-count {
    position: static !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
}

/* The marks stay in their columns: an empty red count keeps its place. */
body.skin-blue .sidebar-menu .menu-attention .menu-order-tour-count:empty {
    display: inline-flex !important;
    visibility: hidden;
}

.skin-blue .menu-msg-count,
.skin-blue .menu-chg-count {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.35rem;
    margin-right: 0.35rem;
    color: #5a5458;
    font-size: 0.95rem;
    line-height: 1;
    vertical-align: middle;
}

.skin-blue .nav-tabs .menu-msg-count,
.skin-blue .nav-tabs .menu-chg-count {
    margin-left: 0.45rem;
}

.skin-blue .menu-msg-count__n,
.skin-blue .menu-chg-count__n {
    position: absolute;
    top: -0.4rem;
    right: -0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border: 1.5px solid #fff;
    border-radius: 999px;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}

/* Blue: a message. Amber: a change. Red stays for new requests only. */
.skin-blue .menu-msg-count__n {
    background: #2f6fd6;
}

.skin-blue .menu-chg-count__n {
    background: #e8890c;
}

.skin-blue .menu-msg-count:empty,
.skin-blue .menu-chg-count:empty {
    display: none !important;
}

/* A collapsed active section is painted in the brand colour: keep the icons readable. */
.skin-blue .sidebar-menu > li.active:not(.menu-open):not(.menu-open-order) > a .menu-msg-count,
.skin-blue .sidebar-menu > li.active:not(.menu-open):not(.menu-open-order) > a .menu-chg-count {
    color: #fff;
}

/* A long name stops short of the marks instead of running under them. */
body.skin-blue .sidebar-menu li > a:has(.menu-order-tour-count:not(:empty)),
body.skin-blue .sidebar-menu li > a:has(.menu-msg-count:not(:empty)),
body.skin-blue .sidebar-menu li > a:has(.menu-chg-count:not(:empty)) {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.skin-blue .sidebar-menu li > a:has(.menu-order-tour-count:not(:empty)) {
    padding-right: 2.9rem !important;
}

body.skin-blue .sidebar-menu li > a:has(.menu-msg-count:not(:empty)),
body.skin-blue .sidebar-menu li > a:has(.menu-chg-count:not(:empty)) {
    padding-right: 5rem !important;
}

body.skin-blue .sidebar-menu li > a:has(.menu-msg-count:not(:empty)):has(.menu-chg-count:not(:empty)) {
    padding-right: 6.6rem !important;
}
