/* client\style\css\sidebar.css */

#tool-palette {
    grid-area: tool-palette;
    background: #333;
    border-right: 1px solid #444;
    padding: 0.625rem;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
}

.tool-accordion {
    border-radius: 0.375rem;
}

.tool-accordion-header {
    padding: 0.75rem;
    background: #444;
    font-size: 0.875rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-accordion-header::after {
    content: "▼";
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.tool-accordion.collapsed .tool-accordion-header::after {
    transform: rotate(-90deg);
}

.tool-accordion.collapsed .tool-accordion-content {
    display: none;
}

.tool-accordion-content {
    display: flex;
    flex-direction: column;
    background: #383838;
}

#properties .properties-selected-object-content {
    min-height: 100px;
    max-height: 100px;
    overflow-y: auto;
}

#properties .properties-copy-content {
    min-height: 100px;
    max-height: 100px;
    overflow-y: auto;
}

.tool-preview {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: #444;
}

.tool-icon-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease;
}

.tool-icon-wrapper:hover {
    box-shadow:
        0 0 10px rgba(0, 120, 215, 0.75),
        0 0 0 1px rgba(0, 120, 215, 0.9);
}

.tool-preview-svg {
    width: 9rem;
    height: 9rem;
}

.tool-favorite-star {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.tool-favorite-star:hover {
    color: #ffdd00;
}

.tool-favorite-star.active {
    color: #ffdd00;
}

.tool-preview-title {
    text-align: center;
    font-size: 0.9375rem;
    font-weight: bold;
    line-height: 1.2;
}

.tool-settings {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.tool-palette-section {
    padding: 0.75rem;
    background: #383838;
    border-radius: 0.375rem;
}

.tool-palette-section + .tool-palette-section {
    margin-top: 0.625rem;
}

.tool-palette-section-title {
    color: #ddd;
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
}

.tool-form-grid,
.tool-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.tool-form-grid {
    gap: 0.75rem;
}

.tool-field-row {
    display: grid;
    gap: 0.5rem;
}

.tool-field-row.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-label {
    color: #ccc;
    font-size: 0.75rem;
    font-weight: 500;
}

.tool-dependent-options {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-left: 1.25rem;
}

.tool-field-hint {
    color: #aaa;
    font-size: 0.7rem;
    line-height: 1.35;
}

.tool-validation-result {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.tool-validation-status,
.tool-validation-summary,
.tool-validation-more {
    border: 1px solid #555;
    border-radius: 4px;
    color: #d6d6d6;
    font-size: 0.75rem;
    line-height: 1.35;
    padding: 0.5rem;
}

.tool-validation-status.is-ok {
    border-color: #3f6b4e;
    color: #bfe5c8;
}

.tool-validation-status.is-error {
    border-color: #7a4a4a;
    color: #f0c1c1;
}

.tool-validation-list {
    display: grid;
    gap: 0.35rem;
}

.tool-validation-item {
    border-left: 3px solid #777;
    color: #ddd;
    font-size: 0.72rem;
    line-height: 1.35;
    padding: 0.2rem 0 0.2rem 0.5rem;
}

.tool-validation-item.is-error {
    border-left-color: #d26b6b;
}

.tool-validation-item.is-warning {
    border-left-color: #d7b75f;
}

.tool-validation-item span {
    color: #aaa;
    display: block;
    font-size: 0.66rem;
    margin-bottom: 0.1rem;
}

.tool-validation-item p {
    margin: 0;
}

.tool-tabs {
    align-items: end;
    border-bottom: 1px solid #4a4a4a;
    display: flex;
    gap: 0.25rem;
}

.tool-tab {
    background: #20262d;
    border: 1px solid #4a4a4a;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    min-height: 2rem;
    padding: 0.55rem 0.7rem;
}

.tool-tab.active {
    background: #30363d;
    color: #fff;
}

.estimate-coefficients-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.estimate-coefficient-row {
    align-items: end;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.25rem;
    gap: 0.5rem;
}

.estimate-coefficient-row.is-changed .tool-label {
    color: #f0d47a;
}

.estimate-coefficient-field {
    min-width: 0;
}

.estimate-coefficient-reset {
    height: 2rem;
    min-width: 2.25rem;
    padding: 0 0.5rem;
}

.estimate-category-accordion {
    margin-bottom: 0;
}

.estimate-category-accordion.is-changed .estimate-category-title span:first-child {
    color: #f0d47a;
}

.estimate-category-header {
    align-items: center;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.5rem;
    min-height: 2.5rem;
}

.estimate-category-title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.estimate-category-title span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.estimate-price-meta {
    color: #aaa;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.25;
}

.estimate-category-coefficient {
    color: #ccc;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.estimate-coefficient-input {
    height: 1.75rem;
    padding: 0.25rem 0.35rem;
}

.estimate-category-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.estimate-price-row {
    border-bottom: 1px solid #444;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0 0.45rem;
}

.estimate-price-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.estimate-price-row.is-overridden .tool-label {
    color: #f0d47a;
}

.estimate-price-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.5rem;
}

.estimate-price-controls {
    align-items: end;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.9rem;
    gap: 0.45rem;
}

.estimate-price-reset {
    height: 2rem;
    padding: 0 0.45rem;
}

.cable-routing-selection-card {
    margin-bottom: 0.45rem;
    overflow: hidden;
    padding: 0;
}

.cable-routing-selection-row {
    align-items: center;
    border-bottom: 1px solid #444;
    display: flex;
    min-height: 1.75rem;
    min-width: 0;
    padding: 0.22rem 0.45rem;
}

.cable-routing-selection-row:last-child {
    border-bottom: 0;
}

.cable-routing-selection-card.is-empty .cable-routing-selection-row {
    color: #888;
}

.cable-routing-selection-line {
    align-items: baseline;
    gap: 0.35rem;
}

.cable-routing-selection-line-name {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    overflow-wrap: anywhere;
}

.cable-routing-selection-line-length {
    color: #aaa;
    flex: none;
    font-size: 0.78rem;
    line-height: 1.35;
}

.cable-routing-selection-cable,
.cable-routing-selection-routing-control {
    color: #ddd;
    font-size: 0.86rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.favorite-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #404040;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.favorite-item:hover {
    background: #4a4a4a;
}

.tool-dropdown-item.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.favorite-icon {
    width: 3.125rem;
    height: 3.125rem;
    object-fit: contain;
    flex-shrink: 0;
}

.favorite-label {
    font-size: 0.8125rem;
    flex: 1;
}

.tool-dropdown {
    position: relative;
}

.tool-dropdown-select {
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
    background: #4a4a4a;
    color: #eee;
    border: 1px solid #555;
    border-radius: 0.25rem;
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.2;
    cursor: pointer;
    outline: none;
    width: 100%;
}

.tool-dropdown-select:focus {
    border-color: #0078d7;
    background: #5a5a5a;
}

.tool-dropdown-list, .tool-dropdown-value {
    display: none;
}

.tool-combobox {
    position: relative;
    width: 100%;
}

.tool-combobox-input {
    width: 100%;
    padding: 0.375rem 1.75rem 0.375rem 0.5rem;
    background: #4a4a4a;
    color: #eee;
    border: 1px solid #555;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    box-sizing: border-box;
}

.tool-combobox::after {
    content: "";
    position: absolute;
    top: 0.8125rem;
    right: 0.625rem;
    width: 0;
    height: 0;
    border-left: 0.25rem solid transparent;
    border-right: 0.25rem solid transparent;
    border-top: 0.3125rem solid #bbb;
    pointer-events: none;
}

.tool-combobox-input:focus {
    outline: none;
    border-color: #0078d7;
    background: #5a5a5a;
}

.tool-combobox-list {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    max-height: 12rem;
    overflow-y: auto;
    padding: 0.25rem;
    background: #303030;
    border: 1px solid #555;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.35);
}

.tool-combobox-option {
    display: block;
    width: 100%;
    min-height: 1.75rem;
    padding: 0.3125rem 0.5rem;
    color: #eee;
    background: transparent;
    border: 0;
    border-radius: 0.1875rem;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.tool-combobox-option:hover,
.tool-combobox-option.active {
    background: #28649a;
    color: #fff;
}

.tool-combobox-empty {
    padding: 0.375rem 0.5rem;
    color: #aaa;
    font-size: 0.75rem;
}

.placement-reference-grid {
    display: grid;
    grid-template-columns: repeat(3, 2rem);
    gap: 0.25rem;
}

.placement-reference-grid.wall {
    grid-template-columns: repeat(3, 2rem);
}

.placement-reference-button {
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: #ddd;
    background: #3c3c3c;
    border: 1px solid #555;
    border-radius: 0.25rem;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
}

.placement-reference-button:hover {
    background: #464646;
    border-color: #666;
}

.placement-reference-button.active,
.placement-reference-button[aria-pressed="true"] {
    color: #fff;
    background: #28649a;
    border-color: #3d87c4;
}

#properties {
    grid-area: properties;
    background: #333;
    border-left: 1px solid #444;
    padding: 0.625rem;
    min-height: 0;
    overflow-y: auto;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
}

.properties-stage-context {
    padding: 0 0 0.625rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #444;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.properties-context-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.125rem;
}

.properties-context-title {
    color: #ddd;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: uppercase;
}

.properties-context-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.25rem;
    gap: 0.5rem;
    align-items: end;
}

.properties-context-icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    color: #ddd;
    background: #3c3c3c;
    border: 1px solid #555;
    border-radius: 0.25rem;
    font: inherit;
    cursor: pointer;
}

.properties-context-icon-button:hover {
    background: #464646;
    border-color: #666;
}

.properties-context-icon-button.active,
.properties-context-icon-button[aria-pressed="true"] {
    color: #fff;
    background: #28649a;
    border-color: #3d87c4;
}

.properties-context-icon-button img {
    width: 1rem;
    height: 1rem;
    object-fit: contain;
}

.properties-context-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    box-sizing: border-box;
}

.properties-context-field > span {
    color: #bbb;
    font-size: 0.6875rem;
    line-height: 1.1;
}

.properties-context-display {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-top: 0.125rem;
}

.properties-context-section-title {
    color: #bbb;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.1;
}

.properties-context-toggle-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3125rem;
}

.properties-context-toggle-grid {
    display: grid;
    gap: 0.3125rem;
}

.properties-context-toggle-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.properties-context-toggle-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.properties-context-toggle-button {
    min-height: 1.875rem;
    padding: 0.3125rem 0.5rem;
    color: #ddd;
    background: #3c3c3c;
    border: 1px solid #555;
    border-radius: 0.25rem;
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.15;
    text-align: left;
    cursor: pointer;
}

.properties-context-toggle-grid .properties-context-toggle-button {
    text-align: center;
}

.properties-context-toggle-button:hover {
    background: #464646;
    border-color: #666;
}

.properties-context-toggle-button.active,
.properties-context-toggle-button[aria-pressed="true"] {
    color: #fff;
    background: #28649a;
    border-color: #3d87c4;
}

.properties-context-toggle-button:disabled,
.properties-context-toggle-button[aria-disabled="true"] {
    color: #777;
    background: #333;
    border-color: #444;
    cursor: default;
    opacity: 0.7;
}

.properties-context-toggle-button:disabled:hover,
.properties-context-toggle-button[aria-disabled="true"]:hover {
    background: #333;
    border-color: #444;
}

/* ===== Дополнительные стили для инструментов ===== */

.tool-input {
    margin-bottom: 0.75rem;
}

.tool-input-header {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #ccc;
}

.tool-input-field {
    width: 100%;
    padding: 0.375rem 0.5rem;
    background: #4a4a4a;
    color: #eee;
    border: 1px solid #555;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    box-sizing: border-box;
}

.tool-input-field:focus {
    outline: none;
    border-color: #0078d7;
    background: #5a5a5a;
}

.tool-range-field {
    width: 100%;
    accent-color: #0078d7;
}

/* Пустая палитра */
.tool-palette-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.empty-state {
    text-align: center;
    color: #aaa;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #ccc;
}

.empty-message {
    font-size: 0.75rem;
    line-height: 1.4;
}






/* Кнопки в tool-palette */
.tool-buttons {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.tool-button {
    flex: 1;
    padding: 0.5rem;
    background: #4a4a4a;
    border: 1px solid #555;
    border-radius: 0.25rem;
    color: #eee;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all 0.2s;
}

.tool-button.primary {
    background: #0078d7;
    border-color: #0078d7;
}

.tool-button.primary:hover {
    background: #005a9e;
}

.tool-button:hover {
    background: #5a5a5a;
}

.tool-button.active {
    background: #0078d7;
    border-color: #0078d7;
    color: #fff;
}

.tool-button-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

.tool-button-grid {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tool-button-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-button-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-button-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tool-button-grid.cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tool-button.tool-button-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.375rem;
    min-width: 0;
    padding: 0.5rem;
    text-align: center;
}

.tool-button-icon-media {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.tool-button-icon-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tool-button-icon-label {
    display: block;
    font-size: 0.75rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.tool-embedded-device-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 0.625rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tool-embedded-device-card img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.tool-embedded-device-title {
    color: #eee;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25;
}

.equipment-frame-preview {
    display: grid;
    grid-template-columns: repeat(5, 40px);
    gap: 0;
    align-items: center;
    justify-content: start;
    margin-top: 0.5rem;
}

.equipment-frame-preview-button {
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equipment-frame-preview-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.equipment-frame-preview-button.active {
    border-color: #ffd166;
    background: rgba(255, 209, 102, 0.12);
}

.equipment-finish-color-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.25rem;
    margin-top: 0.375rem;
}

.equipment-finish-color-button.classic {
    min-height: 2.125rem;
    padding: 0.375rem;
}

.equipment-finish-color-button.compact {
    min-height: 1.625rem;
    padding: 0.1875rem;
}

.equipment-finish-color-swatch {
    display: block;
    width: 0.875rem;
    height: 0.875rem;
    margin: auto;
    border: 1px solid #9ca3af;
}

.equipment-finish-color-button.classic .equipment-finish-color-swatch {
    width: 1.125rem;
    height: 1.125rem;
}

.tool-button-icon-only {
    aspect-ratio: 1 / 1;
    justify-content: center;
}

.tool-button-icon-only .tool-button-icon-label {
    display: none;
}

.tool-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Список элементов щита */
.tool-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.tool-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: #404040;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.tool-item.dragging {
    opacity: 0.55;
}

.tool-item.drag-over {
    border-color: #3d87c4;
    box-shadow: inset 0 2px 0 #3d87c4;
}

.tool-item.indent {
    margin-left: 1.5rem;
    background: #3a3a3a;
}

.tool-item-name {
    flex: 1;
}

.tool-item-drag-handle,
.tool-item-drag-spacer {
    flex: 0 0 1.25rem;
    width: 1.25rem;
    margin-right: 0.65rem;
}

.tool-item-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #aaa;
    cursor: grab;
    font-size: 0.85rem;
    line-height: 1;
}

.tool-item-drag-handle:hover {
    color: #eee;
}

.tool-item-drag-handle:active {
    cursor: grabbing;
}

.tool-item-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.tool-item-badge {
    font-size: 0.7rem;
    color: #aaa;
    margin-right: 0.5rem;
}

.tool-item-delete {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.25rem;
}

.tool-item-delete:hover {
    color: #ff0000;
}

.tool-item-edit {
    background: #4a4a4a;
    border: 1px solid #666;
    color: #eee;
    border-radius: 0.25rem;
    padding: 0.2rem 0.45rem;
    font-size: 0.7rem;
    cursor: pointer;
}

.tool-item-edit:hover {
    background: #5a5a5a;
}

.tool-item.active {
    border-color: #0078d7;
}

.tool-item.editing {
    background: rgba(0, 120, 215, 0.22);
    border-color: #0078d7;
}

.tool-item.exceptions-mode {
    background: rgba(255, 170, 0, 0.16);
    border-color: #ffb020;
}

.tool-item.locked {
    color: #cfcfcf;
}

.tool-field.locked {
    opacity: 0.72;
    color: #cfcfcf;
}

.tool-dropdown.locked {
    opacity: 0.72;
}

.tool-field.locked input,
.tool-item.locked input,
.tool-dropdown.locked select {
    cursor: not-allowed;
}

.tool-item-lock {
    position: relative;
    display: inline-block;
    width: 0.8rem;
    height: 0.72rem;
    margin-left: 0.25rem;
    border: 1px solid #ffb020;
    border-radius: 0.12rem;
    box-sizing: border-box;
}

.tool-item-lock::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -0.42rem;
    width: 0.48rem;
    height: 0.46rem;
    border: 1px solid #ffb020;
    border-bottom: 0;
    border-radius: 0.32rem 0.32rem 0 0;
    transform: translateX(-50%);
    box-sizing: border-box;
}

.tool-item-lock::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.12rem;
    height: 0.12rem;
    background: #ffb020;
    border-radius: 50%;
    transform: translate(-50%, -35%);
}

.tool-item-compact {
    min-height: 2rem;
}

.tool-item.pending-add {
    border: 1px solid rgba(76, 175, 80, 0.85);
    background: rgba(76, 175, 80, 0.18);
}

.tool-item.pending-remove {
    border: 1px solid rgba(244, 67, 54, 0.85);
    background: rgba(244, 67, 54, 0.18);
}

.tool-block-status {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #bbb;
}

.tool-block-status.success {
    color: #7dd87d;
}

.tool-block-status.error,
.tool-info-text.error {
    color: #ffb0a8;
}

.properties-cable-group-row {
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.properties-cable-group-row:first-of-type {
    border-top: 0;
}

.properties-cable-group-main {
    min-width: 0;
}

.properties-cable-group-mark {
    font-weight: 700;
    color: #f4f4f4;
}

.properties-cable-group-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 8px 0;
}

.properties-cable-group-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    color: #cfcfcf;
    font-size: 12px;
}

.properties-cable-group-filter select {
    width: 100%;
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #3a3a3a;
    color: #eee;
    font-size: 12px;
}

.properties-cable-group-count {
    margin: 2px 0 4px;
    color: #aaa;
    font-size: 12px;
}

.properties-cable-group-purpose {
    margin-top: 3px;
    color: #cfcfcf;
    font-size: 12px;
    line-height: 1.35;
}

.properties-cable-group-message {
    margin-top: 4px;
    color: #cfcfcf;
    font-size: 12px;
    line-height: 1.35;
}

.properties-cable-group-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.properties-cable-group-action {
    width: 24px;
    height: 22px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #3a3a3a;
    color: #eee;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
}

.properties-cable-group-action:hover {
    border-color: #7aa7d9;
}

.properties-cable-group-action.active {
    border-color: #8bbff0;
    background: rgba(78, 146, 214, 0.35);
}

.properties-cable-group-assigned {
    margin-left: 4px;
    color: #aaa;
    font-size: 12px;
}






/* Кнопки в tool-palette */
.tool-buttons {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.tool-button {
    flex: 1;
    padding: 0.5rem;
    background: #4a4a4a;
    border: 1px solid #555;
    border-radius: 0.25rem;
    color: #eee;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all 0.2s;
}

.tool-button.primary {
    background: #0078d7;
    border-color: #0078d7;
}

.tool-button.primary:hover {
    background: #005a9e;
}

.tool-button:hover {
    background: #5a5a5a;
}

/* Чекбоксы */
.tool-checkbox {
    margin-bottom: 0.75rem;
}

.tool-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #ccc;
    cursor: pointer;
}

.tool-checkbox input {
    cursor: pointer;
}

/* Подсекции для шинных рядов */
.tool-subsection {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #555;
}

.tool-subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: bold;
    color: #ddd;
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}

.tool-subsection-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Кнопка-иконка */
.tool-button-icon {
    background: #4a4a4a;
    border: 1px solid #555;
    border-radius: 0.25rem;
    color: #ccc;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
}

.tool-button-icon:hover {
    background: #5a5a5a;
    color: #fff;
}

/* Шинный ряд */
.tool-busbar-row {
    background: #3a3a3a;
    border-radius: 0.25rem;
    padding: 0.5rem;
}

.tool-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #555;
}

.tool-row-title {
    font-size: 0.75rem;
    font-weight: bold;
    color: #ddd;
}

.tool-row-delete {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 0.7rem;
}

.tool-row-delete:hover {
    color: #ff0000;
}

.tool-row-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-busbars-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Элемент шины */
.tool-busbar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #404040;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.tool-busbar-item .tool-dropdown {
    flex: 2;
    margin-bottom: 0;
}

.tool-busbar-item .tool-input {
    flex: 1;
    margin-bottom: 0;
}

.tool-busbar-item .tool-item-delete {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.25rem;
}

.tool-busbar-item .tool-item-delete:hover {
    color: #ff0000;
}

/* Ссылка-кнопка */
.tool-button-link {
    background: none;
    border: none;
    color: #0078d7;
    cursor: pointer;
    font-size: 0.7rem;
    text-align: left;
    padding: 0.25rem 0;
}

.tool-button-link:hover {
    text-decoration: underline;
}


.tool-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #3a3a3a;
    border-radius: 0.25rem;
    border-left: 3px solid #0078d7;
}

.tool-info-text {
    font-size: 0.7rem;
    color: #aaa;
    line-height: 1.4;
}


.tool-block-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #555;
}

/* Маленькие кнопки в блоках */
.tool-button-small {
    flex: 1;
    padding: 0.375rem 0.5rem;
    background: #4a4a4a;
    border: 1px solid #555;
    border-radius: 0.25rem;
    color: #eee;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
    text-align: center;
}

.tool-button-small:hover {
    background: #5a5a5a;
    border-color: #777;
}

.tool-button-small:disabled {
    opacity: 0.5;
    cursor: default;
    background: #4a4a4a;
    border-color: #555;
}

.tool-button-small.primary {
    background: #0078d7;
    border-color: #0078d7;
}

.tool-button-small.primary:hover {
    background: #005a9e;
}

.tool-button-small.active {
    background: #0078d7;
    border-color: #0078d7;
    color: #fff;
}
