/* Sidebar "Label Tracts" status (mirrors .color-rule-status) */

.label-rule-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 8px;
    background: #eef3f8;
    border-left: 3px solid #2b6cb0;
    border-radius: 3px;
    font-size: 11px;
    color: #1f4870;
    font-weight: 500;
}

.label-rule-status-icon {
    font-size: 13px;
    line-height: 1;
}

#label-rule-status-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar quick-toggles (shown only when a label rule is active) */

.label-prefix-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: #1f4870;
    cursor: pointer;
    user-select: none;
}

.label-prefix-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.label-prefix-toggle:hover span {
    color: #143350;
}

.label-clear-btn {
    margin-top: 6px;
    width: 100%;
    font-size: 12px;
}

/* Label Rules Dialog — modal for Label by Attribute feature */

.label-rules-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9000;
    align-items: center;
    justify-content: center;
}

.label-rules-backdrop.visible {
    display: flex;
}

.label-rules-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.label-rules-content {
    padding: 18px 20px;
    overflow-y: auto;
}

.label-rules-summary {
    background: #f7f8fa;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #444;
}

.label-rules-section {
    margin-bottom: 18px;
}

.label-rules-section > label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 13px;
}

.label-rules-equivalences-link {
    margin-top: 6px;
    font-size: 11px;
    color: #666;
}

.label-rules-equivalences-link button {
    background: none;
    border: none;
    color: #2b6cb0;
    cursor: pointer;
    font-size: 11px;
    text-decoration: underline;
    padding: 0;
}

/* Multi-select column picker */

.label-rules-column-picker {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px;
    max-height: 220px;
    overflow-y: auto;
    background: #fafbfc;
}

.label-rules-column-group-header {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 6px 4px;
    border-top: 1px solid #eee;
    margin-top: 4px;
}

.label-rules-column-group-header:first-child {
    border-top: none;
    margin-top: 0;
}

.label-rules-column-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    border-radius: 3px;
    user-select: none;
}

.label-rules-column-item:hover {
    background: #eef3f8;
}

.label-rules-column-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Layout radios + show-names checkbox */

.label-rules-radio-row {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.label-rules-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.label-rules-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    user-select: none;
    margin-top: 4px;
}

/* Appearance fields (size, color, font) */

.label-rules-appearance {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.label-rules-field {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
}

.label-rules-field > span:first-child {
    font-weight: 500;
    color: #555;
}

.label-rules-field input[type="number"] {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}

.label-rules-field input[type="color"] {
    width: 40px;
    height: 28px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
}

.label-rules-field select {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.label-rules-suffix {
    color: #888;
    font-size: 12px;
}

/* Min-zoom slider + numeric input */

.label-rules-zoom-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.label-rules-zoom-row input[type="range"] {
    flex: 1;
    cursor: pointer;
}

.label-rules-zoom-row input[type="number"] {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}

.label-rules-zoom-hint {
    margin-top: 6px;
    font-size: 11px;
    color: #888;
}

/* Footer actions */

.label-rules-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.label-rules-actions-right {
    display: flex;
    gap: 8px;
}

.label-rules-actions button {
    padding: 7px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.label-rules-actions button:hover:not(:disabled) {
    background: #f0f4f8;
}

.label-rules-actions button#lr-apply-btn {
    background: #2b6cb0;
    border-color: #2b6cb0;
    color: white;
}

.label-rules-actions button#lr-apply-btn:hover:not(:disabled) {
    background: #1f4d80;
}

.label-rules-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.label-rules-actions button.secondary {
    background: white;
    color: #555;
}
